Description Usage Arguments Details Value Author(s) Examples
Subset mt objects based on sample metadata
1 |
mmt |
(required) Data list as loaded with |
sub_genes |
(optional) A string specifying a logical row subset operation on the mtgene dataframe in the mt object parsed to subset. |
sub_samples |
(optional) A string specifying a logical row subset operation on the mtmeta dataframe in the mt object parsed to subset. |
minreads |
Minimum number of reads pr. gene. Genes below this value will be removed. (default: |
frac0 |
Fraction of zeros allowed per gene. Genes with a higher fraction of zeros will be removed. (default: |
normalise |
Normalise the read counts AFTER reads have been removed by the minreads argument but BEFORE any sample/gene subsetting. (default:
|
The function mt_subset
operates in three steps:
Filter - genes according to minreads
and frac0
.
Normalise - as specified in normalise
.
Subset - according to sub_genes
and sub_samples
.
Subsetting are performed on the mtmeta/mtgene data by subset and the whole object is then adjusted accordingly.
A modifed mt object
Thomas Yssing Michaelsen tym@bio.aau.dk
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ## Not run:
# Get some data.
data("example_mmt")
# Let's subset to contig 1, 7675, and 69676.
mt1 <- mt_subset(example_mmt,sub_genes = "contig %in% c(1,7675,69676)")
mt1
# Let's subset to specific organism.
mt2 <- mt_subset(example_mmt,sub_samples = "Organism == 'Brocadia'")
mt2
# Let's do both and remove genes with less than 10000 reads in total.
mt3 <- mt_subset(example_mmt,
sub_samples = "Organism == 'Brocadia'",
sub_genes = "contig %in% c(1,7675,69676)",
minreads = 10000)
mt3
# You can also normalise the data and subset.
mt4 <- mt_subset(example_mmt,
sub_samples = "Organism == 'Brocadia'",
sub_genes = "contig %in% c(1,7675,69676)",
minreads = 10000,
normalise = "libsize")
mt4 # Note "Normalised:" is now included.
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.