ropensci / taxizedb

Tools for Working with Taxonomic SQL Databases
Other
30 stars 7 forks source link

fix bug in 'name2taxid' for organism names with underscores originally #42

Closed gpli closed 6 years ago

gpli commented 6 years ago

For organism names with underscores originally, replacing underscores with spaces will give NA taxids, i.e. "haloarchaeon 3A1_DGR".

Description

Some oganisms have underscores originally, so skip replacing if there are already spaces.

Related Issue

fix #41

Example

> taxid2name("1071085")
[1] "haloarchaeon 3A1_DGR"
> taxid2name("1071085") %>% name2taxid
[1] "1071085"
arendsee commented 6 years ago

We should also update the function documentation for name2taxid and add a new test. I'm happy to make both of these changes after the merge.

arendsee commented 6 years ago

@gpli BTW, congratulations on your first pull request!

arendsee commented 6 years ago

@sckott I assume the failure in circleci has nothing to do with the new material?

sckott commented 6 years ago

i'll check

codecov-io commented 6 years ago

Codecov Report

Merging #42 into master will increase coverage by 0.16%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #42      +/-   ##
==========================================
+ Coverage   48.15%   48.32%   +0.16%     
==========================================
  Files          13       13              
  Lines         623      625       +2     
==========================================
+ Hits          300      302       +2     
  Misses        323      323
Impacted Files Coverage Δ
R/ap_name2taxid.R 82.85% <100%> (+1.03%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 686b059...6300b8a. Read the comment docs.

arendsee commented 6 years ago

@gpli Thanks!

gpli commented 6 years ago

@arendsee Thanks for your kindly reminding, I'll pay more attention to my code. Besides, it's definitely my pleasure if I've done some contribution.