5 # Wrapper for multicoil and ncoil to generate csv style output to STDOUT
6 # Pass it the complete path to the sequence or multicoil will complain
8 # multicoils ignored as it's a bitch to setup
15 unless (@ARGV) { die("No arguments given\n"); }
17 my ($path) = $ENV{'PWD'};
18 my ($file) = ($ARGV[0] =~ /.*\/(.*)/);
19 my ($multicoil) = ($ENV{'PAIRCOIL_CONFIG'} =~ /(.*)\/.*/);
21 # Print multicoils cmd file to temp file
22 my $multi_conf = tmpnam();
23 open(FILE, ">$multi_conf") or die($!);
24 print FILE "method = MultiCoil
31 conversion dir = $multicoil/CONVERSION_FILES/
32 table 1 = $multicoil/PROGRAM_DATA/cctb28
33 table 2 = $multicoil/PROGRAM_DATA/tritb28
34 pir = $multicoil/PROGRAM_DATA/sampled-pir.seq
35 genbnk = $multicoil/PROGRAM_DATA/genbnk
36 printfile dir = /homes/jon/jpred/src/MULTICOIL/TEST_RUNS/
38 seq scores dir = $path/
43 xsystem("$BINDIR/readseq -f3 -p < $ARGV[0] > $tmp2");
45 # 1, 2, 3! We hate multicoil! Have to be in the same path as it's exe
46 # to run due to the hex editing on the multicoil exe to allow it to read
47 # some of its data files, also it requires PIR input file, sigh...
48 #my $pwd = $ENV{'PWD'};
49 #chdir("$JPREDROOT/src/MULTICOIL/");
50 #xsystem("$JPREDROOT/src/MULTICOIL/multicoil $tmp2 -config $multi_conf > /dev/null 2> /dev/null");
54 #my (@prob, @dimprob, @trimprob);
58 #open(IN, "<$path/$tmp2.out") or die($!);
60 # if (/^[#|%]/) { next; }
62 # @_ = split(" ", $_);
64 # push @dimprob, $_[5];
65 # push @trimprob, $_[6];
72 #unlink("$tmp2.seq_scores");
74 #unlink $multi_conf, $tmp2;
76 # Takes the prob. array and decides whether it's definitely a coil,
77 # maybe a coil, or not a coil.
94 # Prints a comma after each piece of data in array
97 foreach (@_) { print "$_,"; }
101 #print_cvs(coil(@prob));
102 #print "\n", "MULTCOIL_DIMER:";
103 #print_cvs(coil(@dimprob));
104 #print "\n", "MULTCOIL_TRIMER:";
105 #print_cvs(coil(@trimprob));
109 # Finished with multicoil, now for lupas coils (?) Just runs ncoils with
110 # different -win values
114 my ($file, $window) = @_;
116 open(PROG, "$BINDIR/ncoils -w -win $window < $file |") or die($!);
117 open(REALDATA, ">$ARGV[0].lupas_$window") or die($!);
121 push @temp, substr($_, 19, 5);
130 print_cvs(coil(ncoils($ARGV[0], 21))); # 21 window
131 print "\n", "Lupas_14:";
132 print_cvs(coil(ncoils($ARGV[0], 14))); # 14 window
133 print "\n", "Lupas_28:";
134 print_cvs(coil(ncoils($ARGV[0], 28))); # 28 window