Skip to content

Commit ea0c04b

Browse files
committed
Add no_rank to ranks
Use a synonym instead of a new rank Fix typo
1 parent 0d5bd5a commit ea0c04b

File tree

4 files changed

+5
-1
lines changed

4 files changed

+5
-1
lines changed

src/formats/ncbi.rs

+2
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ mod tests {
127127
fn can_import_ncbi() {
128128
let nodes =
129129
"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|
130+
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|
130131
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|
131132
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|
132133
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|
@@ -137,6 +138,7 @@ mod tests {
137138
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|";
138139
let names = "1\t|\tall\t|\t\t|\tsynonym\t|
139140
1\t|\troot\t|\t\t|\tscientific name\t|
141+
10239\t|\tViruses\t|\t\t|\tscientific name\t|
140142
2\t|\tBacteria\t|\tBacteria <prokaryotes>\t|\tscientific name\t|
141143
543\t|\tEnterobacteriaceae\t|\t\t|\tscientific name\t|
142144
561\t|\tEscherchia\t|\t\t|\tmisspelling\t|

src/rank.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ impl FromStr for TaxRank {
239239
"breed" => Ok(TaxRank::Breed),
240240
"strain" => Ok(TaxRank::Strain),
241241
"serogroup" => Ok(TaxRank::SeroGroup),
242-
"no rank" => Ok(TaxRank::Unspecified),
242+
"no rank" | "no_rank" => Ok(TaxRank::Unspecified),
243243
"biotype" => Ok(TaxRank::Biotype),
244244
"clade" => Ok(TaxRank::Clade),
245245
"forma specialis" => Ok(TaxRank::FormaSpecialis),

tests/data/names.dmp

+1
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,4 @@
4848
91347 | Enterobacterales | | scientific name |
4949
131567 | biota | | synonym |
5050
131567 | cellular organisms | | scientific name |
51+
10239 | Viruses | | scientific name |

tests/data/nodes.dmp

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
1 | 1 | no rank | | 8 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | |
2+
10239 | 1 | no_rank | | 9 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | |
23
2 | 131567 | superkingdom | | 0 | 0 | 11 | 0 | 0 | 0 | 0 | 0 | |
34
543 | 91347 | family | | 0 | 1 | 11 | 1 | 0 | 1 | 0 | 0 | |
45
561 | 543 | genus | | 0 | 1 | 11 | 1 | 0 | 1 | 0 | 0 | |

0 commit comments

Comments
 (0)