Learn R Programming

PSCBS: Analysis of Parent-Specific DNA Copy Numbers

The PSCBS package implements the parent-specific copy-number segmentation presented in Olshen et al. (2011). Package vignette 'Parent-specific copy-number segmentation using Paired PSCBS' provides a detailed introduction for running PSCBS segmentation. It's available as:

vignette("PairedPSCBS", package = "PSCBS")

Below is an excerpt of the example found in that vignette:

library(PSCBS)

## Get single-chromosome example data
data <- exampleData("paired.chr01")
str(data)
# ’data.frame’: 73346 obs. of 6 variables:
# $ chromosome: int 1 1 1 1 1 1 1 1 1 1 ...
# $ x : int 1145994 2224111 2319424 2543484 2926730 2941694 3084986 3155127..
# $ CT : num 1.625 1.071 1.406 1.18 0.856 ...
# $ betaT : num 0.757 0.771 0.834 0.778 0.229 ...
# $ CN : num 2.36 2.13 2.59 1.93 1.71 ...
# $ betaN : num 0.827 0.875 0.887 0.884 0.103 ...

## Drop total copy-number outliers
data <- dropSegmentationOutliers(data)

## Identify chromosome arms from data
gaps <- findLargeGaps(data, minLength = 1e+06)
knownSegments <- gapsToSegments(gaps)

## Parent-specific copy-number segmentation
fit <- segmentByPairedPSCBS(data, knownSegments = knownSegments)

## Get segments as a data.frame
segments <- getSegments(fit, simplify = TRUE)
segments
#    chromosome tcnId dhId     start       end tcnNbrOfLoci  tcnMean
# 1           1     1    1    554484  33414619         9413 1.381375
# 2           1     1    2  33414619  86993745        17433 1.378570
# 3           1     2    1  86993745  87005243            2 3.185100
# 4           1     3    1  87005243 119796080        10404 1.389763
# 5           1     3    2 119796080 119932126           72 1.470789
# 6           1     3    3 119932126 120992603          171 1.439620
# 7           1     4    1 120992604 141510002            0       NA
# 8           1     5    1 141510003 185527989        13434 2.065400
# 9           1     6    1 185527989 199122066         4018 2.707400
# 10          1     7    1 199122066 206512702         2755 2.586100
# 11          1     8    1 206512702 206521352           14 3.871900
# 12          1     9    1 206521352 247165315        15581 2.637500
#    tcnNbrOfSNPs tcnNbrOfHets dhNbrOfLoci dhMean    c1Mean    c2Mean
# 1          2765         2765        2765 0.4868 0.3544608 1.0269140
# 2          4544         4544        4544 0.5185 0.3318907 1.0466792
# 3             0            0           0     NA        NA        NA
# 4          2777         2777        2777 0.5203 0.3333347 1.0564285
# 5             8            8           8 0.0767 0.6789900 0.7917995
# 6            52           52          52 0.5123 0.3510514 1.0885688
# 7             0            0          NA     NA        NA        NA
# 8          3770         3770        3770 0.0943 0.9353164 1.1300836
# 9          1271         1271        1271 0.2563 1.0067467 1.7006533
# 10          784          784         784 0.2197 1.0089669 1.5771331
# 11            9            9           9 0.2769 1.3998854 2.4720146
# 12         4492         4492        4492 0.2290 1.0167563 1.6207438

## Plot copy-number tracks
plotTracks(fit)

Parallel processing

The package supports segmentation of the chromosomes in parallel (asynchronously) via futures by adding the following

future::plan("multisession")

to the beginning of the PSCBS script. Everything else will work the same. To reset to non-parallel processing, use future::plan("sequential").

To configure this automatically whenever the package is loaded, see future vignette 'A Future for R: Controlling Default Future Strategy'.

References

  • Bengtsson H, Neuvial P, Speed TP. TumorBoost: Normalization of allele-specific tumor copy numbers from a single pair of tumor-normal genotyping microarrays, BMC Bioinformatics, 2010. DOI: 10.1186/1471-2105-11-245. PMID: 20462408, PMCID: PMC2894037

  • Olshen AB, Bengtsson H, Neuvial P, Spellman PT, Olshen RA, Seshan VA. Parent-specific copy number in paired tumor-normal studies using circular binary segmentation, Bioinformatics, 2011. DOI: 10.1093/bioinformatics/btr329. PMID: 21666266. PMCID: PMC3137217

Installation

R package PSCBS is available on CRAN and can be installed in R as:

# install.packages("BiocManager")
BiocManager::install(c("aroma.light", "DNAcopy"))

install.packages("PSCBS")

Pre-release version

To install the pre-release version that is available in Git branch develop on GitHub, use:

remotes::install_github("HenrikBengtsson/PSCBS", ref="develop")

This will install the package from source.

Copy Link

Version

Install

install.packages('PSCBS')

Monthly Downloads

762

Version

0.67.0

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Last Published

February 17th, 2024

Functions in PSCBS (0.67.0)

callAmplifications.CBS

Calls (focal) amplifications
callCopyNeutral.PairedPSCBS

Calls segments that have a neutral total copy number
callGainsAndLosses.CBS

Calls gains and losses
estimateDeltaCN.PairedPSCBS

Estimates the length of one total copy-number (TCN) unit
callSegmentationOutliers

Calls/drops single-locus outliers along the genome
estimateDeltaABBySmallDH.PairedPSCBS

Estimate a threshold for calling allelic balance from DH
dropChangePoints.AbstractCBS

Drops zero or more change points
callOutliers.CBS

Calls outliers
estimateDeltaLOHByMinC1ForNonAB.PairedPSCBS

Estimate a threshold for calling LOH from DH
callLOH.PairedPSCBS

Calls segments that are in LOH
estimateDeltaLOH.PairedPSCBS

Estimate a threshold for calling LOH from DH
callROH.PairedPSCBS

Calls segments that are in ROH
findNeutralCopyNumberState

Call segments to be copy neutral based on allelic imbalance calls and total copy number estimates
gapsToSegments.data.frame

Gets the genomic segments that are complementary to the gaps
getSegments.AbstractCBS

Gets the segments
getSegments.PSCBS

Gets the segments
exampleData

Gets an example data set
estimateStandardDeviation.CBS

Estimates the whole-genome standard deviation of the signals
findLargeGaps

Identifies gaps of a genome where there exist no observations
extractTCNAndDHs.PairedPSCBS

Extract TCN and DH mean levels per segment
dropRegions.AbstractCBS

Drops chromosomal regions (a connected set of segments)
estimateDeltaAB.PairedPSCBS

Estimate a threshold for calling allelic balance from DH
mergeNonCalledSegments.CBS

Merge neighboring segments that are not called
mergeThreeSegments.AbstractCBS

Merge a segment and its two flanking segments
mergeTwoSegments.AbstractCBS

Merge two neighboring segments
mergeTwoSegments.PairedPSCBS

Merge two neighboring segments
nbrOfLoci.AbstractCBS

Gets the number of loci
pruneByHClust.AbstractCBS

Prunes the CN profile by pruning and merging through hierarchical clustering
getLocusData.AbstractCBS

Gets the locus-level data
getSampleName.AbstractCBS

Gets the name of the sample segmented
nbrOfSegments.AbstractCBS

Gets the number of segments
ploidy.AbstractCBS

Gets and sets ploidy
normalizeTotalCNs.AbstractCBS

Normalizes copy numbers such that the whole-genome average total copy number is two
pruneBySdUndo.CBS

Prune the CBS profile by dropping change points that are too small
extractMinorMajorCNs.PairedPSCBS

Extract minor and major copy-number mean levels per segment
randomSeed

Sets and resets the .Random.seed in the global environment
estimateKappa.PairedPSCBS

Estimate global background in segmented copy numbers
getChromosomes.AbstractCBS

Gets the set of chromosomes
updateMeansTogether.AbstractCBS

Updates the CN mean levels jointly in sets of segments
updateMeans.AbstractCBS

Updates the CN mean levels for each segment independently
setSampleName.AbstractCBS

Sets the name of the sample segmented
testROH.numeric

Tests if a segment is in Run-of-Homozygosity (ROH)
report.AbstractCBS

Generates a report of the segmentation results
getFractionOfGenomeLost.CBS

Calculates the fraction of the genome lost, gained, or aberrant either way
estimateKappaByC1Density.PairedPSCBS

Estimate global background in segmented copy numbers
getBootstrapLocusSets.PairedPSCBS

Generates original and bootstrapped segment-specific index sets
getCallStatistics.CBS

Calculates various call statistics per chromosome
extractSegmentMeansByLocus.CBS

Extracts segments means at each locus
getSmoothLocusData.CBS

Gets smoothed locus-level data
plotTracks.AbstractCBS

Plots the segmentation result along the genome
hclustCNs.AbstractCBS

Performs a hierarchical clustering of the CN mean levels
installDNAcopy

Install the DNAcopy package
nbrOfChangePoints.AbstractCBS

Gets the number of change points
plotTracks.CBS

Plots copy numbers along the genome
joinSegments.CBS

Joins neighboring segments such that there is no gap in between them
nbrOfChromosomes.AbstractCBS

Gets the number of chromosomes
resetSegments.AbstractCBS

Reset the segments
segmentByCBS

Segment genomic signals using the CBS method
plotTracks1.PairedPSCBS

Plots parental specific copy numbers along the genome
segmentByNonPairedPSCBS

Segment total copy numbers and allele B fractions using the Non-paired PSCBS method
pruneByDP.AbstractCBS

Prunes the CN profile using dynamical programming
segmentByPairedPSCBS

Segment total copy numbers and allele B fractions using the Paired PSCBS method
writeSegments.PSCBS

Writes the table of segments to file
weightedQuantile

Weighted Quantile Value
writeSegments.CBS

Writes the table of segments to file
callCopyNeutralByTCNofAB.PairedPSCBS

Calls regions that are copy neutral
bootstrapTCNandDHByRegion.PairedPSCBS

Estimate confidence intervals of TCN and DH segment levels
callGNL.PairedPSCBS

Calls segments that are gained, copy neutral, or lost
PairedPSCBS

The PairedPSCBS class
Restructuring AbstractCBS objects

Restructuring AbstractCBS objects
callAB.PairedPSCBS

Calls segments that are in allelic balance
callAllelicBalanceByDH.PairedPSCBS

Calls segments that are in allelic balance
PSCBS

The PSCBS class
PSCBS-package

Package PSCBS
Non-documented objects

Non-documented objects
AbstractCBS

The AbstractCBS class
CBS

The CBS class
as.data.frame.AbstractCBS

Gets the table of segments
as.data.frame.CBS

Gets the table of segments
as.CBS.DNAcopy

Coerces a DNAcopy object to a CBS object
as.DNAcopy.CBS

Coerces a CBS object to a DNAcopy object
c.CBS

Concatenates segmentation results
NonPairedPSCBS

The NonPairedPSCBS class