Skip to content

Commit

Permalink
add region test on wrong seq ID #250
Browse files Browse the repository at this point in the history
  • Loading branch information
oschwengers committed Nov 27, 2023
1 parent afc8f33 commit 0b96422
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
12 changes: 12 additions & 0 deletions test/data/NC_002127.1-region.wrong-ids.gff3
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
##gff-version 3
##feature-ontology https://github.com/The-Sequence-Ontology/SO-Ontologies/blob/v3.1/so.obo
# Annotated with Bakta
# Software: v1.8.2
# Database: v5.0, light
# DOI: 10.1099/mgen.0.000685
# URL: github.com/oschwengers/bakta
##sequence-region NC_002127.1 1 3306
NC_002127.1 Bakta region 1 3306 . + . ID=NC_002127.1;Name=NC_002127.1;Is_circular=true
NC_002127.1 ? CDS 32 736 . + 0 ID=DOGAIA_00005;NAME=alternative downstream start codon test case 1
wrong_id ? CDS 981 1121 . + 0 ID=DOGAIA_00006;NAME=additional overlapping CDS test case 3
NC_002127.1 ? CDS 1348 2229 . - 0 ID=DOGAIA_00015;NAME=alternative downstream start codon test case 2
14 changes: 12 additions & 2 deletions test/test_regions.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,25 @@
from .conftest import FILES


def test_wrong_seq_id_failiing(tmpdir):
# CDS test on plasmid
proc = run(
['bin/bakta', '--db', 'test/db', '--verbose', '--output', tmpdir, '--force', '--prefix', 'test', '--regions', f'test/data/NC_002127.1-region.wrong-ids.gff3'] +
['--skip-tmrna', '--skip-trna', '--skip-rrna', '--skip-ncrna', '--skip-ncrna-region', '--skip-sorf', '--skip-ori', '--skip-gap', '--skip-plot'] +
['test/data/NC_002127.1.fna.gz']
)
assert proc.returncode != 0


@pytest.mark.parametrize(
'regions',
[
('NC_002127.1-region.gff3'), # GFF3
('NC_002127.1-region.gbff') # Genbank
]
)
def test_bakta_plasmid(regions, tmpdir):
# full test on plasmid
def test_regions_plasmid(regions, tmpdir):
# CDS test on plasmid
proc = run(
['bin/bakta', '--db', 'test/db', '--verbose', '--output', tmpdir, '--force', '--prefix', 'test', '--regions', f'test/data/{regions}'] +
['--skip-tmrna', '--skip-trna', '--skip-rrna', '--skip-ncrna', '--skip-ncrna-region', '--skip-sorf', '--skip-ori', '--skip-gap', '--skip-plot'] +
Expand Down

0 comments on commit 0b96422

Please sign in to comment.