Last data update: 2014.03.03

R: Extract the table of counts from a MIMOSA model
countsTableR Documentation

Extract the table of counts from a MIMOSA model

Description

Extract the table of counts from a MIMOSA model

Usage

countsTable(object, proportion = FALSE)

## S4 method for signature 'MIMOSAResult'
countsTable(object, proportion = FALSE)

## S4 method for signature 'MCMCResult'
countsTable(object, proportion = FALSE)

## S4 method for signature 'MDMixResult'
countsTable(object, proportion = FALSE)

## S3 method for class 'MIMOSAResultList'
countsTable(object, proportion = FALSE)

## S4 method for signature 'MIMOSAResultList'
countsTable(object, proportion = FALSE)

Arguments

object

a MIMOSAResult

proportion

logical return the counts or the proportions

Value

a data.frame of counts to which the model was fit.

a data.frame of counts for the stimulated and unstimulated samples

Examples

data(ICS)
E<-ConstructMIMOSAExpressionSet(ICS,
  reference=ANTIGEN%in%'negctrl',measure.columns=c('CYTNUM','NSUB'),
  other.annotations=c('CYTOKINE','TCELLSUBSET','ANTIGEN','UID'),
  default.cast.formula=component~UID+ANTIGEN+CYTOKINE+TCELLSUBSET,
  .variables=.(TCELLSUBSET,CYTOKINE,UID),
  featureCols=1,ref.append.replace='_REF')

result<-MIMOSA(NSUB+CYTNUM~UID+TCELLSUBSET+CYTOKINE|ANTIGEN,
    data=E, method='EM',
    subset=RefTreat%in%'Treatment'&ANTIGEN%in%'ENV',
    ref=ANTIGEN%in%'ENV'&RefTreat%in%'Reference')
head(countsTable(result))
head(countsTable(result,proportion=TRUE))

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(MIMOSA)
Loading required package: MASS
Loading required package: plyr
Loading required package: reshape

Attaching package: 'reshape'

The following objects are masked from 'package:plyr':

    rename, round_any

Loading required package: Biobase
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colnames, do.call, duplicated, eval, evalq,
    get, grep, grepl, intersect, is.unsorted, lapply, lengths, mapply,
    match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, rank,
    rbind, rownames, sapply, setdiff, sort, table, tapply, union,
    unique, unsplit

Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.

Loading required package: ggplot2

This is package 'modeest' written by P. PONCET.
For a complete list of functions, use 'library(help = "modeest")' or 'help.start()'.

> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/MIMOSA/countsTable.Rd_%03d_medium.png", width=480, height=480)
> ### Name: countsTable
> ### Title: Extract the table of counts from a MIMOSA model
> ### Aliases: countsTable countsTable,MCMCResult-method
> ###   countsTable,MDMixResult-method countsTable,MIMOSAResult-method
> ###   countsTable,MIMOSAResultList-method countsTable.MIMOSAResultList
> 
> ### ** Examples
> 
> data(ICS)
> E<-ConstructMIMOSAExpressionSet(ICS,
+   reference=ANTIGEN%in%'negctrl',measure.columns=c('CYTNUM','NSUB'),
+   other.annotations=c('CYTOKINE','TCELLSUBSET','ANTIGEN','UID'),
+   default.cast.formula=component~UID+ANTIGEN+CYTOKINE+TCELLSUBSET,
+   .variables=.(TCELLSUBSET,CYTOKINE,UID),
+   featureCols=1,ref.append.replace='_REF')
> 
> result<-MIMOSA(NSUB+CYTNUM~UID+TCELLSUBSET+CYTOKINE|ANTIGEN,
+     data=E, method='EM',
+     subset=RefTreat%in%'Treatment'&ANTIGEN%in%'ENV',
+     ref=ANTIGEN%in%'ENV'&RefTreat%in%'Reference')
Warning message:
In .local(formula, data, ...) :
  Formula does not contain the RefTreat variable. It will be added automatically. Set RT=FALSE to disable this.
> head(countsTable(result))
                         n.stim.NSUB n.stim.CYTNUM n.unstim.NSUB_REF
1_ENV_IFNg_CD4_Treatment       74999             1             74997
1_ENV_TNF_CD4_Treatment        75000             0             74999
1_ENV_IL2_CD4_Treatment        74999             1             74999
2_ENV_IFNg_CD4_Treatment       74996             4             74996
2_ENV_TNF_CD4_Treatment        75000             0             74999
2_ENV_IL2_CD4_Treatment        74999             1             75000
                         n.unstim.CYTNUM_REF
1_ENV_IFNg_CD4_Treatment                   3
1_ENV_TNF_CD4_Treatment                    1
1_ENV_IL2_CD4_Treatment                    1
2_ENV_IFNg_CD4_Treatment                   4
2_ENV_TNF_CD4_Treatment                    1
2_ENV_IL2_CD4_Treatment                    0
> head(countsTable(result,proportion=TRUE))
                              NSUB       CYTNUM  NSUB_REF   CYTNUM_REF
1_ENV_IFNg_CD4_Treatment 0.9999867 1.333333e-05 0.9999600 4.000000e-05
1_ENV_TNF_CD4_Treatment  1.0000000 0.000000e+00 0.9999867 1.333333e-05
1_ENV_IL2_CD4_Treatment  0.9999867 1.333333e-05 0.9999867 1.333333e-05
2_ENV_IFNg_CD4_Treatment 0.9999467 5.333333e-05 0.9999467 5.333333e-05
2_ENV_TNF_CD4_Treatment  1.0000000 0.000000e+00 0.9999867 1.333333e-05
2_ENV_IL2_CD4_Treatment  0.9999867 1.333333e-05 1.0000000 0.000000e+00
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>