File: write_trin_cmds.pl

package info (click to toggle)
trinityrnaseq 2.2.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 212,452 kB
  • ctags: 5,067
  • sloc: perl: 45,552; cpp: 19,678; java: 11,865; sh: 1,485; makefile: 613; ansic: 427; python: 313; xml: 83
file content (83 lines) | stat: -rwxr-xr-x 1,675 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/usr/bin/env perl

use strict;
use warnings;

use FindBin;
use Getopt::Long qw(:config no_ignore_case bundling pass_through);

my $usage = <<__EOUSAGE__;

####################################################################################
#
#  usage: $0 --reads_list_file <string> --out_token <string> [Trinity params]
#
# Required:
#
# --reads_list_file <string>      file containing list of filenames corresponding 
#                                  to the reads.fasta
#
# --out_token <string>            token added to the output file name
#
#####################################################################################

#  Example: 
#
#    write_trin_cmds.pl  --reads_list_file ReadPartitions.listing --out_token origbfly --SS_lib_type F --full_cleanup_ET --CPU 1 --bfly_jar ~/SVN/trinityrnaseq/trunk/Butterfly/Butterfly.jar --JM 1G --seqType fa


__EOUSAGE__

    ;


my $reads_file;
my $help_flag;
my $out_token = "";


&GetOptions (
             
             'reads_list_file=s' => \$reads_file,
             'h' => \$help_flag,
             
             'out_token=s' => \$out_token,
             
             
             );

my @TRIN_ARGS = @ARGV;

if ($help_flag) {
    die $usage;
}

unless ($reads_file && -s $reads_file) {
    die $usage;
}

unless ($out_token) {
    die $usage;
}

my $trin_args = join(" ", @TRIN_ARGS);


open (my $fh, $reads_file) or die "Error, cannot open file $reads_file";
while (<$fh>) {
	chomp;
    my @x = split(/\s+/);
    
    my $file = pop @x;
    
    my $cmd = "$FindBin::RealBin/../../../Trinity --single \"$file\" --output \"$file.trinity.$out_token\" $trin_args ";
    
    print "$cmd\n";
}

exit(0);