subsetBins
subsetBins |
R Documentation |
Create a SQM object containing only the requested bins, and the contigs and ORFs contained in them.
Description
Create a SQM object containing only the requested bins, and the contigs and ORFs contained in them.
Usage
subsetBins(
SQM,
bins = NULL,
rank = NULL,
tax = NULL,
min_completeness = NULL,
max_contamination = NULL,
tax_source = "bins",
trusted_functions_only = FALSE,
ignore_unclassified_functions = FALSE,
rescale_tpm = TRUE,
rescale_copy_number = TRUE,
allow_empty = FALSE
)
Arguments
|
SQM object to be subsetted. |
|
character. Vector of bins to be
selected. If provided, will
override |
|
character. The taxonomic rank
from which to select the desired
taxa ( |
|
character. A taxon or vector of taxa to be selected. |
|
numeric. Discard bins with
completeness lower than this
value (default |
|
numeric. Discard bins with
contamination higher than this
value (default |
|
character, source data used for
taxonomic subsetting (if
|
|
logical. If |
|
logical. If |
|
logical. If |
|
logical. If |
|
(internal use only). |
Value
SQM object containing only the requested bins.
See Also
subsetContigs, subsetORFs
Examples
data(Hadza)
# Which are the most complete bins?
topBinNames = rownames(Hadza$bins$table)[order(Hadza$bins$table[,"Completeness"],
decreasing=TRUE)][1:2]
# Subset with the most complete bin.
topBin = subsetBins(Hadza, topBinNames[1])
# Subset with all the bins over 90% completeness
over90 = subsetBins(Hadza, min_completeness = 90)
# Subset with bins from the Phascolarctobacterium genus using SqueezeMeta's taxonomy
phasco = subsetBins(Hadza, tax_source = "bins_sqm", rank = "genus", tax = "Phascolarctobacterium")
# Subset with binsfrom the Bacteroidota phylum using GTDB taxonomy
bact = subsetBins(Hadza, tax_source = "bins_gtdb", rank = "phylum", tax = "Bacteroidota")