annotate mirdeep2/bowtie_build_wrapper.pl @ 0:5b9519f4b165

Upload first commmit
author nikhil-joshi
date Mon, 19 Sep 2011 19:04:41 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
5b9519f4b165 Upload first commmit
nikhil-joshi
parents:
diff changeset
1 #!/usr/bin/perl
5b9519f4b165 Upload first commmit
nikhil-joshi
parents:
diff changeset
2
5b9519f4b165 Upload first commmit
nikhil-joshi
parents:
diff changeset
3 use File::Copy qw/ copy /;
5b9519f4b165 Upload first commmit
nikhil-joshi
parents:
diff changeset
4
5b9519f4b165 Upload first commmit
nikhil-joshi
parents:
diff changeset
5 $fastafile = $ARGV[0];
5b9519f4b165 Upload first commmit
nikhil-joshi
parents:
diff changeset
6 $file_path = $ARGV[1];
5b9519f4b165 Upload first commmit
nikhil-joshi
parents:
diff changeset
7 $output_file = $ARGV[2];
5b9519f4b165 Upload first commmit
nikhil-joshi
parents:
diff changeset
8 $fastafile_text = $ARGV[3];
5b9519f4b165 Upload first commmit
nikhil-joshi
parents:
diff changeset
9
5b9519f4b165 Upload first commmit
nikhil-joshi
parents:
diff changeset
10 $output_basename = `basename $output_file`;
5b9519f4b165 Upload first commmit
nikhil-joshi
parents:
diff changeset
11 chomp $output_basename;
5b9519f4b165 Upload first commmit
nikhil-joshi
parents:
diff changeset
12 $filepath_basename = `basename $file_path`;
5b9519f4b165 Upload first commmit
nikhil-joshi
parents:
diff changeset
13 chomp $filepath_basename;
5b9519f4b165 Upload first commmit
nikhil-joshi
parents:
diff changeset
14
5b9519f4b165 Upload first commmit
nikhil-joshi
parents:
diff changeset
15 $output_dir = $output_file;
5b9519f4b165 Upload first commmit
nikhil-joshi
parents:
diff changeset
16 $output_dir =~ s/$output_basename/$filepath_basename/;
5b9519f4b165 Upload first commmit
nikhil-joshi
parents:
diff changeset
17
5b9519f4b165 Upload first commmit
nikhil-joshi
parents:
diff changeset
18 system ("mkdir -p $file_path");
5b9519f4b165 Upload first commmit
nikhil-joshi
parents:
diff changeset
19 copy ($fastafile, $output_file);
5b9519f4b165 Upload first commmit
nikhil-joshi
parents:
diff changeset
20 copy ($output_file, $file_path);
5b9519f4b165 Upload first commmit
nikhil-joshi
parents:
diff changeset
21
5b9519f4b165 Upload first commmit
nikhil-joshi
parents:
diff changeset
22 system ("bowtie-build $fastafile $file_path/$output_basename");
5b9519f4b165 Upload first commmit
nikhil-joshi
parents:
diff changeset
23
5b9519f4b165 Upload first commmit
nikhil-joshi
parents:
diff changeset
24 open (OUTPUT,">$output_file");
5b9519f4b165 Upload first commmit
nikhil-joshi
parents:
diff changeset
25 print OUTPUT "<h1>Bowtie index on $fastafile_text</h1>\n";
5b9519f4b165 Upload first commmit
nikhil-joshi
parents:
diff changeset
26 $dirout = `ls $file_path`;
5b9519f4b165 Upload first commmit
nikhil-joshi
parents:
diff changeset
27
5b9519f4b165 Upload first commmit
nikhil-joshi
parents:
diff changeset
28 foreach $file (split (/\n/, $dirout)) {
5b9519f4b165 Upload first commmit
nikhil-joshi
parents:
diff changeset
29 print OUTPUT "<a href='$file'>$file</a><br/>\n";
5b9519f4b165 Upload first commmit
nikhil-joshi
parents:
diff changeset
30 }
5b9519f4b165 Upload first commmit
nikhil-joshi
parents:
diff changeset
31 close (OUTPUT);