movSelect: Select movRes

movSelectR Documentation

Select movRes

Description

movSelect is a generic function to subset results from a pair of conditions of a movRes object.

movSelect(movDEGeneRes) subset results from a movDEGeneRes object.

movSelect(movDEPACRes) subset results from a movDEPACRes object.

movSelect(movUTRTrendRes) subset results from a movUTRTrendRes object.

movSelect(movAPASwitchRes) subset results from a movAPASwitchRes object.

movSelect(movIndexDiffRes) subset results from a movIndexDiffRes object.

Usage

movSelect(
  aMovRes,
  condpair,
  padjThd = NULL,
  valueThd = NULL,
  upThd = NULL,
  dnThd = NULL,
  ...
)

## S4 method for signature 'movDEGeneRes'
movSelect(
  aMovRes,
  condpair,
  padjThd = NULL,
  valueThd = NULL,
  upThd = NULL,
  dnThd = NULL,
  out,
  PACds = NULL
)

## S4 method for signature 'movDEPACRes'
movSelect(
  aMovRes,
  condpair,
  padjThd = NULL,
  valueThd = NULL,
  upThd = NULL,
  dnThd = NULL,
  out,
  PACds = NULL
)

## S4 method for signature 'movUTRTrendRes'
movSelect(
  aMovRes,
  condpair,
  padjThd = NULL,
  valueThd = NULL,
  upThd = NULL,
  dnThd = NULL,
  out
)

## S4 method for signature 'movAPASwitchRes'
movSelect(
  aMovRes,
  condpair,
  padjThd = NULL,
  valueThd = NULL,
  upThd = NULL,
  dnThd = NULL,
  out
)

## S4 method for signature 'movIndexDiffRes'
movSelect(
  aMovRes,
  condpair,
  padjThd = NULL,
  valueThd = NULL,
  upThd = NULL,
  dnThd = NULL,
  out
)

Arguments

aMovRes

a movRes object.

condpair

a pair of conditions, can be c('cond1','cond2') or 'cond1.cond2' or 'cond2.cond1'.

padjThd

cutoff to filter rows with aMovRes@pairwise$padj<padjThd.

valueThd

cutoff to filter rows with |aMovRes@pairwise$value|>=valueThd.

upThd

cutoff to filter up-regulated rows with aMovRes@pairwise$value>=upThd

dnThd

cutoff to filter down-regulated rows with aMovRes@pairwise$value<=dnThd. Only one parameter from valueThd, upThd, dnThd can be specified.

...

dependent on specific movSelect funtions.

out

should be [gene/pv/full] for movDEGeneRes, or [pa/pv/full] for movDEPACRes, or [gene/pa/pv/full] for movUTRTrendRes and movAPASwitchRes, ignoring case. out=gene, to output a gene list. out=pv, to output a data frame with two columns, padj and value, with each row being a gene. out=full, to output a data frame with full information. The content depends on the movRes class: a data frame with detailed [counts + padj + value] for movDEGeneRes; a data frame of movUTRTrendRes@fullList for movUTRTrendRes; a data frame of [PACds@anno + counts + value + padj] for movDEPACRes. Note: If the given condpair is not in the same order as the movRes, for example, condpair=cond1.cond2, but in movRes it is cond2.cond1, then the output value is movRes$value*(-1).

PACds

a PACdataset object which is used for calculating movRes. If out=full, then need to specify PACds.

Details

movSelect(aMovRes) generic function is used for subsetting results from a movRes object. This generic function is only internally used by other movSelect functions. If the order of condpair is not the same as the order of condpair in aMovRes, then the value of aMovRes is multiplied by -1.

Value

A list. Output of other movSelect functions is dependent on the specific movRes class and the out parameter.

Methods (by class)

  • movSelect(movDEGeneRes): for a movDEGeneRes object.

  • movSelect(movDEPACRes): for a movDEPACRes object.

  • movSelect(movUTRTrendRes): for a movUTRTrendRes object.

  • movSelect(movAPASwitchRes): for a movAPASwitchRes object.

  • movSelect(movIndexDiffRes): for a movIndexDiffRes object.

See Also

Other mov-like functions: movStat()

Examples

## Examples for movSelect(movDEGeneRes) ##
data(PACds)
## Detect DE genes in all pairwise conditions.
DEgene=movDEGene(PACds=PACds, method='DESeq2', group='group', minSumPAT=50)

## Select DE gene results with full information including the read counts in each sample.
selFull=movSelect(DEgene, condpair='embryo.anther',
              padjThd=0.05, valueThd=1, out='full', PACds=PACds)
head(selFull)

##  Select DE gene results with only padj and value. Here value is log2(embryo/anther).
sel1=movSelect(DEgene, condpair='embryo.anther', padjThd=0.05, valueThd=1, out='pv')
head(sel1)

## Here the condpair is Y.X, so the value is log2(anther/embryo)
sel2=movSelect(DEgene, condpair='anther.embryo', padjThd=0.05, valueThd=1, out='pv')
head(sel2)

## Output gene names of DE genes.
sel=movSelect(DEgene, condpair='embryo.anther', padjThd=0.05, upThd=0.5, out='gene')
head(sel)
## Examples for movSelect(movDEPACRes) ##
data(PACds)

## Detect DE PACs in all pairwise conditions
## using DESeq2 method, only PACs with total read counts in all samples >=20 are used.
DEPAC=movDEPAC(PACds, method='DESeq2', group='group', minSumPAT=20)
## Get PA list
movSelect(aMovRes=DEPAC, condpair='embryo.anther', padjThd=0.1, valueThd=0.5, out='PA')
## Get data frame of [padj, value]
movSelect(aMovRes=DEPAC, condpair='embryo.anther', padjThd=0.1, valueThd=0.5, out='pv')
## Detect DE PACs in all pairwise conditions using DEXseq method.
DEXPAC=movDEPAC(PACds, method='DEXseq', group='group', minSumPAT=20)
## Output full PA list
full=movSelect(aMovRes=DEXPAC, condpair='anther.embryo', padjThd=0.1, out='full', PACds=PACds)
## For method=DEXPAC, note that even valueThid=2,
## the final list may have items of value<2, because these items meet the padj cutoff.
pv=movSelect(aMovRes=DEXPAC, condpair='embryo.anther',
             padjThd=0.1, valueThd=2, out='pv'); min(abs(pv$value))
## When condpair is not the same order as in movRes, the output value is multiplied by -1
pv=movSelect(aMovRes=DEXPAC, condpair='anther.embryo',
             padjThd=0.1, valueThd=2, out='pv'); min(abs(pv$value))
##Get list for only upregulation
movSelect(aMovRes=DEXPAC, condpair='anther.embryo', padjThd=0.1, upThd=2, out='pv')
## If method is DEXPAC , when not set value thresholds,
##will automatelly use min(maxfc) to filter DE PACs.
movSelect(aMovRes=DEXPAC, condpair='anther.embryo', padjThd=0.1, out='pv')

BMILAB/movAPA documentation built on Jan. 3, 2024, 11:09 p.m.