Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ build-backend = "maturin"

[project]
name = "taxonomy"
dynamic = ["version"]
classifier = [
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3",
Expand Down
2 changes: 2 additions & 0 deletions src/formats/ncbi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
Ok(gt)
}

pub fn save<'t, T: 't, P: AsRef<Path>, X: Taxonomy<'t, T>>(

Check warning on line 86 in src/formats/ncbi.rs

View workflow job for this annotation

GitHub Actions / clippy

bound is defined in more than one place
tax: &'t X,
out_dir: P,
) -> TaxonomyResult<()>
Expand Down Expand Up @@ -127,6 +127,7 @@
fn can_import_ncbi() {
let nodes =
"1\t|\t1\t|\tno rank\t|\t\t|\t8\t|\t0\t|\t1\t|\t0\t|\t0\t|\t0\t|\t0\t|\t0\t|\t\t|
10239\t|\t1\t|\tno_rank\t|\t\t|\t9\t|\t0\t|\t1\t|\t0\t|\t0\t|\t0\t|\t0\t|\t0\t|\t\t|
2\t|\t131567\t|\tsuperkingdom\t|\t\t|\t0\t|\t0\t|\t11\t|\t0\t|\t0\t|\t0\t|\t0\t|\t0\t|\t\t|
543\t|\t91347\t|\tfamily\t|\t\t|\t0\t|\t1\t|\t11\t|\t1\t|\t0\t|\t1\t|\t0\t|\t0\t|\t\t|
561\t|\t543\t|\tgenus\t|\t\t|\t0\t|\t1\t|\t11\t|\t1\t|\t0\t|\t1\t|\t0\t|\t0\t|\t\t|
Expand All @@ -137,6 +138,7 @@
131567\t|\t1\t|\tno rank\t|\t\t|\t8\t|\t1\t|\t1\t|\t1\t|\t0\t|\t1\t|\t1\t|\t0\t|\t\t|";
let names = "1\t|\tall\t|\t\t|\tsynonym\t|
1\t|\troot\t|\t\t|\tscientific name\t|
10239\t|\tViruses\t|\t\t|\tscientific name\t|
2\t|\tBacteria\t|\tBacteria <prokaryotes>\t|\tscientific name\t|
543\t|\tEnterobacteriaceae\t|\t\t|\tscientific name\t|
561\t|\tEscherchia\t|\t\t|\tmisspelling\t|
Expand Down
2 changes: 1 addition & 1 deletion src/rank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ impl FromStr for TaxRank {
"breed" => Ok(TaxRank::Breed),
"strain" => Ok(TaxRank::Strain),
"serogroup" => Ok(TaxRank::SeroGroup),
"no rank" => Ok(TaxRank::Unspecified),
"no rank" | "no_rank" => Ok(TaxRank::Unspecified),
"biotype" => Ok(TaxRank::Biotype),
"clade" => Ok(TaxRank::Clade),
"forma specialis" => Ok(TaxRank::FormaSpecialis),
Expand Down
2 changes: 1 addition & 1 deletion test_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ def test_prune(self):
new_tax = self.tax.prune(remove=["561"])
self.assertIsNone(new_tax.node("561"))
self.assertIsNone(new_tax.node("562"))
self.assertEqual(len(new_tax), 7)
self.assertEqual(len(new_tax), 8)

new_tax = self.tax.prune(keep=["561"])
self.assertEqual(len(new_tax), 8)
Expand Down
1 change: 1 addition & 0 deletions tests/data/names.dmp
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,4 @@
91347 | Enterobacterales | | scientific name |
131567 | biota | | synonym |
131567 | cellular organisms | | scientific name |
10239 | Viruses | | scientific name |
1 change: 1 addition & 0 deletions tests/data/nodes.dmp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
1 | 1 | no rank | | 8 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | |
10239 | 1 | no_rank | | 9 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | |
2 | 131567 | superkingdom | | 0 | 0 | 11 | 0 | 0 | 0 | 0 | 0 | |
543 | 91347 | family | | 0 | 1 | 11 | 1 | 0 | 1 | 0 | 0 | |
561 | 543 | genus | | 0 | 1 | 11 | 1 | 0 | 1 | 0 | 0 | |
Expand Down
Loading