For a particular tumor sample, CIN can be estimated by the wGII (Weighted Genomic Instability Index):
$$ wGII = \frac {\sum_{c=1}^m \sum_i^kl_i / L_c} m $$
where $p$ is the species ploidy, $m$ is the number of chromosomes, $k$ is the number of the CNV segments for each chromosome, $L_c$ is chromosome length, and $L_i$ is the length of the CNV segment.
The source code website: https://github.com/zju3351689/CINcalc
# 1. download and install wget https://github.com/zju3351689/CINcalc/archive/v1.0.0.tar.gz tar zxvf v1.0.0.tar.gz cp src/CINcalc $PATH/ chmod +x $PATH/CINcalc # 2. run the script to test $PATH/CINcalc
Usage: CINcalc.py CNVfile Contact: Rong Zhengqin <rongzhengqin@basepedia.com> Options: --version show program's version number and exit -h, --help show this help message and exit Required Options: -r FILE chromosome size file -p INT Species ploidy [2] Threshold Options: -l FLOAT Low cutoff for loss fragments -u FLOAT Up cutoff for gain fragments
chr1 248956422 chr2 242193529 chr3 198295559
#SampleID PatientID Chromosome Start End Probes log2(CNV ratio) TCGA-OR-A5LA-01A TCGA-OR-A5LA chr1 3301765 5128894 1270 -0.2177 TCGA-OR-A5LA-01A TCGA-OR-A5LA chr1 5132643 47878718 22491 -0.179 TCGA-OR-A5LA-01A TCGA-OR-A5LA chr1 47879273 109220206 36986 -0.2409 TCGA-OR-A5LA-01A TCGA-OR-A5LA chr1 109223247 161957073 12991 -0.1933