Hello,
Quote:
Originally Posted by sadiexiaoyu
File "try", line 7, in <module>
out.write(id,a,"fasta")
TypeError: function takes exactly 1 argument (3 given)
|
write() expected only one string as parameter. So if you like to write these 3 arguments seperated with comma to the file you can do something like this:
Code:
from Bio import SeqIO
out = open("try_out.fasta", "w")
for seq_record in SeqIO.parse("try.fasta", "fasta"):
a = seq_record.seq
a = a[5:-6]
id = seq_record.id
out.write(id+","+a+","+"fasta"+"\n")
out.close()
The "\n" at the end is neccessary for linebreak, otherwise you would have all entrys in one line.
fin swimmer