Package: wise / 2.4.1-21

08_mayhem.patch Patch series | download
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
Author: Philipp Benner <philipp@debian.org>
Last-Update: Sun, 07 Jul 2013 13:33:01 +0200
Description: Fix run time errors detected by Mayhem

--- wise-2.4.1.orig/src/models/dbac.c
+++ wise-2.4.1/src/models/dbac.c
@@ -535,8 +535,12 @@
    *  
    */  
   
-  one = read_fasta_file_Sequence(*argv++);  
-  two = read_fasta_file_Sequence(*argv++);  
+  if( (one = read_fasta_file_Sequence(*argv++)) == NULL ) {
+    fatal("Unable to read the sequence in file");
+  }
+  if( (two = read_fasta_file_Sequence(*argv++)) == NULL ) {
+    fatal("Unable to read the sequence in file");
+  }
   
   uppercase_Sequence(one);  
   uppercase_Sequence(two);  
--- wise-2.4.1.orig/src/models/estwise.c
+++ wise-2.4.1/src/models/estwise.c
@@ -313,7 +313,7 @@
     }
   }
 
-  if( reverse == TRUE ) {
+  if( cdna && reverse == TRUE ) {
     if( tstart > tend ) {
       warn("You have already reversed the DNA by using %d - %d truncation. Re-reversing",tstart,tend);
     }
@@ -323,7 +323,7 @@
     cdna = cdna_temp;
   }
 
-  if( target_abs == TRUE ) {
+  if( cdna && target_abs == TRUE ) {
     cdna->baseseq->offset = 1;
     cdna->baseseq->end  = strlen(cdna->baseseq->seq);
   }
@@ -472,8 +472,11 @@
   }
 
   cp = flat_cDNAParser(indel_error);
-  cm = flat_CodonMapper(ct);
-  sprinkle_errors_over_CodonMapper(cm,subs_error);
+
+  if( ct ) {
+    cm = flat_CodonMapper(ct);
+    sprinkle_errors_over_CodonMapper(cm,subs_error);
+  }
 
   return ret;
 
--- wise-2.4.1.orig/src/models/genewise.c
+++ wise-2.4.1/src/models/genewise.c
@@ -550,8 +550,10 @@
       ret =  FALSE;
     }
 
-    gen->baseseq->offset = 1;
-    gen->baseseq->end  = strlen(gen->baseseq->seq);
+    if ( gen ) {
+      gen->baseseq->offset = 1;
+      gen->baseseq->end  = strlen(gen->baseseq->seq);
+    }
   }
 
   if( alg_str != NULL ) {
--- wise-2.4.1.orig/src/models/estwisedb.c
+++ wise-2.4.1/src/models/estwisedb.c
@@ -688,8 +688,11 @@
 
 
   cps = flat_cDNAParser(indel_error);
-  cm = flat_CodonMapper(ct);
-  sprinkle_errors_over_CodonMapper(cm,subs_error);
+
+  if( ct ) {
+    cm = flat_CodonMapper(ct);
+    sprinkle_errors_over_CodonMapper(cm,subs_error);
+  }
 
   return ret;
 
--- wise-2.4.1.orig/src/models/promoterwise.c
+++ wise-2.4.1/src/models/promoterwise.c
@@ -147,8 +147,12 @@
 
   lchs = standard_LocalCisHitScore(NMaskType_VARIABLE);
 
-  query = read_fasta_file_Sequence(argv[1]);
-  target = read_fasta_file_Sequence(argv[2]);
+  if( (query = read_fasta_file_Sequence(argv[1])) == NULL ) {
+    fatal("Unable to read the sequence in query file");
+  }
+  if( (target = read_fasta_file_Sequence(argv[2])) == NULL ) {
+    fatal("Unable to read the sequence in target file");
+  }
 
   for(i=0;i<query->len;i++) {
     query->seq[i] = toupper(query->seq[i]);