Skip to content

Commit

Permalink
No output from example API
Browse files Browse the repository at this point in the history
Fixes #91
  • Loading branch information
Robaina committed Sep 9, 2023
1 parent 016ffb6 commit b32df7d
Show file tree
Hide file tree
Showing 11 changed files with 5,114 additions and 17 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ wiki/*
examples/data/*
examples/example_cli/*
examples/example_api/*
pyopensci_reviews/*
pyopensci_reviews/*
test_issue_91/*
12 changes: 4 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "pynteny"
version = "1.1.0"
version = "1.1.2"
description = "Synteny-aware hmm searches made easy in Python"
license = "Apache-2.0"
authors = ["Semidán Robaina Estévez <srobaina@ull.edu.es>"]
Expand All @@ -18,14 +18,10 @@ classifiers = [
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering :: Bio-Informatics",
"Natural Language :: English"
]
packages = [
{ include = "pynteny", from = "src" },
]
include = [
"src/pynteny/config.json"
"Natural Language :: English",
]
packages = [{ include = "pynteny", from = "src" }]
include = ["src/pynteny/config.json"]
[tool.poetry.dependencies]
python = "^3.8"
[tool.poetry.scripts]
Expand Down
2 changes: 1 addition & 1 deletion src/pynteny/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def __init__(
)
)
self._n_hmm_groups = len(self._parsed_structure["hmm_groups"])
self._n_hmms = len(self._hmms) # len(self._hmm_order_dict)
self._n_hmms = len(self._hmm_order_dict)
self._unordered = unordered

def _in_hmm_group(self, query_hmm_group: str, hmm_group: str) -> bool:
Expand Down
12 changes: 8 additions & 4 deletions tests/test_data/hmm_meta.tsv
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#ncbi_accession source_identifier label sequence_cutoff domain_cutoff hmm_length family_type for_structural_annotation for_naming for_AMRFinder product_name gene_symbol ec_numbers go_terms pmids taxonomic_range taxonomic_range_name taxonomic_rank_name n_refseq_protein_hits source name_orig
TIGR00170.1 TIGR00170 leuC 560.25 560.25 466 equivalog_domain Y Y N 3-isopropylmalate dehydratase large subunit leuC 4.2.1.33 GO:0003861,GO:0009098,GO:0009316 131567.0 cellular organisms no rank 38458 JCVI 3-isopropylmalate dehydratase, large subunit
TIGR00171.1 TIGR00171 leuD 116.25 116.25 188 equivalog_domain Y Y N 3-isopropylmalate dehydratase small subunit leuD 4.2.1.33 GO:0003861,GO:0009098,GO:0009316 131567.0 cellular organisms no rank 33829 JCVI 3-isopropylmalate dehydratase, small subunit
TIGR00973.1 TIGR00973 leuA 598.7 598.7 494 equivalog Y Y N 2-isopropylmalate synthase leuA 2.3.3.13 GO:0003852,GO:0009098 131567.0 cellular organisms no rank 20500 JCVI 2-isopropylmalate synthase
#ncbi_accession label product_name gene_symbol ec_numbers
TIGR00171.1 leuD 3-isopropylmalate dehydratase small subunit leuD 4.2.1.33
TIGR02084.1 leuD 3-isopropylmalate dehydratase small subunit leuD 4.2.1.33
TIGR00170.1 leuC 3-isopropylmalate dehydratase large subunit leuC 4.2.1.33
TIGR02083.1 LEU2 3-isopropylmalate dehydratase large subunit leuC 4.2.1.33
TIGR00973.1 leuA_bact 2-isopropylmalate synthase leuA 2.3.3.13
NF002084.0 PRK00915.1-1 2-isopropylmalate synthase leuA 2.3.3.13
TIGR00970.1 leuA_yeast 2-isopropylmalate synthase leuA 2.3.3.13
1,596 changes: 1,596 additions & 0 deletions tests/test_data/hmms/NF002084.0.HMM

Large diffs are not rendered by default.

1,719 changes: 1,719 additions & 0 deletions tests/test_data/hmms/TIGR00970.1.HMM

Large diffs are not rendered by default.

1,284 changes: 1,284 additions & 0 deletions tests/test_data/hmms/TIGR02083.1.HMM

Large diffs are not rendered by default.

495 changes: 495 additions & 0 deletions tests/test_data/hmms/TIGR02084.1.HMM

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion tests/test_hmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ def test_get_HMM_group_for_gene_symbol(self):
pgap = PGAP(this_file_dir / "test_data/hmm_meta.tsv")
hmm_group = pgap.get_HMM_group_for_gene_symbol("leuD")
self.assertEqual(
hmm_group, "TIGR00171.1", "Failed to retrieve HMM group from gene symbol"
hmm_group,
"TIGR00171.1|TIGR02084.1",
"Failed to retrieve HMM group from gene symbol",
)

def test_get_meta_info_for_HMM(self):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_integration_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def test_search(self):
with TemporaryDirectory() as tempdir:
search = Search(
data=tests_dir / "test_data/MG1655.fasta",
synteny_struc="<TIGR00171.1 0 <TIGR00170.1 1 <TIGR00973.1",
synteny_struc="<(TIGR00171.1|TIGR02084.1) 0 <(TIGR00170.1|TIGR02083.1) 1 <(TIGR00973.1|NF002084.0|TIGR00970.1)",
hmm_dir=tests_dir / "test_data/hmms",
hmm_meta=None,
outdir=Path(tempdir),
Expand Down
2 changes: 1 addition & 1 deletion tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def test_parse_genes_in_synteny_structure(self):
)
self.assertEqual(
parsed_struct,
"<TIGR00171.1 0 <TIGR00170.1 1 <TIGR00973.1",
"<(TIGR00171.1|TIGR02084.1) 0 <(TIGR00170.1|TIGR02083.1) 1 <(TIGR00973.1|NF002084.0|TIGR00970.1)",
"Failed to parse gene symbols in synteny structure",
)

Expand Down

0 comments on commit b32df7d

Please sign in to comment.