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

814

Version

0.68.0

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Henrik Bengtsson

Last Published

April 18th, 2025

Functions in PSCBS (0.68.0)

callGNL.PairedPSCBS

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

Calls segments that are in allelic balance
as.data.frame.AbstractCBS

Gets the table of segments
callCopyNeutral.PairedPSCBS

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

Calls gains and losses
callROH.PairedPSCBS

Calls segments that are in ROH
callSegmentationOutliers

Calls/drops single-locus outliers along the genome
callOutliers.CBS

Calls outliers
dropChangePoints.AbstractCBS

Drops zero or more change points
estimateDeltaLOHByMinC1ForNonAB.PairedPSCBS

Estimate a threshold for calling LOH from DH
estimateDeltaLOH.PairedPSCBS

Estimate a threshold for calling LOH from DH
estimateStandardDeviation.CBS

Estimates the whole-genome standard deviation of the signals
exampleData

Gets an example data set
getSegments.AbstractCBS

Gets the segments
as.data.frame.CBS

Gets the table of segments
getSegments.PSCBS

Gets the segments
dropRegions.AbstractCBS

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

Estimate a threshold for calling allelic balance from DH
estimateDeltaAB.PairedPSCBS

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

Gets the number of change points
nbrOfChromosomes.AbstractCBS

Gets the number of chromosomes
estimateDeltaCN.PairedPSCBS

Estimates the length of one total copy-number (TCN) unit
estimateKappaByC1Density.PairedPSCBS

Estimate global background in segmented copy numbers
getCallStatistics.CBS

Calculates various call statistics per chromosome
gapsToSegments.data.frame

Gets the genomic segments that are complementary to the gaps
extractSegmentMeansByLocus.CBS

Extracts segments means at each locus
findNeutralCopyNumberState

Call segments to be copy neutral based on allelic imbalance calls and total copy number estimates
getBootstrapLocusSets.PairedPSCBS

Generates original and bootstrapped segment-specific index sets
getLocusData.AbstractCBS

Gets the locus-level data
extractMinorMajorCNs.PairedPSCBS

Extract minor and major copy-number mean levels per segment
estimateKappa.PairedPSCBS

Estimate global background in segmented copy numbers
mergeNonCalledSegments.CBS

Merge neighboring segments that are not called
installDNAcopy

Install the DNAcopy package
nbrOfLoci.AbstractCBS

Gets the number of loci
nbrOfSegments.AbstractCBS

Gets the number of segments
joinSegments.CBS

Joins neighboring segments such that there is no gap in between them
pruneBySdUndo.CBS

Prune the CBS profile by dropping change points that are too small
pruneByHClust.AbstractCBS

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

Merge a segment and its two flanking segments
getChromosomes.AbstractCBS

Gets the set of chromosomes
randomSeed

Sets and resets the .Random.seed in the global environment
segmentByNonPairedPSCBS

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

Gets and sets ploidy
getFractionOfGenomeLost.CBS

Calculates the fraction of the genome lost, gained, or aberrant either way
normalizeTotalCNs.AbstractCBS

Normalizes copy numbers such that the whole-genome average total copy number is two
setSampleName.AbstractCBS

Sets the name of the sample segmented
findLargeGaps

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

Extract TCN and DH mean levels per segment
segmentByCBS

Segment genomic signals using the CBS method
callLOH.PairedPSCBS

Calls segments that are in LOH
report.AbstractCBS

Generates a report of the segmentation results
getSmoothLocusData.CBS

Gets smoothed locus-level data
writeSegments.PSCBS

Writes the table of segments to file
testROH.numeric

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

Merge two neighboring segments
resetSegments.AbstractCBS

Reset the segments
mergeTwoSegments.PairedPSCBS

Merge two neighboring segments
getSampleName.AbstractCBS

Gets the name of the sample segmented
plotTracks1.PairedPSCBS

Plots parental specific copy numbers along the genome
plotTracks.AbstractCBS

Plots the segmentation result along the genome
hclustCNs.AbstractCBS

Performs a hierarchical clustering of the CN mean levels
updateMeans.AbstractCBS

Updates the CN mean levels for each segment independently
segmentByPairedPSCBS

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

Plots copy numbers along the genome
pruneByDP.AbstractCBS

Prunes the CN profile using dynamical programming
weightedQuantile

Weighted Quantile Value
updateMeansTogether.AbstractCBS

Updates the CN mean levels jointly in sets of segments
writeSegments.CBS

Writes the table of segments to file
NonPairedPSCBS

The NonPairedPSCBS class
CBS

The CBS class
PSCBS

The PSCBS class
PSCBS-package

Package PSCBS
as.DNAcopy.CBS

Coerces a CBS object to a DNAcopy object
Non-documented objects

Non-documented objects
as.CBS.DNAcopy

Coerces a DNAcopy object to a CBS object
PairedPSCBS

The PairedPSCBS class
bootstrapTCNandDHByRegion.PairedPSCBS

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

Calls segments that are in allelic balance
Restructuring AbstractCBS objects

Restructuring AbstractCBS objects
callCopyNeutralByTCNofAB.PairedPSCBS

Calls regions that are copy neutral
callAmplifications.CBS

Calls (focal) amplifications
c.CBS

Concatenates segmentation results
AbstractCBS

The AbstractCBS class