Quick method for calculating mean and standard deviation of read coverage of a chromosome.
1
0
Entering edit mode
9.8 years ago

Hello,

I am in search for a program that can calculate the mean and standard deviation of coverage of a chromosome. Ideally, the program will use BAM files and be implemented in a pipeline.

The pipeline would require to use the mean and standard deviation of the coverage to scale the read depth of a user defined reason. I'm thinking to run a perl script of this sort.


    system("quick_coverage_prog chr1.bam >coverage_stats.txt");
    open IN, "~/coverage_stats.txt" or die "cannot open file\n";

    my $mean;
    my $sd;

    my $stats = <IN>;
    my @stats = split /\t/, $stats;

    $mean = $stats[0];
    $sd = $stats[1];

    close(IN);
    open IN, "~/ch1_.bam" or die "cannot open bam\n";

    while(<IN>){

             #parse data using $mean and $sd here
    }

   #close IN, print parsed data to output file

I would like this script to be fast, I have 1000s of files to analyze. Any advice is greatly appreciated.

read-depth coverage • 3.4k views
ADD COMMENT
3
Entering edit mode
9.8 years ago
Bert Overduin ★ 3.7k

Have a look at Picard, especial the output MEAN_COVERAGE and SD_COVERAGE.

ADD COMMENT

Login before adding your answer.

Traffic: 2981 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6