bioplus.seqtools

bioplus.seqtools.analyze_sites(some_list)[source]

requires the following input format: seq score cdist cons cdist = distance to center, cons = conservation value

bioplus.seqtools.complement(nucleotide)[source]

returns the complement of a single nucleotide

bioplus.seqtools.count_compare(a, b, rc=False)[source]

count_compare takes two default dictionaries (defaultdict objects), a and b, each with default factory “lambda: 0” and key-value pairs that specify the counts (value) of each sequence (key), and returns a new dictionary whose values are tuples (value_a,value_b), the values from a and b.

Reverse complements: if rc=True, count_seqs will count reverse complements as the same sequence and use the alphabetically prior sequence as the key. if rc=False, reverse complements will be treated as different sequences. If you have already ensured that the keys meet this condition, you should use rc=False, but rc=True is also safe.

note: defaultdict is in the collections module of the standard library

bioplus.seqtools.count_seqs(iterable, reverse_complement=True, ignore_case=True)[source]

count_seqs takes as input an iterable that yields sequences, and then returns the counts of each sequence as a defaultdict (similar to dict, can be recast as dict type).

Sorting: Use dictSort to sort, if needed.

Reverse complements: if rc=True, count_seqs will count reverse complements as the same sequence and use the alphabetically prior sequence as the key. if rc=False, reverse complements will be treated as different sequences.

bioplus.seqtools.get_first(seq1, seq2, ignore_case=True)[source]

returns the alphabetically prior of seq1 and seq2 if they are the same or we fail to order, return seq1

if ignore_case=True, we apply str.upper to each letter

bioplus.seqtools.rc(seq)[source]

returns the reverse complement of a sequence

bioplus.seqtools.reversecomplement(seq)

returns the reverse complement of a sequence

Previous topic

bioplus.peaktools

Next topic

bioplus.sitefinder

This Page