get_txids: Get taxonomic IDs by rank

View source: R/user-get.R

get_txidsR Documentation

Get taxonomic IDs by rank

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

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

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'))

ropensci/phylotaR documentation built on July 21, 2024, 1:01 a.m.