annotate bsfcall_wrapper.pl @ 2:f274c166e738 default tip

remove comments in bsfcall_wrapper.xml
author yutaka-saito
date Sun, 19 Apr 2015 23:02:04 +0900
parents 20930a8f700b
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
1 #!/usr/bin/perl
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
2
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
3 use strict;
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
4 use warnings;
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
5
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
6 use FindBin;
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
7
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
8 print STDOUT "The tool script is called with:\n", join(" ", ($0, @ARGV)), "\n\n";
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
9
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
10 my ($idx, $in) = ("", "");
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
11 my $default_option = "-o bsf-call.out -W bsfwork";
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
12
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
13 my $tooldir = shift(@ARGV);
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
14 $tooldir = $FindBin::Bin;
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
15 $ENV{PATH} = "$tooldir/bin:" . $ENV{PATH};
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
16 my $reference_source = shift(@ARGV);
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
17 my $read_end = shift(@ARGV);
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
18 my $gslot = shift(@ARGV);
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
19 #$idx = "$tooldir/data/chrX.sub.fa";
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
20
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
21 if ($reference_source eq "indexed") {
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
22 $idx = shift(@ARGV);
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
23 }
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
24 elsif ($reference_source eq "history") {
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
25 my $own = shift(@ARGV);
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
26 $idx = "reference.fa";
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
27 &invoke_command("ln -s $own reference.fa");
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
28 }
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
29 else {
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
30 die "never reach here\n";
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
31 }
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
32
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
33 if ($read_end eq "single-end") {
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
34 $in = shift(@ARGV);
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
35 &invoke_command("$tooldir/bin/bsf-call $default_option -p $gslot $idx $in");
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
36 }
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
37 elsif ($read_end eq "paired-end") {
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
38 my $in1 = shift(@ARGV);
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
39 my $in2 = shift(@ARGV);
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
40 $in = $in1 . "," . $in2;
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
41 &invoke_command("$tooldir/bin/bsf-call $default_option -p $gslot $idx $in");
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
42 }
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
43 else {
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
44 die "never reach here\n";
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
45 }
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
46
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
47 sub invoke_command {
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
48 my ($command) = @_;
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
49 print "invoking: $command\n";
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
50 system($command);
06f8460885ff migrate from GitHub
yutaka-saito
parents:
diff changeset
51 }