bug-i38.pl 1.19 KB
Newer Older
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
#! /usr/bin/perl

# bug i38 - cmalign --mapali doesn't work if aln has no SS_cons
#
# EPN, Mon Jun 17 13:20:11 2013
#

$usage = "perl bug-i38.pl <cmbuild> <cmalign>\n";
if ($#ARGV != 1) { die "Wrong argument number.\n$usage"; }

$cmbuild = shift;
$cmalign = shift;
$ok      = 1;

# Make our test alignment, i38.1
#
open (OUT, ">i38.1") || die;
print OUT <<END;
# STOCKHOLM 1.0

human AAGACUUCGGAUCUGGCGACACCC
//
END
close OUT;
# Make our test sequence to align, i38.2
#
open (OUT, ">i38.2") || die;
print OUT <<END;
>mouse
AUACACUUCGGAUGCACCAAAGUGA
END
close OUT;

# build the model
if ($ok) { 
  $output = `$cmbuild -F --noss i38.cm i38.1`;
  if ($? != 0) { $ok = 0; }
  # make sure output includes a 'CPU' string indicating success
  if($output !~ /\n\# CPU/) { 
    $ok = 0;
  }
}

# align the sequence and use --mapali
if ($ok) { 
  $output = `$cmalign --noss --mapali i38.1 -o i38.3 i38.cm i38.2`;
  if ($? != 0) { $ok = 0; }
  # make sure output includes a 'CPU' string indicating success
  if($output !~ /\n\# CPU/) { 
    $ok = 0;
  }
}

foreach $tmpfile ("i38.1", "i38.2", "i38.3", "i38.cm") { 
55
  unlink $tmpfile if -e $tmpfile;
56 57 58 59 60
}
if ($ok) { print "ok\n";     exit 0; }
else     { print "FAILED\n"; exit 1; }