-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmaster.pl
More file actions
executable file
·105 lines (96 loc) · 3.93 KB
/
master.pl
File metadata and controls
executable file
·105 lines (96 loc) · 3.93 KB
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#!/usr/bin/perl
#by Dina Zhabinskaya
#This code is called by compete_many.thread.pl to run IR_finder and SIDD on single-transition code
#at input temperature for an input sequence file
use strict; use warnings;
use Getopt::Long;
my ($file,$trans, $out_file);
my $temp = 310;
my $sig = 0.06;
my $theta = 12;
my $salt = 0.01;
my $shape = "linear";
my $c = "";
my $b = "";
my $p = "";
my $r = "";
my $n = "";
my $usage = "\nusage: $0 -f <sequence file> -a <algorithm_type> (choose algorithm_type: M, Z, C, or A) [options]\n\n".
"Input requires a sequence file and algorithm type.\n".
"Script analyzes superhelically induced structural transition probabilities for each base pair.\n".
"Algorithm types: M (melting), Z (Z-DNA), C (cruciforms), and A (competition between all three).\n".
"Sequence file will be converted to the format required by the algorithm.\n".
"Code in directory trans_three/ will handle M, Z, and C algorithm types.\n".
"Code in directory trans_compete/ will handle A algorithm type.\n".
"For algorithm type options -a C and -a A user will need an Inverted Repeat Finder (IRF) executable compatible with user's operating system.\n".
"IRF download page: http://tandem.bu.edu/irf/irf.download.html.\n".
"Selected output will be printed to the screen.\n\n".
"Options:\n".
"-f Required: specify sequence file \n".
"-a Required: specify algorithm type: M, Z, C, or A\n".
"-t Optional: set temperature (default 310)\n".
"-s Optional: set superhelical density (default -0.06)\n".
"-i Optional: set ionic strength (default 0.01)\n".
"-th Optional: set energy threshold (default 12), -t 10 is recommended for -a A (competition algorithm)\n".
"-c Optional: flag to set molecular type to circular (default linear)\n".
"-n Optional: flag to set melting energetics to nearest neighbor (default copolymeric)\n".
"-b Optional: flag to print base pair for each position (default null)\n".
"-p Optional: flag to print algorithm parameters (default null)\n".
"-r Optional: flag to print ensemble average results (default null)\n".
"-o Optional: specify output file name\n";
if($#ARGV < 2) {
die $usage;
}
GetOptions (
"f=s" => \$file, # sequence file
"a=s" => \$trans, # algorithm
"T=s" => \$temp, # temperature
"s=s" => \$sig, # superhelical density
"i=s" => \$salt, # ionic concentration
"th=s" => \$theta, # energy threshold
"c" => \$c, # molecular shape
"b" => \$b, # print sequence
"n" => \$n, # nearest neighbor energetics for melting
"p" => \$p, # print parameters
"r" => \$r, # print average results
"o=s" => \$out_file) # output file
or die("Error in command line arguments\n$usage\n");
$b="-b" if($b);
$p="-p" if($p);
$r="-r" if($r);
$n="-n" if($n);
if($c) {
$c="-c";
$shape="circular";
}
my @name = split("/",$file);
my $single_exe = "trans_three/qsidd";
my $compete_exe = "trans_compete/qsidd";
my $output_IR;
if ($trans eq "M") {
#run single transition algorithm for melting
$output_IR = `$single_exe $b $p $r $n $c -T $temp -s $sig -i $salt -t $theta -f $file`;
}
if ($trans eq "Z") {
#run single transition algorithm for Z-DNA
$output_IR = `$single_exe $b $p $r $c -T $temp -s $sig -i $salt -t $theta -Z -f $file`;
}
if ($trans eq "C" or $trans eq "A") {
my $code_IR = "IR_finder.pl";
my $IR_results = `perl $code_IR $temp $shape $file`; #run IR_finder
if($trans eq "C") {
#run single transition algorithm for cruciforms
$output_IR = `$single_exe $b $p $r $c -T $temp -s $sig -i $salt -t $theta -C -X "$IR_results" -f $file`;
}
if ($trans eq "A") {
#run competition algorith: melting, Z-DNA, and cruciforms competing
$output_IR = `$compete_exe $b $p $r $n $c -T $temp -s $sig -i $salt -t $theta -X "$IR_results" -f $file`;
}
}
if ($out_file) {
open(my $out,">$out_file") || die "error creating $out_file\n";
print $out $output_IR;
}
else {
print "$output_IR";
}