Comments (4)
I like dealing with either lists or data.frame's of the options you gave.
Cool. I like the data.frame
the most since it avoids numbers/NA as names.
I lean towards putting this off until next cran push
fine with me
from taxa.
Makes sense to do validation of ranks when database is specified and be specific to a database. ✔️
For order checking, if the ordering is wrong, do we error with message giving the correct order, or correct the order with message?
what is going on with the replication in ranks_ref
I believe i combined all the diff. rank names from diff. data providers, and just left duplicates in, they can def. be taken out.
Do you think this is important to get done before cran push?
from taxa.
For order checking, if the ordering is wrong, do we error with message giving the correct order, or correct the order with message?
I think correcting the order with a message makes more sense.
Thinking about this more, there might be some valid ranks that do no have an order (e.g. "unranked") and can therefore be put in any order relative to ordered ranks (e.g. "species").
This makes correcting for order and encoding it more difficult.
I dont think an ordered factor would work since AFAIK you cant make a ordered factor with some values ordered and other not. Below are the options for encoding the valid ranks in the database
class I came up with that handle a mixture of ordered and unordered ranks.
vector
> c("1" = "root", "2" = "domain", "3" = "kingdom", "NA" = "unkranked")
1 2 3 NA
"root" "domain" "kingdom" "unkranked"
list
> list("1" = c("root", "unkranked"), "2" = c("domain", "unkranked"), "3" = c("kingdom", "unkranked"))
$`1`
[1] "root" "unkranked"
$`2`
[1] "domain" "unkranked"
$`3`
[1] "kingdom" "unkranked"
data.frame
> data.frame(order = c(1:3, NA), rank = c("root", "domain", "kingdom", "unkranked"))
order rank
1 1 root
2 2 domain
3 3 kingdom
4 NA unkranked
Instead of the NA
, we could replicate "unranked" for each level as was done for the list above.
two categories
ordered_ranks <- c("root", "domain", "kingdom")
unordered_ranks <- c("unkranked")
Do you like any of those in particular or have another solution?
, they can def. be taken out.
Cool
Do you think this is important to get done before cran push?
Its not essential. If it turns out to be an easy change then I think it would be nice, but leaving it out would not pose any backward compatibility issues since we can use database-less ranks for now.
from taxa.
I like dealing with either lists or data.frame's of the options you gave.
I lean towards putting this off until next cran push
from taxa.
Related Issues (20)
- taxonomy_table function issue with add_id_column parameter. HOT 1
- Support matrix data type in parsers and subsetting functions
- news HOT 1
- Print method idea: tidy lists
- Is a `head` function needed for `taxmap`? HOT 2
- `taxa`: way to do operations on objects within it HOT 4
- Vectorizing some classes and reorganizing inheritance hierarchy HOT 49
- possible to put taxize in Suggests? HOT 2
- Assign taxon_rank based on n_supertaxa HOT 1
- Function to produce html/latex table of taxonomic and associated data ? HOT 3
- use cases section a bit outdated HOT 4
- HTTP errors when parsing long taxon_id list HOT 12
- No taxon_rank information when parsing from NCBI taxonomy HOT 1
- import of taxdump files HOT 3
- Error: Failed to install 'taxa' from GitHub HOT 1
- error in db_ref$get() after using $set() HOT 2
- creating a taxonomy database for PR2 HOT 10
- Error when using parse_tax_data function HOT 1
- Issues with CRAN check on 2022-03-10 HOT 1
- vctrs revdep issues HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from taxa.