Last data update: 2014.03.03

R: PSCBS segmentation
segmentationPSCBSR Documentation

PSCBS segmentation

Description

Segmentation function. Uses the PSCBS package. This function is called via the fun.segmentation argument of runAbsoluteCN. The arguments are passed via args.segmentation.

Usage

segmentationPSCBS(normal, tumor, log.ratio, plot.cnv, 
    coverage.cutoff, sampleid = sampleid, exon.weight.file = NULL, 
    flavor = "tcn&dh", tauA = 0.03, vcf = NULL, tumor.id.in.vcf = 1, 
    verbose = TRUE, ...)

Arguments

normal

GATK coverage data for normal sample.

tumor

GATK coverage data for tumor sample.

log.ratio

Copy number log-ratios, one for each exon in coverage file.

plot.cnv

Segmentation plots.

coverage.cutoff

Minimum coverage in both normal and tumor.

sampleid

Sample id, used in output files.

exon.weight.file

Can be used to assign weights to exons. NOT SUPPORTED YET.

flavor

Flavor value for PSBCS. See segmentByNonPairedPSCBS.

tauA

tauA argument for PSCBS. See segmentByNonPairedPSCBS.

vcf

Optional VCF object with germline allelic ratios.

tumor.id.in.vcf

Id of tumor in case multiple samples are stored in VCF.

verbose

Verbose output.

...

Additional parameters passed to the segmentByNonPairedPSCBS function.

Value

A list with elements seg and size. "seg" contains the segmentation, "size" the size of all segments in base pairs.

Author(s)

Markus Riester

Examples

gatk.normal.file <- system.file("extdata", "example_normal.txt", 
    package="PureCN")
gatk.tumor.file <- system.file("extdata", "example_tumor.txt", 
    package="PureCN")
vcf.file <- system.file("extdata", "example_vcf.vcf", 
    package="PureCN")
gc.gene.file <- system.file("extdata", "example_gc.gene.file.txt", 
    package="PureCN")

ret <-runAbsoluteCN(gatk.normal.file=gatk.normal.file, 
    gatk.tumor.file=gatk.tumor.file, vcf.file=vcf.file, sampleid='Sample1', 
    gc.gene.file=gc.gene.file, fun.segmentation=segmentationPSCBS)

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(PureCN)
Loading required package: DNAcopy
Loading required package: VariantAnnotation
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

Loading required package: GenomeInfoDb
Loading required package: stats4
Loading required package: S4Vectors

Attaching package: 'S4Vectors'

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

    colMeans, colSums, expand.grid, rowMeans, rowSums

Loading required package: IRanges
Loading required package: GenomicRanges
Loading required package: SummarizedExperiment
Loading required package: Biobase
Welcome to Bioconductor

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

Loading required package: Rsamtools
Loading required package: Biostrings
Loading required package: XVector

Attaching package: 'VariantAnnotation'

The following object is masked from 'package:base':

    tabulate

> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/PureCN/segmentationPSCBS.Rd_%03d_medium.png", width=480, height=480)
> ### Name: segmentationPSCBS
> ### Title: PSCBS segmentation
> ### Aliases: segmentationPSCBS
> 
> ### ** Examples
> 
> gatk.normal.file <- system.file("extdata", "example_normal.txt", 
+     package="PureCN")
> gatk.tumor.file <- system.file("extdata", "example_tumor.txt", 
+     package="PureCN")
> vcf.file <- system.file("extdata", "example_vcf.vcf", 
+     package="PureCN")
> gc.gene.file <- system.file("extdata", "example_gc.gene.file.txt", 
+     package="PureCN")
> 
> ret <-runAbsoluteCN(gatk.normal.file=gatk.normal.file, 
+     gatk.tumor.file=gatk.tumor.file, vcf.file=vcf.file, sampleid='Sample1', 
+     gc.gene.file=gc.gene.file, fun.segmentation=segmentationPSCBS)
Loading GATK coverage files...
Sex of sample: ?
Removing 7 small exons.
Removing 15 low/high GC exons.
Loading VCF...
Assuming LIB-02240e4 is tumor in VCF file.
Found 2331 variants in VCF file.
Removing 0 non heterozygous (in matched normal) germline SNPs.
Removing 62 SNPs with AF < 0.03 or AF >= 0.97 or less than 3 supporting reads or depth < 15.
Found SOMATIC annotation in VCF. Setting somatic prior probabilities for somatic variants to 0.999 or to 1e-04 otherwise.
Segmenting data...

Attaching package: 'future'

The following object is masked from 'package:SummarizedExperiment':

    values

The following object is masked from 'package:GenomicRanges':

    values

The following object is masked from 'package:IRanges':

    values

The following object is masked from 'package:S4Vectors':

    values

Mean standard deviation of log-ratios: 0.41
Optimizing purity and ploidy. Will take a minute or two...
Local optima: 0.65/1.6, 0.5/2.4, 0.5/3.6, 0.65/3.2, 0.85/4.4, 0.35/2.8, 0.9/2.4, 0.75/4.8, 0.65/2.6, 0.5/2, 0.9/3.8, 0.25/1.8
Testing local optimum at purity 0.65 and total ploidy 1.6.
Fitting SNVs for purity 0.65 and tumor ploidy 1.36.
Analyzing: Sample1 
Optimized purity: 0.65
Testing local optimum at purity 0.5 and total ploidy 2.4.
Fitting SNVs for purity 0.48 and tumor ploidy 2.73.
Analyzing: Sample1 
Optimized purity: 0.48
Testing local optimum at purity 0.5 and total ploidy 3.6.
Fitting SNVs for purity 0.47 and tumor ploidy 5.09.
Analyzing: Sample1 
Optimized purity: 0.47
Testing local optimum at purity 0.65 and total ploidy 3.2.
Fitting SNVs for purity 0.62 and tumor ploidy 3.73.
Analyzing: Sample1 
Optimized purity: 0.62
Testing local optimum at purity 0.85 and total ploidy 4.4.
Fitting SNVs for purity 0.85 and tumor ploidy 4.73.
Analyzing: Sample1 
Optimized purity: 0.85
Testing local optimum at purity 0.35 and total ploidy 2.8.
Fitting SNVs for purity 0.38 and tumor ploidy 4.09.
Analyzing: Sample1 
Optimized purity: 0.38
Testing local optimum at purity 0.9 and total ploidy 2.4.
Fitting SNVs for purity 0.95 and tumor ploidy 2.36.
Analyzing: Sample1 
Optimized purity: 0.95
Testing local optimum at purity 0.75 and total ploidy 4.8.
Fitting SNVs for purity 0.73 and tumor ploidy 5.64.
Analyzing: Sample1 
Optimized purity: 0.73
Testing local optimum at purity 0.65 and total ploidy 2.6.
Fitting SNVs for purity 0.67 and tumor ploidy 2.81.
Analyzing: Sample1 
Optimized purity: 0.67
Testing local optimum at purity 0.5 and total ploidy 2.
Fitting SNVs for purity 0.5 and tumor ploidy 1.81.
Analyzing: Sample1 
Optimized purity: 0.5
Testing local optimum at purity 0.9 and total ploidy 3.8.
Fitting SNVs for purity 0.64 and tumor ploidy 3.73.
Analyzing: Sample1 
Optimized purity: 0.64
Testing local optimum at purity 0.25 and total ploidy 1.8.
Recalibrating log-ratios...
Testing local optimum at purity 0.25 and total ploidy 1.8.
Fitting SNVs for purity 0.38 and tumor ploidy 4.09.
Analyzing: Sample1 
Optimized purity: 0.38
Remember, posterior probabilities assume a correct SCNA fit.
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>