-
Notifications
You must be signed in to change notification settings - Fork 0
/
make_genelistvar_submit.pl
58 lines (44 loc) · 1.33 KB
/
make_genelistvar_submit.pl
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
#!/usr/bin/env perl
#
# Description: Make submission script for genelistvariants
#
#
#
# Created by Jessica Chong on 2012-09-20.
use strict;
use warnings;
use Getopt::Long;
my ($inputfile, $outputfile);
GetOptions(
'in=s' => \$inputfile,
'out=s' => \$outputfile,
);
if (!defined $inputfile) {
optionUsage("option --in not defined\n");
} elsif (!defined $outputfile) {
optionUsage("option --out not defined\n");
}
open (OUT, ">$outputfile") or die "Cannot write to $outputfile: $!.\n";
print OUT "#!/bin/bash\n";
print OUT '#$-cwd'."\n\n";
print OUT "perl ~/bin/Generate_Gene_ListVariants_From_Gene_File_0_1_4.pl ";
open (FILE, "$inputfile") or die "Cannot read $inputfile file: $!.\n";
while ( <FILE> ) {
$_ =~ s/\s+$//; # Remove line endings
my @line = split ("\t", $_);
my $file = $line[0];
$file =~ s/masterVarBeta/gene/;
print OUT "--Input_File $file "
}
close FILE;
print OUT "--Output_Dir /clustb/jxchong/CGI_WGS --Output_File all.2012-09-20.genelistvar.tsv\n\n";
print OUT "cp /clustb/jxchong/CGI_WGS/all.2012-09-20.genelistvar.tsv.bz2 /clusta/jxchong/CGI_WGS/all.2012-09-20.genelistvar.tsv.bz2\n";
close OUT;
sub optionUsage {
my $errorString = $_[0];
print "$errorString";
print "perl $0 \n";
print "\t--in\tinput file (findiv_mastervarpath)\n";
print "\t--out\toutput file (output for submission script)\n";
die;
}