ArtPoon / gotoh2

Lightweight and customizable Python/C extension for pairwise alignment of genetic sequences using the Gotoh algorithm
GNU Affero General Public License v3.0
5 stars 2 forks source link

Convert_fasta doesn't strip \r line terminators #21

Closed ewong347 closed 4 years ago

ewong347 commented 4 years ago

Probably would be a quick fix (gotoh2_utils.py line 90) from

sequence += line.strip('\n').upper()

to

sequence += line.strip('\n').strip('\r').upper()
>>> handle = open(cwd+'/data/weeklydumps/baseline/GISAID-0417_0508.fasta')
>>> fasta=convert_fasta(handle)
>>> handle.close()
>>> fasta[0]
['hCoV-19/Australia/NT12/2020|EPI_ISL_426900|2020-03-25\r', ''NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNACTTTCGATCTCTTGTAGATCTGTTCTCTAAACGAACTTTAA\rAA........