Skip to content

Commit

Permalink
update vignettes
Browse files Browse the repository at this point in the history
  • Loading branch information
sckott committed Jun 30, 2017
1 parent 9c3020d commit 85d4cd9
Show file tree
Hide file tree
Showing 7 changed files with 449 additions and 289 deletions.
72 changes: 45 additions & 27 deletions inst/vign/name_cleaning.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ has a sister method with and trailing underscore, e.g., `get_tsn()` and `get_tsn
```r
get_tsn_(searchterm = "Quercus b")
#> $`Quercus b`
#> # A tibble: 5 × 4
#> # A tibble: 5 x 4
#> tsn scientificName commonNames
#> <chr> <chr> <chr>
#> 1 19300 Quercus bicolor swamp white oak,ch<ea>ne bicolore
Expand All @@ -125,7 +125,7 @@ number of a range of numbers:
```r
get_tsn_(searchterm = "Quercus b", rows = 1)
#> $`Quercus b`
#> # A tibble: 1 × 4
#> # A tibble: 1 x 4
#> tsn scientificName commonNames nameUsage
#> <chr> <chr> <chr> <chr>
#> 1 19300 Quercus bicolor swamp white oak,ch<ea>ne bicolore accepted
Expand All @@ -135,7 +135,7 @@ get_tsn_(searchterm = "Quercus b", rows = 1)
```r
get_tsn_(searchterm = "Quercus b", rows = 1:2)
#> $`Quercus b`
#> # A tibble: 2 × 4
#> # A tibble: 2 x 4
#> tsn scientificName commonNames nameUsage
#> <chr> <chr> <chr> <chr>
#> 1 19300 Quercus bicolor swamp white oak,ch<ea>ne bicolore accepted
Expand Down Expand Up @@ -227,30 +227,42 @@ in a programmatic workflow straight away.
```r
spp <- names_list(rank = "species", size = 10)
gnr_resolve(names = spp, preferred_data_sources = 11)
#> user_supplied_name submitted_name
#> 1 Eucalyptus oreades Eucalyptus oreades
#> 2 Alloispermum insuetum Alloispermum insuetum
#> 3 Thymus rudis Thymus rudis
#> 4 Thymus rudis Thymus rudis
#> 5 Trichosanthes dafangensis Trichosanthes dafangensis
#> 6 Ectropothecium subhaplocladum Ectropothecium subhaplocladum
#> 7 Persoonia mitchellii Persoonia mitchellii
#> 8 Gilia propinqua Gilia propinqua
#> 9 Aberemoa furfuracea Aberemoa furfuracea
#> 10 Myrcia australasiae Myrcia australasiae
#> 11 Lotus borbasii Lotus borbasii
#> matched_name
#> 1 Eucalyptus oreades R. Baker
#> 2 Alloispermum insuetum C.F.Fernández, Urbatsch & G.A.Sullivan
#> 3 Thymus rudis A.Kern.
#> 4 Thymus rudis A.Kern. ex Mazzetti
#> 5 Trichosanthes dafangensis N.G. Ye & S.J. Li
#> 6 Ectropothecium subhaplocladum Brotherus, 1928
#> 7 Persoonia mitchellii Meissn.
#> 8 Gilia propinqua (Suksd.) St. John
#> 9 Aberemoa furfuracea (A. St.-Hil.) Baill.
#> 10 Myrcia australasiae F.Muell.
#> 11 Lotus borbasii Ujhelyi
#> user_supplied_name submitted_name
#> 1 Helichrysum candollei Helichrysum candollei
#> 2 Haworthia retusa Haworthia retusa
#> 3 Crypsinus bakeri Crypsinus bakeri
#> 4 Mangifera philippinensis Mangifera philippinensis
#> 5 Selaginella atirrensis Selaginella atirrensis
#> 6 Hymenostomum sullivanii Hymenostomum sullivanii
#> 7 Hymenostomum sullivanii Hymenostomum sullivanii
#> 8 Cytisus urumoffii Cytisus urumoffii
#> 9 Cytisus urumoffii Cytisus urumoffii
#> 10 Cytisus urumoffii Cytisus urumoffii
#> 11 Baptisia uniflora Baptisia uniflora
#> 12 Baptisia uniflora Baptisia uniflora
#> 13 Baptisia uniflora Baptisia uniflora
#> 14 Baptisia uniflora Baptisia uniflora
#> 15 Nephelium xerocarpum Nephelium xerocarpum
#> 16 Baccharis gnaphalioides Baccharis gnaphalioides
#> 17 Baccharis gnaphalioides Baccharis gnaphalioides
#> matched_name
#> 1 Helichrysum candollei (Bojer ex DC.) R.Vig. & Humbert
#> 2 Haworthia retusa (L.) Duval
#> 3 Crypsinus bakeri (Luerss.) Tag.
#> 4 Mangifera philippinensis Mukherji
#> 5 Selaginella atirrensis Hieron.
#> 6 Hymenostomum sullivanii C. Müller ex Geheeb, 1897
#> 7 Hymenostomum sullivanii C. Müller
#> 8 Cytisus urumoffii Davidov ex Stoj.
#> 9 Cytisus urumoffii Davidoff ex Stoyanoff
#> 10 Cytisus urumoffii Davidoff
#> 11 Baptisia uniflora Hook.
#> 12 Baptisia uniflora (Michx.) Nutt.
#> 13 Baptisia uniflora (Michx.) Sm.
#> 14 Baptisia uniflora Spreng.
#> 15 Nephelium xerocarpum (Bl.) Cambess.
#> 16 Baccharis gnaphalioides Spreng.
#> 17 Baccharis gnaphalioides DC.
#> data_source_title score
#> 1 GBIF Backbone Taxonomy 0.988
#> 2 GBIF Backbone Taxonomy 0.988
Expand All @@ -263,6 +275,12 @@ gnr_resolve(names = spp, preferred_data_sources = 11)
#> 9 GBIF Backbone Taxonomy 0.988
#> 10 GBIF Backbone Taxonomy 0.988
#> 11 GBIF Backbone Taxonomy 0.988
#> 12 GBIF Backbone Taxonomy 0.988
#> 13 GBIF Backbone Taxonomy 0.988
#> 14 GBIF Backbone Taxonomy 0.988
#> 15 GBIF Backbone Taxonomy 0.988
#> 16 GBIF Backbone Taxonomy 0.988
#> 17 GBIF Backbone Taxonomy 0.988
```

## Other functions
Expand Down
34 changes: 25 additions & 9 deletions inst/vign/taxize_infotable.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,24 @@ Some key functions in taxize, what they do, and their data sources.

Function name | What it does | Source |
----------- | ----------- | ----------- |
children | Get direct children | COL, NCBI, ITIS |
classification | Upstream classification | COL, NCBI, ITIS, Tropicos, EOL, GBIF, NBN |
comm2sci | Get scientific from common names | EOL, NCBI, ITIS, Tropicos |
downstream | Downstream taxa to specified rank | COL, ITIS, GBIF |
get_ids | Get taxonomic identifiers | COL, NCBI, ITIS, Tropicos, EOL, GBIF, NBN |
resolve | Resolve names using any resolver | GNR, TNRS, iPlant |
sci2comm | Get common from scientific names | EOL, NCBI, ITIS |
synonyms | Retrieve synonyms given input names/identifiers | COL, NCBI, ITIS, Tropicos |
upstream | Retrieve upstream taxa given names/identifiers | COL, ITIS |
`children` | Get direct children | COL, NCBI, ITIS |
`classification` | Upstream classification | COL, NCBI, ITIS, Tropicos, EOL, GBIF, NBN |
`comm2sci` | Get scientific from common names | EOL, NCBI, ITIS, Tropicos |
`downstream` | Downstream taxa to specified rank | COL, ITIS, GBIF |
`get_ids` | Get taxonomic identifiers | COL, NCBI, ITIS, Tropicos, EOL, GBIF, NBN |
`resolve` | Resolve names using many resolvers | GNR, TNRS, iPlant |
`gnr_resolve` | Resolve names using Global Names Resolver | GNR |
`tnrs` | Phylotastic Taxonomic Name Resolution Service | NCBI, iPlant, MSW3 |
`tol_resolve` | Resolve names using any resolver | TOL |
`iplant_resolve` | iPlant name resolution| iPlant |
`sci2comm` | Get common from scientific names | EOL, NCBI, ITIS |
`synonyms` | Retrieve synonyms given input names/identifiers | COL, NCBI, ITIS, Tropicos |
`upstream` | Retrieve upstream taxa given names/identifiers | COL, ITIS |
`lowest_common` | Retrieve the lowest common taxon and rank for a given taxon name or ID | COL, ITIS, GBIF, TOL, NCBI |
`genbank2uid` | Get NCBI taxonomy UID from GenBankID | NCBI |
`tax_name` | Get taxonomic names for a given rank | NCBI, ITIS |
`tax_rank` | Get rank for a given taxonomic name | BOLD, COL, EOL, GBIF, NATSERV, NBN, TOL, TROPICOS, ITIS, NCBI, WORMS |
`tpl_get` | Get The Plant List csv files | TPL |

### Acronyms

Expand All @@ -30,3 +39,10 @@ upstream | Retrieve upstream taxa given names/identifiers | COL, ITIS |
* iPlant: iPlant Name Resolution Service
* GNR: Global Names Resolver
* TNRS: Taxonomic Name Resolution Service
* TOL: Open Tree of Life
* MSW3: Mammal Species of the World, 3rd Edition
* TPL: The Plant List
* BOLD: Barcode of Life
* NATSERV: Natureserve
* TROPICOS: Tropicos plant database
* WORMS: World Register of Marine Species
34 changes: 25 additions & 9 deletions inst/vign/taxize_infotable.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,24 @@ Some key functions in taxize, what they do, and their data sources.

Function name | What it does | Source |
----------- | ----------- | ----------- |
children | Get direct children | COL, NCBI, ITIS |
classification | Upstream classification | COL, NCBI, ITIS, Tropicos, EOL, GBIF, NBN |
comm2sci | Get scientific from common names | EOL, NCBI, ITIS, Tropicos |
downstream | Downstream taxa to specified rank | COL, ITIS, GBIF |
get_ids | Get taxonomic identifiers | COL, NCBI, ITIS, Tropicos, EOL, GBIF, NBN |
resolve | Resolve names using any resolver | GNR, TNRS, iPlant |
sci2comm | Get common from scientific names | EOL, NCBI, ITIS |
synonyms | Retrieve synonyms given input names/identifiers | COL, NCBI, ITIS, Tropicos |
upstream | Retrieve upstream taxa given names/identifiers | COL, ITIS |
`children` | Get direct children | COL, NCBI, ITIS |
`classification` | Upstream classification | COL, NCBI, ITIS, Tropicos, EOL, GBIF, NBN |
`comm2sci` | Get scientific from common names | EOL, NCBI, ITIS, Tropicos |
`downstream` | Downstream taxa to specified rank | COL, ITIS, GBIF |
`get_ids` | Get taxonomic identifiers | COL, NCBI, ITIS, Tropicos, EOL, GBIF, NBN |
`resolve` | Resolve names using many resolvers | GNR, TNRS, iPlant |
`gnr_resolve` | Resolve names using Global Names Resolver | GNR |
`tnrs` | Phylotastic Taxonomic Name Resolution Service | NCBI, iPlant, MSW3 |
`tol_resolve` | Resolve names using any resolver | TOL |
`iplant_resolve` | iPlant name resolution| iPlant |
`sci2comm` | Get common from scientific names | EOL, NCBI, ITIS |
`synonyms` | Retrieve synonyms given input names/identifiers | COL, NCBI, ITIS, Tropicos |
`upstream` | Retrieve upstream taxa given names/identifiers | COL, ITIS |
`lowest_common` | Retrieve the lowest common taxon and rank for a given taxon name or ID | COL, ITIS, GBIF, TOL, NCBI |
`genbank2uid` | Get NCBI taxonomy UID from GenBankID | NCBI |
`tax_name` | Get taxonomic names for a given rank | NCBI, ITIS |
`tax_rank` | Get rank for a given taxonomic name | BOLD, COL, EOL, GBIF, NATSERV, NBN, TOL, TROPICOS, ITIS, NCBI, WORMS |
`tpl_get` | Get The Plant List csv files | TPL |

### Acronyms

Expand All @@ -30,3 +39,10 @@ upstream | Retrieve upstream taxa given names/identifiers | COL, ITIS |
* iPlant: iPlant Name Resolution Service
* GNR: Global Names Resolver
* TNRS: Taxonomic Name Resolution Service
* TOL: Open Tree of Life
* MSW3: Mammal Species of the World, 3rd Edition
* TPL: The Plant List
* BOLD: Barcode of Life
* NATSERV: Natureserve
* TROPICOS: Tropicos plant database
* WORMS: World Register of Marine Species
70 changes: 35 additions & 35 deletions inst/vign/taxize_vignette.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,7 @@ classification(specieslist, db = 'itis')

```
#> $`Abies procera`
#> # A tibble: 12 × 3
#> name rank id
#> <chr> <chr> <chr>
#> 1 Plantae kingdom 202422
#> 2 Viridiplantae subkingdom 954898
#> 3 Streptophyta infrakingdom 846494
Expand All @@ -152,9 +150,7 @@ classification(specieslist, db = 'itis')
#> 12 Abies procera species 181835
#>
#> $`Pinus contorta`
#> # A tibble: 12 × 3
#> name rank id
#> <chr> <chr> <chr>
#> 1 Plantae kingdom 202422
#> 2 Viridiplantae subkingdom 954898
#> 3 Streptophyta infrakingdom 846494
Expand Down Expand Up @@ -265,7 +261,7 @@ get_nbnid(c("Zootoca vivipara","Pinus contorta"), rows = 1)
```

```
#> [1] "NHMSYS0001706186" "NHMSYS0000494848"
#> [1] "NHMSYS0001706186" "NBNSYS0000004786"
#> attr(,"class")
#> [1] "nbnid"
#> attr(,"match")
Expand All @@ -276,7 +272,7 @@ get_nbnid(c("Zootoca vivipara","Pinus contorta"), rows = 1)
#> [1] FALSE FALSE
#> attr(,"uri")
#> [1] "https://data.nbn.org.uk/Taxa/NHMSYS0001706186"
#> [2] "https://data.nbn.org.uk/Taxa/NHMSYS0000494848"
#> [2] "https://data.nbn.org.uk/Taxa/NBNSYS0000004786"
```

Or you can select a range of rows
Expand All @@ -287,22 +283,26 @@ get_nbnid(c("Zootoca vivipara","Pinus contorta"), rows = 1:3)
```

```
#> nbnid searchmatchtitle rank
#> nbnid scientificName rank
#> 1 NHMSYS0001706186 Zootoca vivipara species
#> 2 NHMSYS0020784960 Zootoca vivipara subsp. pannonica subspecies
#> 3 NHMSYS0001706185 Zootoca genus
#> namestatus
#> 1 Recommended
#> 2 Recommended
#> 3 Recommended
#> nbnid searchmatchtitle rank namestatus
#> 1 NHMSYS0000494848 Pinus contorta var. contorta variety Recommended
#> 2 NBNSYS0000004786 Pinus contorta species Recommended
#> 3 NHMSYS0000494848 Pinus contorta subsp. contorta subspecies Recommended
```

```
#> [1] "NHMSYS0001706186" "NHMSYS0000494848"
#> 3 NHMSYS0000461615 Bistorta vivipara species
#> taxonomicStatus
#> 1 accepted
#> 2 accepted
#> 3 synonym
#> nbnid scientificName rank
#> 1 NBNSYS0000004786 Pinus contorta species
#> 2 NHMSYS0000494848 Pinus contorta subsp. contorta subspecies
#> 3 NHMSYS0000494858 Pinus contorta subsp. murreyana subspecies
#> taxonomicStatus
#> 1 accepted
#> 2 synonym
#> 3 synonym
```

```
#> [1] "NHMSYS0001706186" "NBNSYS0000004786"
#> attr(,"class")
#> [1] "nbnid"
#> attr(,"match")
Expand All @@ -313,7 +313,7 @@ get_nbnid(c("Zootoca vivipara","Pinus contorta"), rows = 1:3)
#> [1] FALSE FALSE
#> attr(,"uri")
#> [1] "https://data.nbn.org.uk/Taxa/NHMSYS0001706186"
#> [2] "https://data.nbn.org.uk/Taxa/NHMSYS0000494848"
#> [2] "https://data.nbn.org.uk/Taxa/NBNSYS0000004786"
```

In addition, in case you don't want to do interactive name selection in the case where there are a lot of names, you can get all data back with functions of the form, e.g., `get_tsn_()`, and likewise for other data sources. For example:
Expand All @@ -325,7 +325,7 @@ NROW(out$`Poa annua`)
```

```
#> [1] 152
#> [1] 25
```

That's a lot of data, so we can get only certain rows back
Expand All @@ -337,17 +337,17 @@ get_nbnid_("Poa annua", rows = 1:10)

```
#> $`Poa annua`
#> ptaxonversionkey searchmatchtitle rank namestatus
#> 1 NBNSYS0000002544 Poa annua species Recommended
#> 2 NHMSYS0000461798 Poa genus Recommended
#> 3 NHMSYS0000461804 Poa laxa species Synonym
#> 4 NHMSYS0021060390 Poales order Recommended
#> 5 NBNSYS0000002551 Poa glauca species Recommended
#> 6 NBNSYS0000002547 Poa alpina species Recommended
#> 7 NHMSYS0000456981 Poa rigida species Synonym
#> 8 NBNSYS0000002551 Poa caesia species Synonym
#> 9 NBNSYS0000002545 Poa exilis species Undetermined
#> 10 NHMSYS0000461804 Poa minor species Synonym
#> guid scientificName rank taxonomicStatus
#> 1 NBNSYS0000002544 Poa annua species accepted
#> 2 NBNSYS0000002739 Adonis annua species synonym
#> 3 NBNSYS0200001901 Bellis annua species accepted
#> 4 NHMSYS0000456951 Carrichtera annua species synonym
#> 5 NBNSYS0200003392 Triumfetta annua species accepted
#> 6 NBNSYS0000002918 Lunaria annua species accepted
#> 7 NBNSYS0200002555 Lonas annua species accepted
#> 8 NBNSYS0000033325 Artemisia annua species accepted
#> 9 NHMSYS0000456951 Carrichtera annua species accepted
#> 10 NHMSYS0000461806 Poa imbecilla species synonym
```

## Coerce numerics/alphanumerics to taxon IDs
Expand Down Expand Up @@ -447,7 +447,7 @@ system.time( replicate(3, as.gbifid(c("2704179","2435099","3171445"), check=TRUE

```
#> user system elapsed
#> 0.072 0.002 1.703
#> 0.072 0.002 1.656
```

```r
Expand All @@ -456,7 +456,7 @@ system.time( replicate(3, as.gbifid(c("2704179","2435099","3171445"), check=FALS

```
#> user system elapsed
#> 0.001 0.000 0.001
#> 0.002 0.000 0.002
```

## What taxa are downstream of my taxon of interest?
Expand Down
Loading

0 comments on commit 85d4cd9

Please sign in to comment.