| 0 | 1 #!/usr/bin/perl | 
|  | 2 | 
|  | 3 use File::Temp qw/ tempfile tempdir /; | 
|  | 4 use File::Copy qw/ copy /; | 
|  | 5 use Cwd; | 
|  | 6 | 
|  | 7 $mirna_file = $ARGV[0]; | 
|  | 8 $trans_file = $ARGV[1]; | 
|  | 9 $targets = $ARGV[2]; | 
|  | 10 | 
|  | 11 # do all the dirty work in a temp directory | 
|  | 12 $cwd = cwd(); | 
|  | 13 $tempdir = tempdir(CLEANUP => 1); | 
|  | 14 | 
|  | 15 copy ("/opt/Bio/galaxy-dist/tools/mirdeep2/target_spy_wrapper.sh", $tempdir); | 
|  | 16 chdir ($tempdir); | 
|  | 17 | 
|  | 18 $ret_ts = `sh target_spy_wrapper.sh $mirna_file $trans_file`; | 
|  | 19 if ($ret_ts ne "") {die "TargetSpy error"} | 
|  | 20 copy ("targets", $targets); | 
|  | 21 | 
|  | 22 chdir($cwd); |