Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
add genome coverage
  • Loading branch information
MPIBR-tushevg committed Feb 5, 2019
1 parent 1b1d096 commit 14df931
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions batchGenomeCoverage.pl
@@ -0,0 +1,43 @@
#!/usr/bin/perl

use warnings;
use strict;
use File::Basename;

my $pathSource = shift;
my $pathDest = shift;

my $nodes = 1;
my $partition = "bedtools genomecov";
my $time = "100:00:00";
my $ntasks = 1;
my $cpus = 128;
my $name = "braintest";

# print header
print "#!/bin/bash\n";
print "\n";
print "#SBATCH --nodes=$nodes\n";
print "#SBATCH --partition=$partition\n";
print "#SBATCH --time=$time\n";
print "#SBATCH --ntasks=$ntasks\n";
print "#SBATCH --cpus-per-task=$cpus\n";
print "#SBATCH --job-name=$name\n";
print "#SBATCH --error=error_\%j.out\n";
print "#SBATCH --output=output_\%j.out\n";
print "\n";
print "echo \$SLURM_SUBMIT_DIR\n";
print "echo \"Running on \`hostname\`\"\n";
print "\n";

my @fileList = glob($pathSource . "/*.bam");
foreach my $file (@fileList) {

my $fileName = fileparse($file, ".bam");
my $fileOut = $pathDest . "/" . $fileName . ".gbed";
print "bedtools genomecov -ibam " . $file . " -bg -split | sort -k1,1 -k2,2n -k3,3n | bgzip > " . $fileOut . "\n";
print "tabix --zero-based --sequence 1 --begin 2 --end 3 " . $fileOut . "\n";
}



0 comments on commit 14df931

Please sign in to comment.