Learn R Programming

shazam (version 0.1.9)

testBaseline: Two-sided test of BASELINe PDFs

Description

testBaseline performs a two-sample signifance test of BASELINe posterior probability density functions (PDFs).

Usage

testBaseline(baseline, groupBy)

Arguments

baseline

Baseline object containing the db and grouped BASELINe PDFs returned by groupBaseline.

groupBy

string defining the column in the db slot of the Baseline containing sequence or group identifiers.

Value

A data.frame with test results containing the following columns:

  • REGION: sequence region, such as "CDR" and "FWR".

  • TEST: string defining the two group values compared.

  • PVALUE: two-sided p-value for the comparison.

  • FDR: FDR corrected PVALUE.

References

  1. Yaari G, et al. Quantifying selection in high-throughput immunoglobulin sequencing data sets. Nucleic Acids Res. 2012 40(17):e134. (Corretions at http://selection.med.yale.edu/baseline/correction/)

See Also

To generate the Baseline input object see groupBaseline.

Examples

Run this code
# NOT RUN {
# Subset example data
data(ExampleDb, package="alakazam")
db <- subset(ExampleDb, ISOTYPE == "IgG")

# Collapse clones
db <- collapseClones(db, sequenceColumn="SEQUENCE_IMGT",
                     germlineColumn="GERMLINE_IMGT_D_MASK",
                     method="thresholdedFreq", minimumFrequency=0.6,
                     includeAmbiguous=FALSE, breakTiesStochastic=FALSE)
                     
# Calculate BASELINe
baseline <- calcBaseline(db, 
                         sequenceColumn="SEQUENCE_IMGT",
                         germlineColumn="GERMLINE_IMGT_D_MASK", 
                         testStatistic="focused",
                         regionDefinition=IMGT_V,
                         targetingModel=HH_S5F,
                         nproc=1)

# Group PDFs by the sample identifier
grouped <- groupBaseline(baseline, groupBy="SAMPLE")

# Perform test on sample PDFs
testBaseline(grouped, groupBy="SAMPLE")
# }

Run the code above in your browser using DataLab