get_txids: Get taxonomic IDs by rank

Description Usage Arguments Details Value See Also Examples

Description

Return taxonomic IDs for a vector of sequence IDs or all sequences in a cluster. User can specify what rank the IDs should be returned. If NULL, the lowest level is returned.

Usage

1
2
get_txids(phylota, cid = NULL, sid = NULL, txids = NULL, rnk = NULL,
  keep_higher = FALSE)

Arguments

phylota

Phylota object

cid

Cluster ID

sid

Sequence ID(s)

txids

Vector of txids

rnk

Taxonomic rank

keep_higher

Keep higher taxonomic IDs?

Details

txids can either be provided by user or they can be determined for a vector of sids or for a cid. If keep_higher is TRUE, any sequence that has a identity that is higher than the given rank will be returned. If FALSE, these sequences will return ”.

Value

vector

See Also

Other tools-public: calc_mad, calc_wrdfrq, drop_by_rank, drop_clstrs, drop_sqs, get_clstr_slot, get_nsqs, get_ntaxa, get_sq_slot, get_stage_times, get_tx_slot, is_txid_in_clstr, is_txid_in_sq, list_clstrrec_slots, list_ncbi_ranks, list_seqrec_slots, list_taxrec_slots, plot_phylota_pa, plot_phylota_treemap, read_phylota, write_sqs

Examples

1
2
3
4
5
6
7
8
9
data('bromeliads')
# get all the genus IDs and names
genus_ids <- get_txids(phylota = bromeliads, txids = bromeliads@txids,
                       rnk = 'genus')
genus_ids <- unique(genus_ids)
# drop empty IDs -- this happens if a given lineage has no ID for specified rank
genus_ids <- genus_ids[genus_ids != '']
# get names
(get_tx_slot(phylota = bromeliads, txid = genus_ids, slt_nm = 'scnm'))

phylotaR documentation built on May 1, 2019, 9:26 p.m.