Commit 7e208707 by Celine Mercier

Added genbank parser

parent e8090a44
......@@ -6,6 +6,7 @@ from obitools3.parsers.fastq import fastqIterator
from obitools3.parsers.tab import tabIterator
from obitools3.parsers.ngsfilter import ngsfilterIterator
from obitools3.parsers.embl import emblIterator
from obitools3.parsers.genbank import genbankIterator
oligore = re.compile(b"^[ACGTRYSWKMBDHVN]+$",re.I)
......@@ -135,6 +136,15 @@ def entryIteratorFactory(lineiterator,
buffersize=buffersize),
Nuc_Seq,
format)
elif format==b'genbank':
return (genbankIterator(lineiterator,
skip=skip,
only=only,
firstline=first,
buffersize=buffersize),
Nuc_Seq,
format)
raise NotImplementedError('File format iterator not implemented yet')
......@@ -10,6 +10,7 @@ from obitools3.parsers.fastq import fastqIterator
from obitools3.parsers.tab import tabIterator
from obitools3.parsers.ngsfilter import ngsfilterIterator
from obitools3.parsers.embl import emblIterator
from obitools3.parsers.genbank import genbankIterator
from obitools3.parsers.universal import entryIteratorFactory
from obitools3.writers.fasta import FastaNucWriter
......@@ -478,6 +479,13 @@ def open_uri(uri,
only=only)
else:
raise NotImplementedError('Output sequence file format not implemented')
elif format==b"genbank":
if input:
iseq = genbankIterator(file,
skip=skip,
only=only)
else:
raise NotImplementedError('Output sequence file format not implemented')
else:
raise NotImplementedError('Sequence file format not implemented')
elif seqtype==b"prot":
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment