WSTester updated to work plus hopefully all the other changes that need to go into...
[jabaws.git] / binaries / src / ViennaRNA / Utils / ct2b.pl
1 #!/usr/bin/perl
2 # -*-Perl-*-
3 # Last changed Time-stamp: <1999-09-29 13:24:23 ivo>
4 # produce dot bracket notation of an RNA secondary structure from
5 # Zuker's .ct file
6
7 while (<>) {
8     @F = split;
9     if ((/ = /) && ($#F!=5)) {
10         if (defined($seq)) {
11             print "$seq\n" unless ($seq eq $oldseq);
12             $oldseq = $seq;
13             print "$s ($E)\n";
14         }
15         $E = $F[3];
16         $s = $seq = "";
17         next;
18     }
19     $seq .= $F[1];
20     if ($F[4]==0) {$s .= "."; next}
21     $s .= "(" if ($F[0]<$F[4]);
22     $s .= ")" if ($F[0]>$F[4]);
23 }
24 print "$seq\n" unless ($seq eq $oldseq);
25 print "$s ($E)\n" if defined($s);
26
27 # End of file