f=open('sequence3.fasta', 'r')
str=''
for line in f:
line2=line.rstrip('\n')
if (line2[0]!='>'):
str=str+line2
elif (len(line)==0):
break
str.rstrip('\n')
f.close()
The script is suppose to read 3 DNA sequences and connect them to one sequence. The problem is, I get this error:
IndexError: string index out of range
And when I write like this:
f=open('sequence3.fasta', 'r')
str=''
for line in f:
line.rstrip('\n')
if (line[0]!='>'):
str=str+line
elif (len(line)==0):
break
str.rstrip('\n')
f.close()
It runs but there are spaces in between. Thanks