[BioPython] parsing error in Bio.Sequencing.Ace
Hyung-Yong Kim
yong27 at bioinfo.sarang.net
Mon Apr 12 03:34:43 EDT 2004
Hi,
I'm parsing the ACE file made by phrap. But there is some parsing error.
$ cat aceToAbs.py
#!/home/yong27/bin/python
import sys
from Bio.Sequencing import Ace
for contig in Ace.Iterator(sys.stdin, Ace.RecordParser()):
sys.stdout.write(contig.contig_name+'-----------\n')
for af in contig.af:
sys.stdout.write(af.name+' '+str(af.padded_start)+'\n')
$ ./aceToAbs.py < 040407.fasta.screen.ace.1 > out
Traceback (most recent call last):
File "./aceToAbs.py", line 6, in ?
for contig in Ace.Iterator(sys.stdin,Ace.RecordParser()):
File "/home/yong27/python/lib/python2.3/site-packages/Bio/Sequencing/Ace.py", line 206, in next
return self._parser.parse(File.StringHandle(data))
File "/home/yong27/python/lib/python2.3/site-packages/Bio/Sequencing/Ace.py", line 225, in parse
self._scanner.feed(uhandle, self._consumer)
File "/home/yong27/python/lib/python2.3/site-packages/Bio/Sequencing/Ace.py", line 315, in feed
self._scan_record(handle, consumer)
File "/home/yong27/python/lib/python2.3/site-packages/Bio/Sequencing/Ace.py", line 363, in _scan_record
read_and_call(uhandle,consumer.ct_start,start='CT')
File "/home/yong27/python/lib/python2.3/site-packages/Bio/ParserSupport.py", line 301, in read_and_call
method(line)
File "/home/yong27/python/lib/python2.3/site-packages/Bio/Sequencing/Ace.py", line 502, in ct_start
raise SyntaxError, 'CT tag does not start with CT{'
SyntaxError: CT tag does not start with CT{
This problem seems that because parser don't clarify the distinction between 'CT' record and nucleic acid '^CT'.
Temporary solution is to modify 362 line of Ace.py
if line.startswith('CT'): --> if line.startswith('CT{'):
It needs to be modified.
Hyung-Yong Kim
---------------------------------
National Livestock Research Institute (Korea)
Division of Animal Genomics & Bioinformatics
http://bioinfo.sarang.net
More information about the BioPython
mailing list