subsetORFs {SQMtools} | R Documentation |
Select ORFs
Description
Create a SQM object containing only the requested ORFs, and the contigs and bins that contain them. Internally, all the other subset functions in this package end up calling subsetORFs
to do the work for them.
Usage
subsetORFs(
SQM,
orfs,
tax_source = "orfs",
trusted_functions_only = FALSE,
ignore_unclassified_functions = FALSE,
rescale_tpm = FALSE,
rescale_copy_number = FALSE,
contigs_override = NULL
)
Arguments
SQM |
SQM object to be subsetted. |
orfs |
character. Vector of ORFs to be selected. |
tax_source |
character. Features used for calculating aggregated abundances at the different taxonomic ranks. Either |
trusted_functions_only |
logical. If |
ignore_unclassified_functions |
logical. If |
rescale_tpm |
logical. If |
rescale_copy_number |
logical. If |
contigs_override |
character. Optional vector of contigs to be included in the subsetted object. |
Value
SQM object containing the requested ORFs.
A note on contig/bins subsetting
While this function selects the contigs and bins that contain the desired orfs, it DOES NOT recalculate contig/bin abundance and statistics based on the selected ORFs only. This means that the abundances presented in tables such as SQM$contig$abund
or SQM$bins$tpm
will still refer to the complete contigs and bins, regardless of whether only a fraction of their ORFs are actually present in the returned SQM object. This is also true for the statistics presented in SQM$contigs$table
and SQM$bins$table
.
Examples
data(Hadza)
# Select the 100 most abundant ORFs in our dataset.
mostAbundantORFnames = names(sort(rowSums(Hadza$orfs$tpm), decreasing=TRUE))[1:100]
mostAbundantORFs = subsetORFs(Hadza, mostAbundantORFnames)