view bowtie_build_wrapper.pl @ 0:17e442abb3de draft default tip

Uploaded
author david-hoover
date Wed, 23 Jul 2014 10:27:07 -0400
parents
children
line wrap: on
line source

#!/usr/bin/perl

use File::Copy qw/ copy /;

$ENV{PATH} .= ":/usr/local/apps/mirdeep2/2.0.0.5:/usr/local/apps/bowtie/0.12.9:/usr/local/apps/viennarna/current/bin:/usr/local/randfold-2.0/bin";

$fastafile = $ARGV[0];
$file_path = $ARGV[1];
$output_file = $ARGV[2];
$fastafile_text = $ARGV[3];

$output_basename = `basename $output_file`;
chomp $output_basename;
$filepath_basename = `basename $file_path`;
chomp $filepath_basename;

$output_dir = $output_file;
$output_dir =~ s/$output_basename/$filepath_basename/;

system ("mkdir -p $file_path");
copy ($fastafile, $output_file);
copy ($output_file, $file_path);

system ("bowtie-build $fastafile $file_path/$output_basename");

open (OUTPUT,">$output_file");
print OUTPUT "<h1>Bowtie index on $fastafile_text</h1>\n";
$dirout = `ls $file_path`;

foreach $file (split (/\n/, $dirout)) {
	print OUTPUT "<a href='$file'>$file</a><br/>\n";
}
close (OUTPUT);