X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=utils%2Fsplitstockholm.pl;fp=utils%2Fsplitstockholm.pl;h=76ff05bfc3459d54722564dbff030fe4eb35f9d8;hb=3248fab37afe77c2d2c402bcc4db2bc1a3ce8b9f;hp=65e6644a187575365febb145188b379ce27acaa2;hpb=b12de4788f39931038a17ef1627e8cf77a6d84d2;p=jalview.git diff --git a/utils/splitstockholm.pl b/utils/splitstockholm.pl index 65e6644..76ff05b 100644 --- a/utils/splitstockholm.pl +++ b/utils/splitstockholm.pl @@ -17,33 +17,33 @@ # You should have received a copy of the GNU General Public License along with Jalview. If not, see . # The Jalview Authors are detailed in the 'AUTHORS' file. ## - -# Splits a concatenated set of Stockholm Files into several individual files. - -use strict; -use FileHandle; -my $ac; -my $lns=""; -my $fh; -while (<>) { - if ($_=~m!^//!) { - $fh->print("//\n"); - $fh->close(); - $ac = undef; - $lns = ""; - } else { - if ($_=~/GF\s+AC\s+([0-9.RPF]+)/) { - $ac=$1; - ($fh=new FileHandle)->open(">$ac.stk") or die("Couldn't open file '$ac.stk'"); - $lns=~/^. STOCKHOLM 1.0/ or $fh->print("# STOCKHOLM 1.0\n"); - }; - if (defined($fh)) { - if (defined $lns) { - $fh->print($lns); $lns=undef; } - - $fh->print($_); - } else { - $lns .= $_; - } - } -} + +# Splits a concatenated set of Stockholm Files into several individual files. + +use strict; +use FileHandle; +my $ac; +my $lns=""; +my $fh; +while (<>) { + if ($_=~m!^//!) { + $fh->print("//\n"); + $fh->close(); + $ac = undef; + $lns = ""; + } else { + if ($_=~/GF\s+AC\s+([0-9.RPF]+)/) { + $ac=$1; + ($fh=new FileHandle)->open(">$ac.stk") or die("Couldn't open file '$ac.stk'"); + $lns=~/^. STOCKHOLM 1.0/ or $fh->print("# STOCKHOLM 1.0\n"); + }; + if (defined($fh)) { + if (defined $lns) { + $fh->print($lns); $lns=undef; } + + $fh->print($_); + } else { + $lns .= $_; + } + } +}