Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def fasta_sequences(fasta_filename):
- with open(fasta_filename, 'r') as fasta_file:
- header, sequence = '', ''
- for line in fasta_file:
- if line.startswith('>'):
- if header:
- yield header, sequence
- header = line.strip()
- sequence = ''
- else:
- sequence += line.strip()
- yield header, sequence
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement