I am trying to read the file and put the two sequences (ie Spar and Sbay) into two variables seq1 and seq2. So far I only know how to pass everything to one sequence by using this code.
filename = 'AQY2.fasta'
readfile = open(filename, 'r')
seq1 = ''
seq2 = ''
for line in readfile.readlines():
if ( line[0] == '>' ):
header = line[1:]
else:
seq1 = seq1 + line
readfile.close()
print(seq1)
Can anyone help me to read the two sequences into seq1 and seq2?