Question: Quick method for calculating mean and standard deviation of read coverage of a chromosome.
0
gravatar for QVINTVS_FABIVS_MAXIMVS
4.8 years ago by
USA SoCal
QVINTVS_FABIVS_MAXIMVS2.2k wrote:

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.

 

ADD COMMENTlink modified 2.9 years ago by Biostar ♦♦ 20 • written 4.8 years ago by QVINTVS_FABIVS_MAXIMVS2.2k
3
gravatar for Bert Overduin
4.8 years ago by
Bert Overduin3.6k
Edinburgh Genomics, The University of Edinburgh
Bert Overduin3.6k wrote:

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

ADD COMMENTlink written 4.8 years ago by Bert Overduin3.6k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1037 users visited in the last hour