File: mayhem.patch

package info (click to toggle)
probcons 1.12-14
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 664 kB
  • sloc: cpp: 7,263; xml: 567; makefile: 114; sh: 21
file content (38 lines) | stat: -rw-r--r-- 1,288 bytes parent folder | download | duplicates (4)
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
Author: Andreas Tille <tille@debian.org>
Last-Update: Tue, 15 Dec 2015 11:35:22 +0100
Bug-Debian: https://bugs.debian.org/716581
            https://bugs.debian.org/716505
Description: Fix Mayhem issues

--- a/Main.cc
+++ b/Main.cc
@@ -210,11 +210,13 @@ int main (int argc, char **argv){
                                         ProbabilisticModel (initDistrib, gapOpen, gapExtend,  emitPairs, emitSingle),
                                         initDistrib, gapOpen, gapExtend, emitPairs, emitSingle);
     
-    if (!enableAllPairs){
-      if (enableClustalWOutput)
-	alignment->WriteALN (cout);
-      else
-	alignment->WriteMFA (cout);
+    if (alignment) {
+      if (!enableAllPairs){
+        if (enableClustalWOutput)
+	  alignment->WriteALN (cout);
+        else
+	  alignment->WriteMFA (cout);
+      }
     }
     delete alignment;
     delete sequences;
@@ -307,6 +309,10 @@ MultiSequence *DoAlign (MultiSequence *s
   assert (sequences);
 
   const int numSeqs = sequences->GetNumSequences();
+  if (numSeqs == 0) {
+    fprintf(stderr, "Zero sequences delivered to function DoAlign()\n");
+    return NULL;
+  }
   VVF distances (numSeqs, VF (numSeqs, 0));
   SafeVector<SafeVector<SparseMatrix *> > sparseMatrices (numSeqs, SafeVector<SparseMatrix *>(numSeqs, NULL));