Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Seq = "AA" #This the sequence of characters
- def complement (Seq):
- for nuc in Seq: # converting the sequence of characters into the desirable character
- if nuc == 'A':
- comp = 'T'
- return comp
- print "The complement of the Sequence AA is", complement(Seq)
- if nuc == 'A':
- comp = 'T'
- return comp
- >>> Seq = "AA"
- >>> Seq.replace('A','T')
- 'TT'
- >>> Seq = "AA"
- >>> ''.join(['T' for i in Seq if i=='A'])
- 'TT'
- complement = {"A":"T", "C":"G", "G":"C", "T":"A"}
- seq = "ACGT"
- complement_seq = "".join([complement[b] for b in seq])
- complement_seq
- TGCA
- from Bio.Seq import Seq
- my_seq = Seq("ACGT")
- my_seq.complement()
- Seq('TGCA', Alphabet())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement