Skip to main content

Pseudo-cgh of next-generation sequencing data

Project description


Next-generation sequencing of tumor/normal pairs provides a good opportunity to examine large-scale copy number variation in the tumor relative to the normal sample. In practice, this concept seems to extend even to exome-capture sequencing of pairs of tumor and normal. This library consists of a single script, ngCGH, that computes a pseudo-CGH using simple coverage counting on the tumor relative to the normal.

I have chosen to use a fixed number of reads in the normal sample as the “windowing” approach. This has the advantage of producing copy number estimates that should have similar variance at each location. The algorithm will adaptively deal with inhomogeneities across the genome such as those associated with exome-capture technologies (to the extent that the capture was similar in both tumor and normal). The disadvantage is that the pseudo-probes will be at different locations for every “normal control” sample.


There are several possible ways to install ngCGH.


If you are a git user, then simply cloning the repository will get you the latest code.

git clone git://

Alternatively, click the Download button and get the tarball or zip file.

In either case, change into the resulting directory and:

cd ngCGH
python install

From PyPi

If you have easy_install in place, this should suffice for installation:

easy_install ngCGH


Usage is very simple:

$ ngCGH -h
usage: ngCGH [-h] [-w WINDOWSIZE] [-o OUTFILE] [-l LOGLEVEL]
           normalbam tumorbam

positional arguments:
  normalbam             The name of the bamfile for the normal comparison
  tumorbam              The name of the tumor sample bamfile

optional arguments:
-h, --help            show this help message and exit
                    The number of reads captured from the normal sample
                    for calculation of copy number
-o OUTFILE, --outfile OUTFILE
                    Output filename, default <stdout>
-l LOGLEVEL, --loglevel LOGLEVEL
                    Logging Level, 1-15 with 1 being minimal logging and
                    15 being everything [10]


The output format is also very simple:

chr1    4851    52735   1000    854     -0.025120
chr1    52736   59251   1000    812     -0.097876
chr1    59251   119119  1000    876     0.011575
chr1    119120  707038  1000    1087    0.322924
chr1    707040  711128  1000    1016    0.225472
chr1    711128  711375  1000    1059    0.285275
chr1    711375  735366  1000    919     0.080709
chr1    735368  798455  1000    972     0.161600

Columns 1-3 describe the chromosome, start, and end for each pseudo-probe. The fourth column is the number of reads in the normal sample in the window while the fifth column represents the reads in the same genomic window from the tumor. The last column contains the median-centered log2 ratio between tumor and normal.

Converting to other formats

Included in the release is a script, convert2nexus, that takes as input the filename of a file created by ngCGH and converts it into a file that the Nexus CGH software from BioDiscovery can load for further analysis. The format looks like this:

Name    Chromosome      Start   End     PALZGU.cgh
chr1_10004      chr1    10004   15735   -2.087921
chr1_15736      chr1    15736   69385   -2.670936
chr1_69386      chr1    69386   521687  -0.428244
chr1_523537     chr1    523537  726959  0.080269
chr1_726959     chr1    726959  808542  0.223047
chr1_808546     chr1    808546  809138  -1.186761

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ngCGH-0.1.3dev.tar.gz (4.4 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page