| subset {ballgown} | R Documentation |
subset ballgown objects to specific samples or genomic locations
subset(x, ...) ## S4 method for signature 'ballgown' subset(x, cond, genomesubset = TRUE)
x |
a ballgown object |
... |
further arguments to generic subset |
cond |
Condition on which to subset. See details. |
genomesubset |
if TRUE, subset |
To use subset, you must provide the cond argument as a
string representing a logical expression specifying your desired subset.
The subset expression can either involve column names of
texpr(x, "all") (if genomesubset is TRUE) or of
pData(x) (if genomesubset is FALSE). For example, if
you wanted a ballgown object for only chromosome 22, you might call
subset(x, "chr == 'chr22'"). (Be sure to handle quotes within
character strings appropriately).
a subsetted ballgown object, containing only the regions or samples
satisfying cond.
Alyssa Frazee
data(bg) bg_twogenes = subset(bg, "gene_id=='XLOC_000454' | gene_id=='XLOC_000024'") bg_twogenes # ballgown instance with 4 assembled transcripts and 20 samples bg_group0 = subset(bg, "group == 0", genomesubset=FALSE) bg_group0 # ballgown instance with 100 assembled transcripts and 10 samples