Entering edit mode
                    11.3 years ago
        QVINTVS_FABIVS_MAXIMVS
        
    
        ★
    
    2.6k
    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.