Browse code

Multiple fixes; final comit before release; version number bumped to 0.99.6

git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/msa@102514 bc3139a8-67e5-0310-9ffc-ced21a209358

Ulrich Bodenhofer authored on 15/04/2015 13:20:09
Showing47 changed files

... ...
@@ -1,8 +1,8 @@
1 1
 Package: msa
2 2
 Type: Package
3 3
 Title: Multiple Sequence Alignment
4
-Version: 0.99.5
5
-Date: 2015-04-12
4
+Version: 0.99.6
5
+Date: 2015-04-15
6 6
 Author: Enrico Bonatesta, Christoph Horejs-Kainrath, Ulrich Bodenhofer
7 7
 Maintainer: Ulrich Bodenhofer <bodenhofer@bioinf.jku.at>
8 8
 Description: This package provides a unified R/Bioconductor interface to the
... ...
@@ -17,15 +17,18 @@ URL: http://www.bioinf.jku.at/software/msa/
17 17
 License: GPL (>= 2)
18 18
 Copyright: See file inst/COPYRIGHT
19 19
 Depends: R (>= 3.1.0), methods, Biostrings (>= 2.30.0)
20
-Imports: Rcpp (>= 0.11.1), BiocGenerics, IRanges (>= 1.20.0), S4Vectors,
21
-	 tools
20
+Imports: Rcpp (>= 0.11.1), BiocGenerics, IRanges (>= 1.20.0),
21
+        S4Vectors, tools
22 22
 Suggests: Biobase, knitr
23 23
 LinkingTo: Rcpp
24
-SystemRequirements: GNU make
24
+SystemRequirements:
25 25
 VignetteBuilder: knitr
26 26
 LazyLoad: yes
27
-Collate: AllClasses.R AllGenerics.R params-methods.R version-methods.R 
28
-         helperFunctions.R inputChecks.R convertRows.R msaPrettyPrint.R
29
-	 print-methods.R show-methods.R msa.R msaMuscle.R msaClustalW.R 
30
-         msaClustalOmega.R
31
-biocViews: MultipleSequenceAlignment, Alignment, MultipleComparison, Sequencing
27
+Collate: AllClasses.R AllGenerics.R params-methods.R version-methods.R
28
+        helperFunctions.R inputChecks.R convertRows.R msaPrettyPrint.R
29
+        print-methods.R show-methods.R msa.R msaMuscle.R msaClustalW.R
30
+        msaClustalOmega.R
31
+biocViews: MultipleSequenceAlignment, Alignment, MultipleComparison,
32
+        Sequencing
33
+NeedsCompilation: yes
34
+Packaged: 2015-04-15 13:16:43 UTC; bodenhof
... ...
@@ -4,7 +4,7 @@ convertAlnRows <- function(rows, type)
4 4
 
5 5
     if (length(rows) < 3 ||
6 6
         ##!identical(grep("^CLUSTAL", rows[1L]), 1L) ||
7
-        !identical(rows[2:3], c("","")))
7
+        !identical(sub("^\\s+$", "", rows[2:3]), c("", "")))
8 8
         stop("There is an invalid aln file!")
9 9
 
10 10
     rows <- tail(rows, -3)
... ...
@@ -43,7 +43,7 @@ getParamsList <-function(type,
43 43
 
44 44
 ##function, which tests a given input sequence
45 45
 ##whether it is a character string, or a XStringSet
46
-transformInputSeq <- function(inputSeq, isFile=FALSE) {
46
+transformInputSeq <- function(inputSeq) {
47 47
     if (!is(inputSeq, "character")) {
48 48
         if (is(inputSeq, "XStringSet")) {
49 49
             inputSeq <- as.character(inputSeq)
... ...
@@ -53,24 +53,6 @@ transformInputSeq <- function(inputSeq, isFile=FALSE) {
53 53
         }
54 54
     }
55 55
 
56
-    if (!isFile)
57
-    {
58
-        if (is.null(names(inputSeq))) {
59
-            warning("The input sequences are unnamed! \n",
60
-                    "Note that the order of sequences \n",
61
-                    "in the resulting multiple sequence alignment \n",
62
-                    "may not be preserved, so unique sequence names\n",
63
-                    "are necessary to recover the order!")
64
-        }
65
-        else if (length(unique(names(inputSeq))) != length(inputSeq)){
66
-            warning("The input sequences are not unique! \n",
67
-                    "Note that the order of sequences \n",
68
-                    "in the resulting multiple sequence alignment \n",
69
-                    "may not be preserved, so unique sequence names \n",
70
-                    "are necessary to recover the order!")
71
-        }
72
-    }
73
-
74 56
     return(inputSeq)
75 57
 }
76 58
 
... ...
@@ -72,9 +72,8 @@ checkType <- function(type, inputSeqs, msaName){
72 72
 ###############################################################################
73 73
 
74 74
 ##function, that tests the input of gapOpening.
75
-##If the value is negative, everything is ok and the function returns
76
-##the gapOpening parameter. If the input is positive, the value is transformed
77
-##and a warning is given. If the input is not numeric, an exception is thrown.
75
+##If the value is numeric, everything is ok and the function returns
76
+##the gapOpening parameter. If the input is not numeric, an exception is thrown.
78 77
 ##Same for missing substitutionMatrix
79 78
 checkGapOpening <- function(gapOpening, type, substitutionMatrix,
80 79
         defaultDNAValue,  defaultAAValue){
... ...
@@ -90,25 +89,18 @@ checkGapOpening <- function(gapOpening, type, substitutionMatrix,
90 89
     if (is.numeric(gapOpening)) {
91 90
         if (is.matrix(gapOpening)) {
92 91
             stop("The parameter gapOpening should be \n",
93
-                 "a negative numeric, not a matrix!")
92
+                 "a numeric, not a matrix!")
94 93
         }
95 94
         if (length(gapOpening) != 1) {
96 95
             stop("The parameter gapOpening should be \n",
97
-                 "a negative numeric, not a vector!")
96
+                 "a numeric, not a vector!")
98 97
         }
99 98
         if (is.nan(gapOpening)) {
100 99
             stop("The parameter gapOpening should be \n",
101
-                 "a negative numeric, not a NaN!")
102
-        }
103
-        ##check if gapOpening is positive
104
-        if (gapOpening > 0) {
105
-            warning("According to BioStrings, the parameter gapOpening \n",
106
-                    "should be negative! The value is transformed \n",
107
-                    "to a negative numeric!")
108
-            gapOpening <- gapOpening * -1;
100
+                 "a numeric, not a NaN!")
109 101
         }
110 102
     } else {
111
-        stop("The parameter gapOpening should be a negative numeric!")
103
+        stop("The parameter gapOpening should be a numeric!")
112 104
     }
113 105
     return(gapOpening)
114 106
 }
... ...
@@ -117,9 +109,8 @@ checkGapOpening <- function(gapOpening, type, substitutionMatrix,
117 109
 
118 110
 ##used in MUSCLE, analoguous to checkGapOpening, but only ONE defaut value
119 111
 ##function, that tests the input of gapOpening.
120
-##If the value is negative, everything is ok and the function returns
121
-##the gapOpening parameter. If the input is positive, the value is transformed
122
-##and a warning is given. If the input is not numeric, an exception is thrown.
112
+##If the value is numeric, everything is ok and the function returns
113
+##the gapOpening parameter. If the input is not numeric, an exception is thrown.
123 114
 checkGapOpening2 <- function(gapOpening, substitutionMatrix,
124 115
         defaultValue){
125 116
     ##set defaultValue
... ...
@@ -132,25 +123,18 @@ checkGapOpening2 <- function(gapOpening, substitutionMatrix,
132 123
     if (is.numeric(gapOpening)) {
133 124
         if (is.matrix(gapOpening)) {
134 125
             stop("The parameter gapOpening should be \n",
135
-                 "a negative numeric, not a matrix!")
126
+                 "a numeric, not a matrix!")
136 127
         }
137 128
         if (length(gapOpening) != 1) {
138 129
             stop("The parameter gapOpening should be \n",
139
-                 "a negative numeric, not a vector!")
130
+                 "a numeric, not a vector!")
140 131
         }
141 132
         if (is.nan(gapOpening)) {
142 133
             stop("The parameter gapOpening should be \n",
143
-                 "a negative numeric, not a NaN!")
144
-        }
145
-        ##check if gapOpening is positive
146
-        if (gapOpening > 0) {
147
-            warning("According to BioStrings, the parameter gapOpening \n",
148
-                    "should be negative! The value is transformed \n",
149
-                    "to a negative numeric!")
150
-            gapOpening <- gapOpening * -1;
134
+                 "a numeric, not a NaN!")
151 135
         }
152 136
     } else {
153
-        stop("The parameter gapOpening should be a negative numeric!")
137
+        stop("The parameter gapOpening should be a numeric!")
154 138
     }
155 139
     return(gapOpening)
156 140
 }
... ...
@@ -172,25 +156,18 @@ checkGapExtension <- function(gapExtension, type, substitutionMatrix,
172 156
     if (is.numeric(gapExtension)) {
173 157
         if (is.matrix(gapExtension)) {
174 158
            stop("The parameter gapExtension should be \n",
175
-                "a negative numeric, not a matrix!")
159
+                "a numeric, not a matrix!")
176 160
         }
177 161
         if (length(gapExtension) != 1) {
178 162
            stop("The parameter gapExtension should be \n",
179
-                "a negative numeric, not a vector!")
163
+                "a numeric, not a vector!")
180 164
         }
181 165
         if (is.nan(gapExtension)) {
182 166
             stop("The parameter gapExtension should be \n",
183
-                 "a negative numeric, not a NaN!")
184
-        }
185
-        ##check if gapExtension is positive
186
-        if (gapExtension > 0) {
187
-           warning("According to BioStrings, the parameter gapOpening \n",
188
-                   "should be negative! The value is transformed to a \n",
189
-                   "negative numeric.")
190
-           gapExtension <- gapExtension * -1
167
+                 "a numeric, not a NaN!")
191 168
         }
192 169
     } else {
193
-        stop("The parameter gapExtension should be a negative numeric!")
170
+        stop("The parameter gapExtension should be a numeric!")
194 171
     }
195 172
 
196 173
     return(gapExtension)
... ...
@@ -6,6 +6,7 @@ msa <- function(inputSeqs,
6 6
                 maxiters="default",
7 7
                 substitutionMatrix="default",
8 8
                 type="default",
9
+                order=c("aligned", "input"),
9 10
                 verbose=FALSE,
10 11
                 help=FALSE,
11 12
                 ...)
... ...
@@ -5,6 +5,7 @@ msaClustalOmega <- function(inputSeqs,
5 5
                             maxiters="default",
6 6
                             substitutionMatrix="default",
7 7
                             type="default",
8
+                            order=c("aligned", "input"),
8 9
                             verbose=FALSE,
9 10
                             help=FALSE,
10 11
                             ...)
... ...
@@ -53,7 +54,15 @@ msaClustalOmega <- function(inputSeqs,
53 54
     #############
54 55
     # inputSeqs #
55 56
     #############
56
-    inputSeqs <- transformInputSeq(inputSeqs, params[["inputSeqIsFileFlag"]])
57
+    inputSeqs <- transformInputSeq(inputSeqs)
58
+
59
+    #############
60
+    # order     #
61
+    #############
62
+    order <- match.arg(order)
63
+    params[["outputOrder"]] <- switch(order,
64
+                                      aligned="tree-order",
65
+                                      input="input-order")
57 66
 
58 67
     ###########
59 68
     # cluster #
... ...
@@ -103,9 +112,9 @@ msaClustalOmega <- function(inputSeqs,
103 112
             substitutionMatrix <- NULL
104 113
     } else if (is.character(substitutionMatrix) &&
105 114
                    !is.matrix(substitutionMatrix)) {
106
-            possibleValues <- c("blosum30","blosum40", "blosum50",
107
-                                "blosum65","blosum80","gonnet")
108
-            if (!(tolower(substitutionMatrix) %in% possibleValues)){
115
+            possibleValues <- c("BLOSUM30", "BLOSUM40", "BLOSUM50",
116
+                                "BLOSUM65", "BLOSUM80", "Gonnet")
117
+            if (!(substitutionMatrix %in% possibleValues)){
109 118
                 ##create a string with all possible Values named text
110 119
                 text <- ""
111 120
                 text <- paste(possibleValues, collapse=", ")
... ...
@@ -117,21 +126,16 @@ msaClustalOmega <- function(inputSeqs,
117 126
     ##############
118 127
     # gapOpening #
119 128
     ##############
120
-
121
-    gapOpening <- checkGapOpening(gapOpening, type,
122
-                                  substitutionMatrix, -6, -6)
123
-    # ClustalOmega uses positive values
124
-    gapOpening <- gapOpening * -1
125
-
129
+    if (!identical(gapOpening, "default"))
130
+        warning("msaClustalOmega currently does not support to set\n",
131
+                "gapOpening to a non-default value!\n")
126 132
 
127 133
     ################
128 134
     # gapExtension #
129 135
     ################
130
-
131
-    gapExtension <- checkGapExtension(gapExtension, type,
132
-                                      substitutionMatrix, -1, -1)
133
-    # ClustalOmega uses positive values
134
-    gapExtension <- gapExtension * -1
136
+    if (!identical(gapExtension, "default"))
137
+        warning("msaClustalOmega currently does not support to set\n",
138
+                "gapExtension to a non-default value!\n")
135 139
 
136 140
     ############
137 141
     # maxiters #
... ...
@@ -334,13 +338,13 @@ msaClustalOmega <- function(inputSeqs,
334 338
 
335 339
     ##delete param in copy
336 340
     paramsCopy[["isProfile"]] <- NULL
337
-    
341
+
338 342
     #######
339 343
     # log #
340 344
     #######
341 345
     ##Log all non-essential output to this file
342 346
     ##DEACTIVATED: All log-messages are print to R console
343
-    
347
+
344 348
     ##if(!is.null(params[["log"]])) {
345 349
     ##    tempList <- checkOutFile("log", params)
346 350
     ##    if (tempList$existingFile) {
... ...
@@ -349,7 +353,7 @@ msaClustalOmega <- function(inputSeqs,
349 353
     ##    }
350 354
     ##    params[["log"]] <- tempList$param
351 355
     ##}
352
-    
356
+
353 357
     ##delete param in copy
354 358
     ##paramsCopy[["log"]] <- NULL
355 359
 
... ...
@@ -468,7 +472,7 @@ msaClustalOmega <- function(inputSeqs,
468 472
         if (!identical (params[["outFmt"]], "clustal") &&
469 473
             !identical (params[["outFmt"]], "clu")) {
470 474
             stop("Until now, the parameter outFmt is only implemented ",
471
-                 "for value \"clustal\" \n", 
475
+                 "for value \"clustal\" \n",
472 476
                  "the other formats will be ",
473 477
                  "realized in a later version.")
474 478
         }
... ...
@@ -477,23 +481,6 @@ msaClustalOmega <- function(inputSeqs,
477 481
     ##delete param in copy
478 482
     paramsCopy[["outFmt"]] <- NULL
479 483
 
480
-    ################
481
-    # outputOrder #
482
-    ################
483
-    ##MSA output orderlike in input/guide-tree
484
-    ##default: output-order=input-order
485
-
486
-    ##possible Values
487
-    posVal <- c("input-order", "tree-order")
488
-    ##params[["outputOrder"]] <- checkSingleValParams("outputOrder", params,
489
-    ##                                                 "input-order", posVal)
490
-
491
-    params[["outputOrder"]] <- checkSingleValParamsNew(
492
-                                "outputOrder", params, posVal)
493
-
494
-    ##delete param in copy
495
-    paramsCopy[["outputOrder"]] <- NULL
496
-
497 484
     #############
498 485
     # percentId #
499 486
     #############
... ...
@@ -523,9 +510,9 @@ msaClustalOmega <- function(inputSeqs,
523 510
 
524 511
     if (!is.null(params[["profile2"]])) {
525 512
         if (is.null(params[["profile1"]])){
526
-            stop("The parameter profile1 is NULL, \n", 
513
+            stop("The parameter profile1 is NULL, \n",
527 514
                  "so the parameter profile2 can't have a value! \n",
528
-                 "Please insert file for parameter profile1 \n", 
515
+                 "Please insert file for parameter profile1 \n",
529 516
                  "or change the parameters profile1 and profile2!")
530 517
         }
531 518
         checkInFile("profile2", params)
... ...
@@ -570,7 +557,7 @@ msaClustalOmega <- function(inputSeqs,
570 557
 
571 558
     ##useKimura==TRUE AND percentId==TRUE is not allowed!!!
572 559
     if(params[["useKimura"]] & params[["percentId"]]){
573
-        stop("Percentage Identity cannot be calcuted \n", 
560
+        stop("Percentage Identity cannot be calcuted \n",
574 561
              "if Kimura Distances are used!",
575 562
              "You have to set either the parameter percentID or \n",
576 563
              "the parameter useKimura to FALSE!")
... ...
@@ -622,10 +609,10 @@ msaClustalOmega <- function(inputSeqs,
622 609
 
623 610
     inputSeqNames <- names(inputSeqs)
624 611
 
625
-    names(inputSeqs) <- paste0("seq", 1:length(inputSeqs))
612
+    names(inputSeqs) <- paste0("Seq", 1:length(inputSeqs))
626 613
 
627
-    result <- .Call("RClustalOmega", inputSeqs, cluster, gapOpening,
628
-                    gapExtension, maxiters, substitutionMatrix, type,
614
+    result <- .Call("RClustalOmega", inputSeqs, cluster, 6,
615
+                    1, maxiters, substitutionMatrix, type,
629 616
                     verbose, params, PACKAGE="msa");
630 617
 
631 618
     out <- convertAlnRows(result$msa, type)
... ...
@@ -638,7 +625,6 @@ msaClustalOmega <- function(inputSeqs,
638 625
     else
639 626
         names(out@unmasked) <- NULL
640 627
 
641
-
642 628
     standardParams <- list(gapOpening=gapOpening,
643 629
                            gapExtension=gapExtension,
644 630
                            maxiters=maxiters,
... ...
@@ -5,6 +5,7 @@ msaClustalW <- function(inputSeqs,
5 5
                         maxiters="default",
6 6
                         substitutionMatrix="default",
7 7
                         type="default",
8
+                        order=c("aligned", "input"),
8 9
                         verbose=FALSE,
9 10
                         help=FALSE,
10 11
                         ...)
... ...
@@ -53,7 +54,14 @@ msaClustalW <- function(inputSeqs,
53 54
     #############
54 55
     # inputSeqs #
55 56
     #############
56
-    inputSeqs <- transformInputSeq(inputSeqs, params[["inputSeqIsFileFlag"]])
57
+    inputSeqs <- transformInputSeq(inputSeqs)
58
+
59
+    #############
60
+    # order     #
61
+    #############
62
+    order <- match.arg(order)
63
+
64
+    params[["outorder"]] <- order
57 65
 
58 66
     ###########
59 67
     # cluster #
... ...
@@ -122,7 +130,7 @@ msaClustalW <- function(inputSeqs,
122 130
         !is.matrix(substitutionMatrix)) {
123 131
         ##check whether value is BLOSUM, PAM, GONNET, or ID;
124 132
             possibleValues <- c("blosum", "pam", "gonnet", "id")
125
-            if (!(tolower(substitutionMatrix) %in% possibleValues)){
133
+            if (!(substitutionMatrix %in% possibleValues)){
126 134
                 ##create a string with all possible Values named text
127 135
                 text <- ""
128 136
                 text <- paste(possibleValues, collapse=", ")
... ...
@@ -135,15 +143,13 @@ msaClustalW <- function(inputSeqs,
135 143
         if (isSymmetric(substitutionMatrix)) {
136 144
             if (nrow(substitutionMatrix) <=20 ||
137 145
                 nrow(substitutionMatrix) >26 ) {
138
-                    stop("The parameter substitutionMatrix ",
139
-                         "has wrong dimensions!")
146
+                    stop("substitutionMatrix has wrong dimensions!")
140 147
             }
141 148
         } else {
142
-            stop("The parameter substitutionMatrix should be symmetric!")
149
+            stop("substitutionMatrix should be a symmetric matrix!")
143 150
         }
144 151
     }
145 152
 
146
-
147 153
     ##############
148 154
     # gapOpening #
149 155
     ##############
... ...
@@ -351,17 +357,6 @@ msaClustalW <- function(inputSeqs,
351 357
     ##delete param in copy
352 358
     paramsCopy[["output"]] <- NULL
353 359
 
354
-    ############
355
-    # outorder #
356
-    ############
357
-
358
-    ##possible Values
359
-    posVal <- c("input", "aligned")
360
-    params[["outorder"]] <- checkSingleValParamsNew("outorder", params, posVal)
361
-
362
-    ##delete param in copy
363
-    paramsCopy[["outorder"]] <- NULL
364
-
365 360
     ########
366 361
     # case #
367 362
     ########
... ...
@@ -617,6 +612,9 @@ msaClustalW <- function(inputSeqs,
617 612
 
618 613
     params[["pwgapopen"]] <- checkNumericParamsNew("pwgapopen", params)
619 614
 
615
+    if (is.numeric(params[["pwgapopen"]]))
616
+        params[["pwgapopen"]] <- abs(params[["pwgapopen"]])
617
+
620 618
     ##delete param in copy
621 619
     paramsCopy[["pwgapopen"]] <- NULL
622 620
 
... ...
@@ -627,6 +625,8 @@ msaClustalW <- function(inputSeqs,
627 625
 
628 626
     params[["pwgapext"]] <- checkNumericParamsNew("pwgapext", params)
629 627
 
628
+    if (is.numeric(params[["pwgapext"]]))
629
+        params[["pwgapext"]] <- abs(params[["pwgapext"]])
630 630
 
631 631
     ##delete param in copy
632 632
     paramsCopy[["pwgapext"]] <- NULL
... ...
@@ -1116,11 +1116,11 @@ msaClustalW <- function(inputSeqs,
1116 1116
 
1117 1117
     inputSeqNames <- names(inputSeqs)
1118 1118
 
1119
-    names(inputSeqs) <- paste0("seq", 1:length(inputSeqs))
1119
+    names(inputSeqs) <- paste0("Seq", 1:length(inputSeqs))
1120 1120
 
1121
-    result <- .Call("RClustalW", inputSeqs, cluster, gapOpening, gapExtension,
1122
-                    maxiters, substitutionMatrix, type, verbose,
1123
-                    params, PACKAGE="msa")
1121
+    result <- .Call("RClustalW", inputSeqs, cluster, abs(gapOpening),
1122
+                    abs(gapExtension), maxiters, substitutionMatrix,
1123
+                    type, verbose, params, PACKAGE="msa")
1124 1124
 
1125 1125
     out <- convertAlnRows(result$msa, type)
1126 1126
 
... ...
@@ -5,6 +5,7 @@ msaMuscle <- function(inputSeqs,
5 5
                       maxiters="default",
6 6
                       substitutionMatrix="default",
7 7
                       type="default",
8
+                      order=c("aligned", "input"),
8 9
                       verbose=FALSE,
9 10
                       help=FALSE,
10 11
                       ...)
... ...
@@ -70,7 +71,27 @@ msaMuscle <- function(inputSeqs,
70 71
     # inputSeqs #
71 72
     #############
72 73
     ##transform the input Sequences to a string vector
73
-    inputSeqs <- transformInputSeq(inputSeqs, params[["inputSeqIsFileFlag"]])
74
+    inputSeqs <- transformInputSeq(inputSeqs)
75
+
76
+    #############
77
+    # order     #
78
+    #############
79
+    order <- match.arg(order)
80
+
81
+    if (order == "input")
82
+    {
83
+        if (params[["inputSeqIsFileFlag"]])
84
+            stop("msaMuscle does not support order=\"input\" for reading\n",
85
+                 "sequences directly from a FASTA file.")
86
+        else if (is.null(names(inputSeqs)) ||
87
+                 length(unique(names(inputSeqs))) != length(inputSeqs))
88
+        {
89
+            warning("order=\"input\" requires input sequences to be named\n",
90
+                    "uniquely! Assigning default names 'Seq1'..'Seqn'\n",
91
+                    "to sequences.")
92
+            names(inputSeqs) <- paste0("Seq", 1:length(inputSeqs))
93
+        }
94
+    }
74 95
 
75 96
     ###########
76 97
     # cluster #
... ...
@@ -1126,24 +1147,31 @@ msaMuscle <- function(inputSeqs,
1126 1147
 
1127 1148
     inputSeqNames <- names(inputSeqs)
1128 1149
 
1129
-    names(inputSeqs) <- paste0("seq", 1:length(inputSeqs))
1130
-
1150
+    names(inputSeqs) <- paste0("Seq", 1:length(inputSeqs))
1131 1151
 
1132
-    result <- .Call("RMuscle", inputSeqs, cluster, gapOpening,
1133
-                    gapExtension, maxiters, substitutionMatrix, type,
1152
+    result <- .Call("RMuscle", inputSeqs, cluster, -abs(gapOpening),
1153
+                    -abs(gapExtension), maxiters, substitutionMatrix, type,
1134 1154
                     verbose, params, PACKAGE="msa")
1135 1155
 
1136 1156
     out <- convertAlnRows(result$msa, type)
1137 1157
 
1138 1158
     if (length(inputSeqNames) > 0)
1139 1159
     {
1140
-        perm <- match(names(out@unmasked), names(inputSeqs))
1141
-        names(out@unmasked) <- inputSeqNames[perm]
1160
+        if (order == "aligned")
1161
+        {
1162
+            perm <- match(names(out@unmasked), names(inputSeqs))
1163
+            names(out@unmasked) <- inputSeqNames[perm]
1164
+        }
1165
+        else
1166
+        {
1167
+            perm <- match(names(inputSeqs), names(out@unmasked))
1168
+            out@unmasked <- out@unmasked[perm]
1169
+            names(out@unmasked) <- inputSeqNames
1170
+        }
1142 1171
     }
1143 1172
     else
1144 1173
         names(out@unmasked) <- NULL
1145 1174
 
1146
-
1147 1175
     standardParams <- list(gapOpening=gapOpening,
1148 1176
                            gapExtension=gapExtension,
1149 1177
                            maxiters=maxiters,
... ...
@@ -13,7 +13,7 @@ rm -rf src/gc-7.2/*.a
13 13
 ## -- Muscle
14 14
 rm -rf src/Muscle/muscle.make.std???.txt
15 15
 rm -rf src/Muscle/*.o
16
-rm -rf src/Muscle/*.dll
16
+rm -rf src/Muscle/*.a
17 17
 rm -rf src/Muscle/*.dll
18 18
 
19 19
 ## -- ClustalW
... ...
@@ -1,5 +1,5 @@
1 1
 Change history of package msa:
2 2
 ==============================
3 3
 
4
-Version 0.99.0:
5
-- first version submitted to Bioconductor
4
+Version 1.0.0:
5
+- first official release as part of Bioconductor 3.1
... ...
@@ -1,68 +1,68 @@
1
->HBA1 Homo sapiens
1
+>HBA1_Homo_sapiens
2 2
 VLSPADKTNVKAAWGKVGAHAGEYGAEALERMFLSFPTTKTYFPHFDLSHGSAQVKGHGK
3 3
 KVADALTNAVAHVDDMPNALSALSDLHAHKLRVDPVNFKLLSHCLLVTLAAHLPAEFTPA
4 4
 VHASLDKFLASVSTVLTSKYR
5
->HBA1 Macaca mulatta
5
+>HBA1_Macaca_mulatta
6 6
 VLSPADKSNVKAAWGKVGGHAGEYGAEALERMFLSFPTTKTYFPHFDLSHGSAQVKGHGK
7 7
 KVADALTLAVGHVDDMPNALSALSDLHAHKLRVDPVNFKLLSHCLLVTLAAHLPAEFTPA
8 8
 VHASLDKFLASVSTVLTSKYR
9
->HBA1 Ornithorhynchus anatinus
9
+>HBA1_Ornithorhynchus_anatinus
10 10
 MLTDAEKKEVTALWGKAAGHGEEYGAEALERLFQAFPTTKTYFSHFDLSHGSAQIKAHGK
11 11
 KVADALSTAAGHFDDMDSALSALSDLHAHKLRVDPVNFKLLAHCILVVLARHCPGEFTPS
12 12
 AHAAMDKFLSKVATVLTSKYR
13
->HBA1 Bos taurus
13
+>HBA1_Bos_taurus
14 14
 VLSAADKGNVKAAWGKVGGHAAEYGAEALERMFLSFPTTKTYFPHFDLSHGSAQVKGHGA
15 15
 KVAAALTKAVEHLDDLPGALSELSDLHAHKLRVDPVNFKLLSHSLLVTLASHLPSDFTPA
16 16
 VHASLDKFLANVSTVLTSKYR
17
->HBA1 Monodelphis domestica
17
+>HBA1_Monodelphis_domestica
18 18
 VLSAADKTNVKAAWSKVGGNSGAYMGEALYRTFLSFPPTKTYFPHFEFSAGSAQIKGQGQ
19 19
 KIADAVSLAVAHMDDLATALSALSDLHAHNLKVDPVNFKFLCHNVLVTLASHLGKDFTPE
20 20
 IHASLDKFLALLSTVLTSKYR
21
->HBA1 Erinaceus europaeus
21
+>HBA1_Erinaceus_europaeus
22 22
 VLSATDKANVKTFWGKLGGHGGEYGGEALDRMFQAHPTTKTYFPHFDLNPGSAQVKGHGK
23 23
 KVADALTTAVNNLDDVPGALSALSDLHAHKLRVDPVNFKLLSHCLLVTLALHHPADFTPA
24 24
 VHASLDKFLATVATVLTSKYR
25
->HBA1 Loxodonta africana
25
+>HBA1_Loxodonta_africana
26 26
 VLSDNDKTNVKATWSKVGDHASDYVAEALERMFFSFPTTKTYFPHFDLGHGSGQVKAHGK
27 27
 KVGEALTQAVGHLDDLPSALSALSDLHAHKLRVDPVNFKLLSHCLLVTLSSHQPTEFTPE
28 28
 VHASLDKFLSNVSTVLTSKYR
29
->HBA1 Mus musculus
29
+>HBA1_Mus_musculus
30 30
 VLSGEDKSNIKAAWGKIGGHGAEYGAEALERMFASFPTTKTYFPHFDVSHGSAQVKGHGK
31 31
 KVADALASAAGHLDDLPGALSALSDLHAHKLRVDPVNFKLLSHCLLVTLASHHPADFTPA
32 32
 VHASLDKFLASVSTVLTSKYR
33
->HBA1 Felis silvestris catus
33
+>HBA1_Felis_silvestris_catus
34 34
 VLSAADKSNVKACWGKIGSHAGEYGAEALERTFCSFPTTKTYFPHFDLSHGSAQVKAHGQ
35 35
 KVADALTQAVAHMDDLPTAMSALSDLHAYKLRVDPVNFKFLSHCLLVTLACHHPAEFTPA
36 36
 VHASLDKFFSAVSTVLTSKYR
37
->HBA1 Chrysocyon brachyurus
37
+>HBA1_Chrysocyon_brachyurus
38 38
 VLSPADKTNIKSTWDKIGGHAGDYGGEALDRTFQSFPTTKTYFPHFDLSPGSAQVKAHGK
39 39
 KVADALTTAVAHLDDLPGALSALSDLHAYKLRVDPVNFKLLSHCLLVTLACHHPTEFTPA
40 40
 VHASLDKFFTAVSTVLTSKYR
41
->HBA1 Gallus gallus
41
+>HBA1_Gallus_gallus
42 42
 VLSAADKNNVKGIFTKIAGHAEEYGAETLERMFTTYPPTKTYFPHFDLSHGSAQIKGHGK
43 43
 KVVAALIEAANHIDDIAGTLSKLSDLHAHKLRVDPVNFKLLGQCFLVVVAIHHPAALTPE
44 44
 VHASLDKFLCAVGTVLTAKYR
45
->Zebra_fish (Brachydanio rerio)x
45
+>HBA1_Danio_rerio
46 46
 SLSDTDKAVVKAIWAKISPKADEIGAEALARMLTVYPQTKTYFSHWADLSPGSGPVKKHG
47 47
 KTIMGAVGEAISKIDDLVGGLAALSELHAFKLRVDPANFKILSHNVIVVIAMLFPADFTP
48 48
 EVHVSVDKFFNNLALALSEKYR
49
->HBA1 Tursiops truncatus
49
+>HBA1_Tursiops_truncatus
50 50
 VLSPADKTNVKGTWSKIGNHSAEYGAEALERMFINFPSTKTYFSHFDLGHGSAQIKGHGK
51 51
 KVADALTKAVGHIDNLPDALSELSDLHAHKLRVDPVNFKLLSHCLLVTLALHLPADFTPS
52 52
 VHASLDKFLASVSTVLTSKYR
53
->HBA1 Xenopus tropicalis
53
+>HBA1_Xenopus_tropicalis
54 54
 HLTADDKKHIKAIWPSVAAHGDKYGGEALHRMFMCAPKTKTYFPDFDFSEHSKHILAHGK
55 55
 KVSDALNEACNHLDNIAGCLSKLSDLHAYDLRVDPGNFPLLAHQILVVVAIHFPKQFDPA
56 56
 THKALDKFLVSVSNVLTSKYR
57
->HBA1 Microcephalophis gracilis
57
+>HBA1_Microcephalophis_gracilis
58 58
 VLTEEDKARVRVAWVPVSKNAELYGAETLTRLFAAHPTTKTYFPHFDLSPGSNDLKVHGK
59 59
 KVIDALTEAVNNLDDVAGALSKLSDLHAQKLRVDPDNFQFLGLCLEVTIAAHSGGPLKPE
60 60
 VLLSVDKFLGQISKVLASRYR
61
->HBA1 Pan troglodytes
61
+>HBA1_Pan_troglodytes
62 62
 MVLSPADKTNVKAAWGKVGAHAGEYGAEALERMFLSFPTTKTYFPHFDLSHGSAQVKGHG
63 63
 KKVADALTNAVAHVDDMPNALSALSDLHAHKLRVDPVNFKLLSHCLLVTLAAHLPAEFTP
64 64
 AVHASLDKFLASVSTVLTSKYR
65
->HBA1 Rattus norvegicus
65
+>HBA1_Rattus_norvegicus
66 66
 MVLSADDKTNIKNCWGKIGGHGGEYGEEALQRMFAAFPTTKTYFSHIDVSPGSAQVKAHG
67 67
 KKVADALAKAADHVEDLPGALSTLSDLHAHKLRVDPVNFKFLSHCLLVTLACHHPGDFTP
68 68
 AMHASLDKFLASVSTVLTSKYR
... ...
@@ -1,4 +1,4 @@
1
->PH4H Homo sapiens
1
+>PH4H_Homo_sapiens
2 2
 MSTAVLENPGLGRKLSDFGQETSYIEDNCNQNGAISLIFSLKEEVGALAKVLRLFEENDV
3 3
 NLTHIESRPSRLKKDEYEFFTHLDKRSLPALTNIIKILRHDIGATVHELSRDKKKDTVPW
4 4
 FPRTIQELDRFANQILSYGAELDADHPGFKDPVYRARRKQFADIAYNYRHGQPIPRVEYM
... ...
@@ -7,7 +7,7 @@ RLRPVAGLLSSRDFLGGLAFRVFHCTQYIRHGSKPMYTPEPDICHELLGHVPLFSDRSFA
7 7
 QFSQEIGLASLGAPDEYIEKLATIYWFTVEFGLCKQGDSIKAYGAGLLSSFGELQYCLSE
8 8
 KPKLLPLELEKTAIQNYTVTEFQPLYYVAESFNDAKEKVRNFAATIPRPFSVRYDPYTQR
9 9
 IEVLDNTQQLKILADSINSEIGILCSALQKIK
10
->PH4H Rattus norvegicus
10
+>PH4H_Rattus_norvegicus
11 11
 MAAVVLENGVLSRKLSDFGQETSYIEDNSNQNGAISLIFSLKEEVGALAKVLRLFEENDI
12 12
 NLTHIESRPSRLNKDEYEFFTYLDKRTKPVLGSIIKSLRNDIGATVHELSRDKEKNTVPW
13 13
 FPRTIQELDRFANQILSYGAELDADHPGFKDPVYRARRKQFADIAYNYRHGQPIPRVEYT
... ...
@@ -16,7 +16,7 @@ RLRPVAGLLSSRDFLGGLAFRVFHCTQYIRHGSKPMYTPEPDICHELLGHVPLFSDRSFA
16 16
 QFSQEIGLASLGAPDEYIEKLATIYWFTVEFGLCKEGDSIKAYGAGLLSSFGELQYCLSD
17 17
 KPKLLPLELEKTACQEYSVTEFQPLYYVAESFSDAKEKVRTFAATIPRPFSVRYDPYTQR
18 18
 VEVLDNTQQLKILADSINSEVGILCNALQKIKS
19
->PH4H Mus musculus
19
+>PH4H_Mus_musculus
20 20
 MAAVVLENGVLSRKLSDFGQETSYIEDNSNQNGAVSLIFSLKEEVGALAKVLRLFEENEI
21 21
 NLTHIESRPSRLNKDEYEFFTYLDKRSKPVLGSIIKSLRNDIGATVHELSRDKEKNTVPW
22 22
 FPRTIQELDRFANQILSYGAELDADHPGFKDPVYRARRKQFADIAYNYRHGQPIPRVEYT
... ...
@@ -25,19 +25,19 @@ RLRPVAGLLSSRDFLGGLAFRVFHCTQYIRHGSKPMYTPEPDICHELLGHVPLFSDRSFA
25 25
 QFSQEIGLASLGAPDEYIEKLATIYWFTVEFGLCKEGDSIKAYGAGLLSSFGELQYCLSD
26 26
 KPKLLPLELEKTACQEYTVTEFQPLYYVAESFNDAKEKVRTFAATIPRPFSVRYDPYTQR
27 27
 VEVLDNTQQLKILADSINSEVGILCHALQKIKS
28
->PH4H Chromobacterium violaceum
28
+>PH4H_Chromobacterium_violaceum
29 29
 MNDRADFVVPDITTRKNVGLSHDANDFTLPQPLDRYSAEDHATWATLYQRQCKLLPGRAC
30 30
 DEFMEGLERLEVDADRVPDFNKLNQKLMAATGWKIVAVPGLIPDDVFFEHLANRRFPVTW
31 31
 WLREPHQLDYLQEPDVFHDLFGHVPLLINPVFADYLEAYGKGGVKAKALGALPMLARLYW
32 32
 YTVEFGLINTPAGMRIYGAGILSSKSESIYCLDSASPNRVGFDLMRIMNTRYRIDTFQKT
33 33
 YFVIDSFKQLFDATAPDFAPLYLQLADAQPWGAGDVAPDDLVLNAGDRQGWADTEDV
34
->PH4H Pseudomonas aeruginosa
34
+>PH4H_Pseudomonas_aeruginosa
35 35
 MKTTQYVARQPDDNGFIHYPETEHQVWNTLITRQLKVIEGRACQEYLDGIEQLGLPHERI
36 36
 PQLDEINRVLQATTGWRVARVPALIPFQTFFELLASQQFPVATFIRTPEELDYLQEPDIF
37 37
 HEIFGHCPLLTNPWFAEFTHTYGKLGLKASKEERVFLARLYWMTIEFGLVETDQGKRIYG
38 38
 GGILSSPKETVYSLSDEPLHQAFNPLEAMRTPYRIDILQPLYFVLPDLKRLFQLAQEDIM
39 39
 ALVHEAMRLGLHAPLFPPKQAA
40
->PH4H Bos taurus
40
+>PH4H_Bos_taurus
41 41
 MSALVLESRALGRKLSDFGQETSYIEGNSDQNAVSLIFSLKEEVGALARVLRLFEENDIN
42 42
 LTHIESRPSRLRKDEYEFFTNLDQRSVPALANIIKILRHDIGATVHELSRDKKKDTVPWF
43 43
 PRTIQELDNFANQVLSYGAELDADHPGFKDPVYRARRKQFADIAYNYRHGQPIPRVEYTE
... ...
@@ -46,20 +46,20 @@ LRPVAGLLSSRDFLGGLAFRVFHCTQYIRHGSKPMYTPEPDICHELLGHVPLFSDRSFAQ
46 46
 FSQEIGLASLGAPDEYIEKLATIYWFTVEFGLCKQGDSIKAYGAGLLSSFGELQYCLSDK
47 47
 PKLLPLELEKTAVQEYTITEFQPLYYVAESFNDAKEKVRNFAATIPRPFSVHYDPYTQRI
48 48
 EVLDNTQQLKILADSISSEVEILCSALQKLK
49
->PH4H Ralstonia solanacearum
49
+>PH4H_Ralstonia_solanacearum
50 50
 MAIATPTSAAPTPAPAGFTGTLTDKLREQFAEGLDGQTLRPDFTMEQPVHRYTAADHATW
51 51
 RTLYDRQEALLPGRACDEFLQGLSTLGMSREGVPSFDRLNETLMRATGWQIVAVPGLVPD
52 52
 EVFFEHLANRRFPASWWMRRPDQLDYLQEPDGFHDIFGHVPLLINPVFADYMQAYGQGGL
53 53
 KAARLGALDMLARLYWYTVEFGLIRTPAGLRIYGAGIVSSKSESVYALDSASPNRIGFDV
54 54
 HRIMRTRYRIDTFQKTYFVIDSFEQLFDATRPDFTPLYEALGTLPTFGAGDVVDGDAVLN
55 55
 AGTREGWADTADI
56
->PH4H Caulobacter crescentus
56
+>PH4H_Caulobacter_crescentus
57 57
 MSGDGLSNGPPPGARPDWTIDQGWETYTQAEHDVWITLYERQTDMLHGRACDEFMRGLDA
58 58
 LDLHRSGIPDFARINEELKRLTGWTVVAVPGLVPDDVFFDHLANRRFPAGQFIRKPHELD
59 59
 YLQEPDIFHDVFGHVPMLTDPVFADYMQAYGEGGRRALGLGRLANLARLYWYTVEFGLMN
60 60
 TPAGLRIYGAGIVSSRTESIFALDDPSPNRIGFDLERVMRTLYRIDDFQQVYFVIDSIQT
61 61
 LQEVTLRDFGAIYERLASVSDIGVAEIVPGDAVLTRGTQAYATAGGRLAGAAAG
62
->PH4H Rhizobium loti
62
+>PH4H_Rhizobium_loti
63 63
 MSVAEYARDCAAQGLRGDYSVCRADFTVAQDYDYSDEEQAVWRTLCDRQTKLTRKLAHHS
64 64
 YLDGVEKLGLLDRIPDFEDVSTKLRKLTGWEIIAVPGLIPAAPFFDHLANRRFPVTNWLR
65 65
 TRQELDYIVEPDMFHDFFGHVPVLSQPVFADFMQMYGKKAGDIIALGGDEMITRLYWYTA
... ...
@@ -1,4 +1,4 @@
1
->PAH Homo sapiens
1
+>PAH_Homo_sapiens
2 2
 CAGCTGGGGGTAAGGGGGGCGGATTATTCATATAATTGTTATACCAGACGGTCGCAGGCTTAGTCCAATT
3 3
 GCAGAGAACTCGCTTCCCAGGCTTCTGAGAGTCCCGGAAGTGCCTAAACCTGTCTAATCGACGGGGCTTG
4 4
 GGTGGCCCGTCGCTCCCTGGCTTCTTCCCTTTACCCAGGGCGGGCAGCGAAGTGGTGCCTCCTGCGTCCC
... ...
@@ -38,7 +38,7 @@ ACTCTGCACCTAATCCCCATAACTTCCAGTATCATTTTCCAATTAATTATCAAGTCTGTTTTGGGAAACA
38 38
 CTTTGAGGACATTTATGATGCAGCAGATGTTGACTAAAGGCTTGGTTGGTAGATATTCAGGAAATGTTCA
39 39
 CTGAATAAATAAGTAAATACATTATTGAAAAGCAAATCTGTATAAATGTGAAATTTTTATTTGTATTAGT
40 40
 AATAAAACATTAGTAGTTTA
41
->PAH Mus musculus
41
+>PAH_Mus_musculus
42 42
 AGTCCAGGACTGGAGTTGGGTATGGACTGTTCATGTCTATCCACTGCTACGTCAGGGCAACACCCACTGA
43 43
 GAGTGACCTTGTAGACTGCAGTGGGAGACACCCTTCAAAACCTCTCCTCTCCTGTCCTGAGAGCCAGGTT
44 44
 AAAACCATCAGCCCCGCATCCTGAGTGCAAACTTTTCCTAACCCTGCTGCTAAGCTAGACACCTCACTTA
... ...
@@ -70,7 +70,7 @@ CATTTGGGCTCTGTCTGTTCATTTTTAACCTCTCAGGTAAGCTCTGATGGAATACATATTGCTTAGTGTA
70 70
 AAATGTGAGACTGTCATCGGGAACAAATTATTCCATTCAGTACAGATTGTAATCTACAAAGCTTAGTTTC
71 71
 TACATTCATTCATTATGGCTCTGAGAACTACTTTGTTAGCCTGCTTACATAAATGTCCTCTGATCTAAGA
72 72
 CTCTATTAAGATAGTTACAAGCAATAAAGCATTATATAAAACAAAAAAAAAA
73
->PAH Rattus norvegicus
73
+>PAH_Rattus_norvegicus
74 74
 CAAGTTAAAACCATCAGCCCTCCCATCCTGAGTGCCTACCTTTCCCAACCCCGCTGCTAAGCTAGACACC
75 75
 TCACTCACTGAGAGCCAGCATGGCAGCTGTTGTCCTGGAGAATGGAGTCCTGAGCAGAAAACTCTCAGAC
76 76
 TTTGGGCAGGAAACAAGCTATATTGAAGACAACTCCAATCAAAATGGTGCCATATCTCTGATATTCTCAC
... ...
@@ -1,4 +1,4 @@
1
->PAH Homo sapiens
1
+>PAH_Homo_sapiens
2 2
 CAGCUGGGGGUAAGGGGGGCGGAUUAUUCAUAUAAUUGUUAUACCAGACGGUCGCAGGCUUAGUCCAAUU
3 3
 GCAGAGAACUCGCUUCCCAGGCUUCUGAGAGUCCCGGAAGUGCCUAAACCUGUCUAAUCGACGGGGCUUG
4 4
 GGUGGCCCGUCGCUCCCUGGCUUCUUCCCUUUACCCAGGGCGGGCAGCGAAGUGGUGCCUCCUGCGUCCC
... ...
@@ -38,7 +38,7 @@ ACUCUGCACCUAAUCCCCAUAACUUCCAGUAUCAUUUUCCAAUUAAUUAUCAAGUCUGUUUUGGGAAACA
38 38
 CUUUGAGGACAUUUAUGAUGCAGCAGAUGUUGACUAAAGGCUUGGUUGGUAGAUAUUCAGGAAAUGUUCA
39 39
 CUGAAUAAAUAAGUAAAUACAUUAUUGAAAAGCAAAUCUGUAUAAAUGUGAAAUUUUUAUUUGUAUUAGU
40 40
 AAUAAAACAUUAGUAGUUUA
41
->PAH Mus musculus
41
+>PAH_Mus_musculus
42 42
 AGUCCAGGACUGGAGUUGGGUAUGGACUGUUCAUGUCUAUCCACUGCUACGUCAGGGCAACACCCACUGA
43 43
 GAGUGACCUUGUAGACUGCAGUGGGAGACACCCUUCAAAACCUCUCCUCUCCUGUCCUGAGAGCCAGGUU
44 44
 AAAACCAUCAGCCCCGCAUCCUGAGUGCAAACUUUUCCUAACCCUGCUGCUAAGCUAGACACCUCACUUA
... ...
@@ -70,7 +70,7 @@ CAUUUGGGCUCUGUCUGUUCAUUUUUAACCUCUCAGGUAAGCUCUGAUGGAAUACAUAUUGCUUAGUGUA
70 70
 AAAUGUGAGACUGUCAUCGGGAACAAAUUAUUCCAUUCAGUACAGAUUGUAAUCUACAAAGCUUAGUUUC
71 71
 UACAUUCAUUCAUUAUGGCUCUGAGAACUACUUUGUUAGCCUGCUUACAUAAAUGUCCUCUGAUCUAAGA
72 72
 CUCUAUUAAGAUAGUUACAAGCAAUAAAGCAUUAUAUAAAACAAAAAAAAAA
73
->PAH Rattus norvegicus
73
+>PAH_Rattus_norvegicus
74 74
 CAAGUUAAAACCAUCAGCCCUCCCAUCCUGAGUGCCUACCUUUCCCAACCCCGCUGCUAAGCUAGACACC
75 75
 UCACUCACUGAGAGCCAGCAUGGCAGCUGUUGUCCUGGAGAAUGGAGUCCUGAGCAGAAAACUCUCAGAC
76 76
 UUUGGGCAGGAAACAAGCUAUAUUGAAGACAACUCCAAUCAAAAUGGUGCCAUAUCUCUGAUAUUCUCAC
... ...
@@ -12,8 +12,8 @@ distMatOut=                  [Filename]
12 12
 force=                       [Logical Value]
13 13
 full=                        [Logical Value]
14 14
 fullIter=                    [Logical Value]
15
-gapOpening=                  [Negative Numeric]
16
-gapExtension=                [Negative Numeric]
15
+gapOpening=                  [Numeric] (currently not supported)
16
+gapExtension=                [Numeric] (currently not supported)
17 17
 guideTreeIn=                 [Filename]
18 18
 guideTreeOut=                [Filename]
19 19
 help=                        [Logical Value]
... ...
@@ -28,9 +28,9 @@ maxHmmIterations=            [Int]
28 28
 maxiters=                    [Positive Int]
29 29
 maxNumSeq=                   [Int]
30 30
 maxSeqLen=                   [Int]
31
+order=                       [String]
31 32
 outfile=                     [Filename]
32 33
 outFmt=                      [String]
33
-outputOrder=                 [String]
34 34
 percentId=                   [Logical Value]
35 35
 profile1=                    [Filename]
36 36
 profile2=                    [Filename]
... ...
@@ -13,8 +13,8 @@ dnamatrix=                   [Filename] or [String]
13 13
 endgaps=                     [Logical Value]
14 14
 fullhelp=                    [Logical Value]
15 15
 gapdist=                     [Int]
16
-gapOpening=                  [Negative Numeric]
17
-gapExtension=                [Negative Numeric]
16
+gapOpening=                  [Numeric]
17
+gapExtension=                [Numeric]
18 18
 helixendin=                  [Int]
19 19
 helixendout=                 [Int]
20 20
 helixgap=                    [Int]
... ...
@@ -34,7 +34,7 @@ nosecstr2=                   [Logical Value]
34 34
 novgap=                      [Logical Value]
35 35
 noweights=                   [Logical Value]
36 36
 options=                     [Logical Value]
37
-outorder=                    [String]
37
+order=                       [String]
38 38
 output=                      [String]
39 39
 outputtree=                  [String]
40 40
 pairgap=                     [Int]
... ...
@@ -20,8 +20,8 @@ diags2=                      [Logical Value]
20 20
 dimer=                       [Logical Value]
21 21
 distance1=                   [String]
22 22
 distance2=                   [String]
23
-gapOpening=                  [Negative Numeric]
24
-gapExtension=                [Negative Numeric]
23
+gapOpening=                  [Numeric]
24
+gapExtension=                [Numeric]
25 25
 hydro=                       [Positive Int]
26 26
 hydrofactor=                 [Positive Numeric]
27 27
 in1=                         [Filename]
... ...
@@ -36,6 +36,7 @@ minsmoothscore=              [Positive Numeric]
36 36
 noanchors=                   [Logical Value]
37 37
 nocore=                      [Logical Value]
38 38
 objscore=                    [String]
39
+order=                       [String]
39 40
 profile=                     [Logical Value]
40 41
 refine=                      [Logical Value]
41 42
 refinew=                     [Logical Value]
... ...
@@ -11,7 +11,8 @@
11 11
         cluster="default", gapOpening="default",
12 12
         gapExtension="default", maxiters="default",
13 13
         substitutionMatrix="default", type="default",
14
-        verbose=FALSE, help=FALSE, ...)
14
+        order=c("aligned", "input"), verbose=FALSE, help=FALSE,
15
+        ...)
15 16
 }
16 17
 \arguments{
17 18
   \item{inputSeqs}{input sequences; this argument can be a character vector,
... ...
@@ -31,16 +32,16 @@
31 32
     \code{\link{msaMuscle}} for algorithm-specific information.}
32 33
   \item{gapOpening}{gap opening penalty; the defaults are
33 34
     specific to the algorithm (see \code{\link{msaClustalW}},
34
-    \code{\link{msaClustalOmega}}, or \code{\link{msaMuscle}});
35
-    In order to standardize interfaces,
36
-    all algorithms consistently use negative values for the gap opening
37
-    penalty.}
35
+    and \code{\link{msaMuscle}}). Note that the sign of
36
+    this parameter is ignored. The sign is automatically
37
+    adjusted such that the called algorithm penalizes gaps
38
+    instead of rewarding them.}
38 39
   \item{gapExtension}{gap extension penalty; the defaults are
39 40
     specific to the algorithm (see \code{\link{msaClustalW}},
40
-    \code{\link{msaClustalOmega}}, or \code{\link{msaMuscle}});
41
-    In order to standardize interfaces,
42
-    all algorithms consistently use negative values for the gap extension
43
-    penalty.}
41
+    and \code{\link{msaMuscle}}). Note that the sign of
42
+    this parameter is ignored. The sign is automatically
43
+    adjusted such that the called algorithm penalizes gaps
44
+    instead of rewarding them.}
44 45
   \item{maxiters}{maximum number of iterations; its
45 46
     interpretation and default value depends on the method;
46 47
     see \code{\link{msaClustalW}}, \code{\link{msaClustalOmega}}, or
... ...
@@ -63,6 +64,18 @@
63 64
     parameter is not necessary. If it is nevertheless specified and the
64 65
     type does not match the class of \code{inputSeqs}, the function
65 66
     stops with an error.}
67
+  \item{order}{how the sequences should be ordered in the output object;
68
+    if \code{"aligned"} is chosen, the sequences are ordered in the way
69
+    the multiple sequence alignment algorithm orders them. If
70
+    \code{"input"} is chosen, the sequences in the output object are
71
+    ordered in the same way as the input sequences. For MUSCLE, the
72
+    choice \code{"input"} is not available for sequence data that is
73
+    read directly from a FASTA file. Even if sequences are supplied
74
+    directly via R, the sequences must have unique names, otherwise
75
+    the input order cannot be recovered. If the sequences do not have
76
+    names or if the names are not unique, the \code{\link{msaMuscle}}
77
+    function assignes generic unique names \code{"Seq1"}-\code{Seqn}
78
+    to the sequences and issues a warning.}
66 79
   \item{verbose}{if \code{TRUE}, the algorithm displays detailed
67 80
     information and progress messages.}
68 81
   \item{help}{if \code{TRUE}, information about algorithm-specific
... ...
@@ -86,22 +99,24 @@
86 99
 
87 100
   Note that the input sequences may be reordered by the multiple
88 101
   sequence alignment algorithms in order to group together similar
89
-  sequences. Therefore, it is necessary to assign names to input
90
-  sequences in case the user wants to preserve a one-to-one assignment
91
-  between input sequences and the sequences in the multiple sequence
92
-  alignment. That is why all algorithms check input sequences for
93
-  unique names and issue warnings if the input sequences are unnamed or
94
-  if the names are not unique.
95
-  As noted in the description of the \code{inputSeqs} argument above,
96
-  all functions, \code{msa()}, \code{\link{msaClustalW}},
97
-  \code{\link{msaClustalOmega}}, and \code{\link{msaMuscle}}, also allow
102
+  sequences (see also description of argument \code{order} above).
103
+  So, if the input order should be preserved or if the input order
104
+  should be recovered later, we strongly recommend to always assign
105
+  unique names to the input sequences. As noted in the description
106
+  of the \code{inputSeqs} argument above, all functions, \code{msa()},
107
+  \code{\link{msaClustalW}}, \code{\link{msaClustalOmega}}, and
108
+  \code{\link{msaMuscle}}, also allow
98 109
   for direct reading from FASTA files. This is mainly for the reason of
99 110
   memory efficiency if the sequence data set is very large. Otherwise,
100 111
   we want to encourage users to first read the sequences into the R
101
-  workspace. In any case, if sequences are read from a FASTA file
102
-  directly, this is completely under the control of the respective
112
+  workspace. If sequences are read from a FASTA file
113
+  directly, the order of output sequences is completely under
114
+  the control of the respective
103 115
   algorithm and does not allow for checking whether the sequences are
104
-  named uniquely in the FASTA file.
116
+  named uniquely in the FASTA file. The preservation of the input order
117
+  works also for sequence data read from a FASTA file, but only for
118
+  ClustalW and ClustalOmega; MUSCLE does not support this (see also
119
+  argument \code{order} above and \code{\link{msaMuscle}}).
105 120
 }
106 121
 \value{
107 122
    Depending on the type of sequences for which it was called,
... ...
@@ -164,10 +179,12 @@ mySeqs <- readAAStringSet(filepath)
164 179
 msa(mySeqs)
165 180
 
166 181
 ## call ClustalOmega through unified interface
167
-msa(mySeqs, method="ClustalOmega", cluster=120, gapOpening=-3,
168
-    gapExtension=-1, maxGuidetreeIterations=20, outFmt="clustal",
169
-    outputOrder="input-order", substitutionMatrix="blosum30",
170
-    type="protein", verbose=FALSE)
182
+msa(mySeqs, method="ClustalOmega")
183
+
184
+## call MUSCLE through unified interface with some custom parameters
185
+msa(mySeqs, method="Muscle", gapOpening=12, gapExtension=3, maxiters=16,
186
+    cluster="upgmamax", SUEFF=0.4, brenner=FALSE,
187
+    order="input", verbose=FALSE)
171 188
 }
172 189
 \keyword{manip}
173 190
 
... ...
@@ -9,38 +9,36 @@
9 9
     msaClustalOmega(inputSeqs, cluster="default",
10 10
                     gapOpening="default", gapExtension="default",
11 11
                     maxiters="default",  substitutionMatrix="default",
12
-                    type="default", verbose=FALSE, help=FALSE,
13
-                    ...) 
12
+                    type="default", order=c("aligned", "input"),
13
+                    verbose=FALSE, help=FALSE, ...) 
14 14
 }
15 15
 \arguments{
16 16
   \item{inputSeqs}{input sequences; see \code{\link{msa}}.
17 17
     In the original ClustalOmega implementation, this
18
-    parameter is called \code{-infile}.}
18
+    parameter is called \code{infile}.}
19 19
   \item{cluster}{The cluster size which should be used. The default is 100.  
20 20
     In the original ClustalOmega implementation, this parameter is called 
21
-    \code{--cluster-size}.}
22
-  \item{gapOpening}{gap opening penalty; the default value is -6.0.
23
-    In order to standardize interfaces,
24
-    all algorithms consistently use negative values for the gap open
25
-    penalty. This parameter is a new feature - the original ClustalOmega
26
-    implementation does not allow for customizing gap penalties.}
27
-  \item{gapExtension}{gap extension penalty; the default value is -1.0.
28
-    In order to standardize interfaces,
29
-    all algorithms consistently use negative values for the gap open
30
-    penalty. This parameter is a new feature - the original ClustalOmega
31
-    implementation does not allow for customizing gap penalties.}
21
+    \code{cluster-size}.}
22
+  \item{gapOpening,gapExtension}{ClustalOmega currently does
23
+    not allow to adjust gap penalties; these arguments are only for
24
+    future extensions and consistency with the other algorithms
25
+    and \code{\link{msa}}. However, setting these parameters to values
26
+    other than \code{"default"} will result in a warning.}
32 27
   \item{maxiters}{maximum number of iterations; the default value is 0
33 28
     (no limitation). In the original ClustalOmega implementation, this
34
-    parameter is called \code{--iterations}.}
29
+    parameter is called \code{iterations}.}
35 30
   \item{substitutionMatrix}{substitution matrix for scoring matches and
36 31
     mismatches; can be a real matrix, a file name, or the name of a
37 32
     built-in substitution matrix. In the latter case, the choices
38
-    \code{"blosum30"}, \code{"blosum40"}, \code{"blosum50"},
39
-    \code{"blosum65"}, \code{"blosum80"}, and \code{"gonnet"} are
33
+    \code{"BLOSUM30"}, \code{"BLOSUM40"}, \code{"BLOSUM50"},
34
+    \code{"BLOSUM65"}, \code{"BLOSUM80"}, and \code{"Gonnet"} are
40 35
     supported.  This parameter is a new feature - the original ClustalOmega
41 36
     implementation does not allow for using a custom substitution matrix.}
42 37
   \item{type}{type of the input sequences \code{inputSeqs};
43 38
     see \code{\link{msa}}.}
39
+  \item{order}{how the sequences should be ordered in the output object
40
+    (see \code{\link{msa}}); in the original ClustalW implementation, this
41
+    parameter is called \code{output-order}.}
44 42
   \item{verbose}{if \code{TRUE}, the algorithm displays detailed
45 43
     information and progress messages.}
46 44
   \item{help}{if \code{TRUE}, information about algorithm-specific
... ...
@@ -102,8 +100,7 @@ mySeqs <- readAAStringSet(filepath)
102 100
 msaClustalOmega(mySeqs)
103 101
 
104 102
 ## call msaClustalOmega with custom parameters
105
-msaClustalOmega(mySeqs, gapOpening=-6, gapExtension=-1, auto=FALSE,
106
-                cluster=120, dealign=FALSE, useKimura=FALSE,
107
-                verbose=FALSE)
103
+msaClustalOmega(mySeqs, auto=FALSE, cluster=120, dealign=FALSE,
104
+                useKimura=FALSE, order="input", verbose=FALSE)
108 105
 }
109 106
 \keyword{manip}
... ...
@@ -9,31 +9,26 @@
9 9
     msaClustalW(inputSeqs, cluster="default", gapOpening="default", 
10 10
                 gapExtension="default", maxiters="default", 
11 11
                 substitutionMatrix="default", type="default", 
12
-                verbose=FALSE, help=FALSE, ...)
12
+                order=c("aligned", "input"), verbose=FALSE,
13
+                help=FALSE, ...)
13 14
 }
14 15
 \arguments{
15 16
   \item{inputSeqs}{input sequences; see \code{\link{msa}}.
16 17
     In the original ClustalW implementation, this
17
-    parameter is called \code{-infile}.}
18
+    parameter is called \code{infile}.}
18 19
   \item{cluster}{The clustering method which should be used.
19 20
     Possible values are \code{"nj"} (default) and \code{"upgma"}.
20 21
     In the original ClustalW implementation, this parameter is called 
21
-    \code{-clustering}.}
22
+    \code{clustering}.}
22 23
   \item{gapOpening}{gap opening penalty; the default value for
23
-    nucleotide sequences is -15.0, the default value for 
24
-    amino acid sequences is -10.0. In order to standardize interfaces,
25
-    all algorithms consistently use negative values for the gap open
26
-    penalty. In the original ClustalW implementation, this parameter is
27
-    called \code{-gapOpen}.}
24
+    nucleotide sequences is 15.0, the default value for 
25
+    amino acid sequences is 10.0.}
28 26
   \item{gapExtension}{gap extension penalty; the default value for
29
-    nucleotide sequences is -6.66, the default value for 
30
-    amino acid sequences is -0.2. In order to standardize interfaces,
31
-    all algorithms consistently use negative values for the gap extension
32
-    penalty. In the original ClustalW implementation, this parameter is
33
-    called \code{-gapExt}.}
27
+    nucleotide sequences is 6.66, the default value for 
28
+    amino acid sequences is 0.2.}
34 29
   \item{maxiters}{maximum number of iterations; the default value is 16.
35 30
     In the original ClustalW implementation, this parameter is called
36
-    \code{-numiters}.}
31
+    \code{numiters}.}
37 32
   \item{substitutionMatrix}{substitution matrix for scoring matches and
38 33
     mismatches; can be a real matrix, a file name, or the name of a
39 34
     built-in substitution matrix. In the latter case, the choices
... ...
@@ -42,9 +37,12 @@
42 37
     sequences, the parameter \code{dnamatrix} must be used instead.
43 38
     The valid choices for this parameter are \code{"iub"} and
44 39
     \code{"clustalw"}. In the original ClustalW implementation, this
45
-    parameter is called \code{-matrix}.}
40
+    parameter is called \code{matrix}.}
46 41
   \item{type}{type of the input sequences \code{inputSeqs};
47 42
     see \code{\link{msa}}.}
43
+  \item{order}{how the sequences should be ordered in the output object
44
+    (see \code{\link{msa}}); in the original ClustalW implementation, this
45
+    parameter is called \code{outorder}.}
48 46
   \item{verbose}{if \code{TRUE}, the algorithm displays detailed
49 47
     information and progress messages.}
50 48
   \item{help}{if \code{TRUE}, information about algorithm-specific
... ...
@@ -105,7 +103,7 @@ mySeqs <- readAAStringSet(filepath)
105 103
 msaClustalW(mySeqs)
106 104
 
107 105
 ## call msaClustalW with custom parameters
108
-msaClustalW(mySeqs, gapOpening=-1, gapExtension=-1, maxiters=16,
109
-            type="protein", cluster="upgma", kimura=FALSE, maxdiv=23)
106
+msaClustalW(mySeqs, gapOpening=1, gapExtension=1, maxiters=16,
107
+            cluster="upgma", kimura=FALSE, order="input", maxdiv=23)
110 108
 }
111 109
 \keyword{manip}
... ...
@@ -8,7 +8,8 @@
8 8
 \usage{
9 9
     msaMuscle(inputSeqs, cluster="default", gapOpening="default",
10 10
               gapExtension="default", maxiters="default",
11
-              substitutionMatrix="default", type="default",
11
+              substitutionMatrix="default",
12
+              type="default", order=c("aligned", "input"),
12 13
               verbose=FALSE, help=FALSE, ...)
13 14
 }
14 15
 \arguments{
... ...
@@ -19,16 +20,12 @@
19 20
     Possible values are \code{"upgma"}, \code{"upgmamax"},
20 21
     \code{"upgmamin"}, \code{"upgmb"}, and \code{"neighborjoining"}.}
21 22
   \item{gapOpening}{gap opening penalty; the default 
22
-    is -400 for DNA sequences and -420 for RNA sequences. The default
23
+    is 400 for DNA sequences and 420 for RNA sequences. The default
23 24
     for amino acid sequences depends on the profile score settings:
24
-    for the setting \code{le=TRUE}, the default is -2.9, for
25
-    \code{sp=TRUE}, the default is -1,439, and for \code{sv=TRUE},
26
-    the default is -300. In order to standardize interfaces,
27
-    all algorithms consistently use negative values for the gap opening
28
-    penalty.}
29
-  \item{gapExtension}{gap extension penalty; the default is 0.
30
-    In order to standardize interfaces, all algorithms consistently
31
-    use negative values for the gap extension penalty.}
25
+    for the setting \code{le=TRUE}, the default is 2.9, for
26
+    \code{sp=TRUE}, the default is 1,439, and for \code{sv=TRUE},
27
+    the default is 300.}
28
+  \item{gapExtension}{gap extension penalty; the default is 0.}
32 29
   \item{maxiters}{maximum number of iterations; the default is 16.
33 30
     In the original MUSCLE implementation, it is also possible
34 31
     to set \code{maxiters} to 0 which leads to an (out of memory) error. 
... ...
@@ -41,6 +38,17 @@
41 38
     this format is not supported by \code{msaMuscle}.}
42 39
   \item{type}{type of the input sequences \code{inputSeqs};
43 40
     see \code{\link{msa}}.}
41
+  \item{order}{how the sequences should be ordered in the output object
42
+    (see \code{\link{msa}} for more details); the original MUSCLE
43
+    implementation does not allow for preserving the order of input
44
+    sequences. The \code{msaMuscle} function realizes this functionality
45
+    by reverse matching of sequence names. Therefore, the sequences
46
+    need to have unique names. If the sequences do not have
47
+    names or if the names are not unique, the \code{\link{msaMuscle}}
48
+    function assignes generic unique names \code{"Seq1"}-\code{Seqn}
49
+    to the sequences and issues a warning. The choice \code{"input"}
50
+    is not available at all for sequence data that is
51
+    read directly from a FASTA file.}
44 52
   \item{verbose}{if \code{TRUE}, the algorithm displays detailed
45 53
     information and progress messages.}
46 54
   \item{help}{if \code{TRUE}, information about algorithm-specific
... ...
@@ -104,8 +112,8 @@ mySeqs <- readAAStringSet(filepath)
104 112
 msaMuscle(mySeqs)
105 113
 
106 114
 ## call msaMuscle with custom parameters
107
-msaMuscle(mySeqs, gapOpening=-12, gapExtension=-3, maxiters=16,
108
-          type="protein", cluster="upgmamax", SUEFF=0.4,
109
-          brenner=FALSE, verbose=FALSE)
115
+msaMuscle(mySeqs, gapOpening=12, gapExtension=3, maxiters=16,
116
+          cluster="upgmamax", SUEFF=0.4, brenner=FALSE,
117
+          order="input", verbose=FALSE)
110 118
 }
111 119
 \keyword{manip}
... ...
@@ -1,9 +1,9 @@
1
-OS := $(shell uname)
2
-ifeq ($(OS), Darwin)
3
-	CONFIGURE_FLAGS='--without-openmp'
4
-else 
5
-	CONFIGURE_FLAGS=''
6
-endif
1
+## Variant 1: deactivate OpenMP on Mac Platforms
2
+CONFIGURE_FLAGS=`Rscript -e "if (Sys.info()['sysname'] == 'Darwin') cat('--without-openmp')"`
3
+## Variant 2: deactivate OpenMP generally
4
+#CONFIGURE_FLAGS=--without-openmp 
5
+## Variant 3: let the configure script determine whether OpenMP is available
6
+#CONFIGURE_FLAGS=
7 7
 
8 8
 CPPNames=\
9 9
 exceptions4c/e4c_lite.c \
... ...
@@ -43,7 +43,7 @@ all: clustalomega
43 43
 
44 44
 clustalomega:
45 45
 	./configure $(CONFIGURE_FLAGS); \
46
-	export PKG_LIBS="$(PKG_LIBS) $(SHLIB_OPENMP_CFLAGS) `Rscript -e "Rcpp:::LdFlags()"`"; \
46
+	export PKG_LIBS="$(PKG_LIBS) $(SHLIB_OPENMP_CFLAGS)"; \
47 47
 	export PKG_CXXFLAGS="$(PKG_CXXFLAGS) $(SHLIB_OPENMP_CXXFLAGS) -fPIC -DHAVE_CONFIG_H -I. -DCLUSTALO -DCLUSTALO_NOFILE -DDEFAULT_FILTER=90 -I"../../gc-7.2/include" `Rscript -e "Rcpp:::CxxFlags()"`"; \
48 48
 	export PKG_CFLAGS="$(PKG_CFLAGS) $(SHLIB_OPENMP_CFLAGS) -fPIC -DHAVE_CONFIG_H -I. -DCLUSTALO -DCLUSTALO_NOFILE -DDEFAULT_FILTER=90 -I"../../gc-7.2/include" `Rscript -e "Rcpp:::CxxFlags()"`"; \
49 49
 	cd src; \
... ...
@@ -37,10 +37,10 @@ all: clustalomega
37 37
 clustalomega:
38 38
 	cp windows/src/config.h src/; \
39 39
 	cp windows/src/clustal-omega-config.h src/; \
40
-	export PKG_LIBS="$(PKG_LIBS) -L"../../gc-7.2" -lgccpp72 -lgc72 `${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe -e "Rcpp:::LdFlags()"`"; \
40
+	export PKG_LIBS="$(PKG_LIBS) -L"../../gc-7.2" -lgccpp72 -lgc72"; \
41 41
 	export PKG_CXXFLAGS="$(PKG_CXXFLAGS) -DHAVE_CONFIG_H -I. -DCLUSTALO -DCLUSTALO_NOFILE -DDEFAULT_FILTER=90 -I"../../gc-7.2/include" `${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe -e "Rcpp:::CxxFlags()"`"; \
42 42
 	export PKG_CFLAGS="$(PKG_CFLAGS) -DHAVE_CONFIG_H -I. -DCLUSTALO -DCLUSTALO_NOFILE -DDEFAULT_FILTER=90 -I"../../gc-7.2/include" -lgccpp -lgc `${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe -e "Rcpp:::CxxFlags()"`"; \
43 43
 	cd src; \
44
-	${R_HOME}/bin${R_ARCH_BIN}/R.exe CMD SHLIB -o ClustalOmega.dll $(CPPNames); \
45
-	$(AR) rcs libClustalOmega.a $(OBJNames); \
44
+	${R_HOME}/bin${R_ARCH_BIN}/R.exe CMD SHLIB -o ClustalOmega.dll $(CPPNames) && \
45
+	$(AR) rcs libClustalOmega.a $(OBJNames) && \
46 46
 	cp libClustalOmega.a ../../
... ...
@@ -182,7 +182,6 @@ SEXP RClustalOmega(SEXP rInputSeqs,
182 182
             msaInput.seqLength = seqLength;
183 183
             msaInput.seqNames = seqNames;
184 184
             //hardcoded value, if sequence is an R sequence
185
-            //appendString(&argv, argc, "R");
186 185
             appendString(&argv, argc, "--R");
187 186
         }
188 187
         appendString(&argv, argc, "-o");
... ...
@@ -243,6 +242,10 @@ SEXP RClustalOmega(SEXP rInputSeqs,
243 242
 			appendStringValue(&argv, argc, "--distmat-out",
244 243
 					getListElement(rParams, "distMatOut"));
245 244
         }
245
+        if (hasClustalOmegaEntry(rParams, "outputOrder")) {
246
+			appendStringValue(&argv, argc, "--output-order",
247
+					getListElement(rParams, "outputOrder"));
248
+        }
246 249
         if (hasClustalOmegaEntry(rParams, "guideTreeIn")) {
247 250
 			appendStringValue(&argv, argc, "--guidetree-in",
248 251
 					getListElement(rParams, "guideTreeIn"));
... ...
@@ -244,7 +244,7 @@
244 244
 
245 245
 /* The size of `fpos_t', as computed by sizeof. */
246 246
 #ifndef CLUSTAL_OMEGA_SIZEOF_FPOS_T
247
-#define CLUSTAL_OMEGA_SIZEOF_FPOS_T 16
247
+#define CLUSTAL_OMEGA_SIZEOF_FPOS_T 12
248 248
 #endif
249 249
 
250 250
 /* The size of `unsigned int', as computed by sizeof. */
... ...
@@ -254,7 +254,7 @@
254 254
 
255 255
 /* The size of `unsigned long', as computed by sizeof. */
256 256
 #ifndef CLUSTAL_OMEGA_SIZEOF_UNSIGNED_LONG
257
-#define CLUSTAL_OMEGA_SIZEOF_UNSIGNED_LONG 8
257
+#define CLUSTAL_OMEGA_SIZEOF_UNSIGNED_LONG 4
258 258
 #endif
259 259
 
260 260
 /* The size of `unsigned long long', as computed by sizeof. */
... ...
@@ -1094,8 +1094,10 @@ HHalignWrapper(mseq_t *prMSeq, int *piOrderLR,
1094 1094
                 CKFREE(pcReprsnt2);
1095 1095
                 CKFREE(pcConsens2);
1096 1096
             }
1097
-            ppiLeafList[iL] = CKFREE(ppiLeafList[iL]);
1098
-            ppiLeafList[iR] = CKFREE(ppiLeafList[iR]);
1097
+            CKFREE(ppiLeafList[iL]);
1098
+            ppiLeafList[iL] = NULL;
1099
+            CKFREE(ppiLeafList[iR]);
1100
+            ppiLeafList[iR] = NULL;
1099 1101
             piLeafCount[iL] = piLeafCount[iR] = 0;
1100 1102
             
1101 1103
         } /* was a merge node */
... ...
@@ -940,7 +940,9 @@ FreeRSeq(mseq_t **mseq, bool bRSequence)
940 940
     }
941 941
         
942 942
 	if ((*mseq)->filename && !bRSequence) {
943
-        (*mseq)->filename = CKFREE((*mseq)->filename);
943
+        //(*mseq)->filename = CKFREE((*mseq)->filename);
944
+		CKFREE((*mseq)->filename);
945
+		(*mseq)->filename = NULL;
944 946
     }
945 947
 
946 948
     for (i=0; i<(*mseq)->nseqs; i++) {
... ...
@@ -134,7 +134,7 @@ ReadSequences(mseq_t *prMSeq_p, char *pcSeqFile,
134 134
               int iMaxNumSeq, int iMaxSeqLen);
135 135
 
136 136
 extern int
137
-ReadSequencesFrom(mseq_t *prMSeq_p, int seqLength, char **seq, char **seqNames,
137
+ReadSequencesFromR(mseq_t *prMSeq_p, int seqLength, char **seq, char **seqNames,
138 138
               int iSeqType,  int iSeqFmt, bool bIsProfile,
139 139
               int iMaxNumSeq, int iMaxSeqLen);
140 140
 
... ...
@@ -918,11 +918,10 @@ hhalign(char **ppcFirstProf, int iFirstCnt, double *pdWeightsL,
918 918
         par.gapg = par.gapgV;
919 919
         par.gaph = par.gaphV;
920 920
         par.gapi = par.gapiV;
921
-
922
-        par.gapExtension = rHhalignPara.gapExtension;
923
-        par.gapOpening   = rHhalignPara.gapOpening;
924
-
925 921
     }
922
+
923
+    par.gapExtension = rHhalignPara.gapExtension;
924
+    par.gapOpening   = rHhalignPara.gapOpening;
926 925
     
927 926
     // Read input file (HMM, HHM, or alignment format), and add pseudocounts etc.
928 927
     q.cQT = 'q';
... ...
@@ -77,15 +77,15 @@ Alignment::Alignment(int maxseq, int maxres)
77 77
 
78 78
     //printf(">>>>>>>>%s:%s:%d: maxseq=%d, maxres=%d\n", __FUNCTION__, __FILE__, __LINE__, maxseq, maxres); /* (FS) */
79 79
   longname = new(char[DESCLEN]);
80
-  sname = new(char*[maxseq+2]); /* MR1 */
81
-  seq = new(char*[maxseq+2]); /* MR1 */
82
-  l = new(int[maxres]);
83
-  X = new(char*[maxseq+2]);  /* MR1 */
84
-  I = new(short unsigned int*[maxseq+2]); /* MR1 */
85
-  keep = new(char[maxseq+2]); /* MR1 */
86
-  display = new(char[maxseq+2]); /* MR1 */
87
-  wg = new(float[maxseq+2]); /* MR1 */
88
-  nseqs = new(int[maxres+2]); /* MR1 */
80
+  sname = new char*[maxseq+2]; /* MR1 */
81
+  seq = new char*[maxseq+2]; /* MR1 */
82
+  l = new int[maxres];
83
+  X = new char*[maxseq+2];  /* MR1 */
84
+  I = new short unsigned int*[maxseq+2]; /* MR1 */
85
+  keep = new char[maxseq+2]; /* MR1 */
86
+  display = new char[maxseq+2]; /* MR1 */
87
+  wg = new float[maxseq+2]; /* MR1 */
88
+  nseqs = new int[maxres+2]; /* MR1 */
89 89
   N_in=L=0;
90 90
   nres=NULL; // number of residues per sequence k
91 91
   first=NULL; // first residue in sequence k
... ...
@@ -138,7 +138,7 @@ Alignment::Read(FILE* inf, char infile[], char* firstline)
138 138
   int k; // Index of sequence being read currently (first=0)
139 139
   char line[LINELEN]=""; // input line
140 140
   //char cur_seq[MAXCOL]; // Sequence currently read in
141
-  char *cur_seq=new(char[par.maxColCnt]);
141
+  char *cur_seq=new char[par.maxColCnt];
142 142
   char* cur_name; // Sequence currently read in
143 143
   int linenr=0; // current line number in input file
144 144
   char skip_sequence=0;
... ...
@@ -180,11 +180,11 @@ Alignment::Read(FILE* inf, char infile[], char* firstline)
180 180
                               }
181 181
 
182 182
                           // Create space for residues and paste new sequence in
183
-                          seq[k]=new(char[strlen(cur_seq)+2]);
183
+                          seq[k]=new char[strlen(cur_seq)+2];
184 184
                           if (!seq[k]) MemoryError("array for input sequences");
185
-                          X[k]=new(char[strlen(cur_seq)+2]);
185
+                          X[k]=new char[strlen(cur_seq)+2];
186 186
                           if (!X[k]) MemoryError("array for input sequences");
187
-                          I[k]=new(short unsigned int[strlen(cur_seq)+2]);
187
+                          I[k]=new short unsigned int[strlen(cur_seq)+2];
188 188
                           if (!I[k]) MemoryError("array for input sequences");
189 189
                           strcpy(seq[k],cur_seq);
190 190
                       }
... ...
@@ -233,7 +233,7 @@ Alignment::Read(FILE* inf, char infile[], char* firstline)
233 233
 
234 234
                   // store sequence name
235 235
                   if (v>=4) printf("Reading seq %-16.16s k=%3i n_displ=%3i display[k]=%i keep[k]=%i\n",cur_name,k,n_display,display[k],keep[k]);
236
-                  sname[k] = new(char[strlen(cur_name)+1]);
236
+                  sname[k] = new char[strlen(cur_name)+1];
237 237
                   if (!sname[k]) {MemoryError("array for sequence names");}
238 238
                   strcpy(sname[k],cur_name);
239 239
               } // end if(line contains sequence name)
... ...
@@ -348,11 +348,11 @@ Alignment::Read(FILE* inf, char infile[], char* firstline)
348 348
 
349 349
   if (k>=0) //if at least one sequence was read in
350 350
       {
351
-          seq[k]=new(char[strlen(cur_seq)+2]);
351
+          seq[k]=new char[strlen(cur_seq)+2];
352 352
           if (!seq[k]) MemoryError("array for input sequences");
353
-          X[k]=new(char[strlen(cur_seq)+2]);
353
+          X[k]=new char[strlen(cur_seq)+2];
354 354
           if (!X[k]) MemoryError("array for input sequences");
355
-          I[k]=new(short unsigned int[strlen(cur_seq)+2]);
355
+          I[k]=new short unsigned int[strlen(cur_seq)+2];
356 356
           if (!I[k]) MemoryError("array for input sequences");
357 357
           strcpy(seq[k],cur_seq);
358 358
       }
... ...
@@ -420,7 +420,7 @@ Alignment::Compress(const char infile[])
420 420
     /*static short unsigned int h[MAXSEQ];*/
421 421
     /*short*/ unsigned int *h = NULL; /* short may lead to overflow for long alignments, FS, r235 -> r236 */
422 422
 
423
-    h = new(/*short*/ unsigned int[N_in+2]); /* short -> overflow, FS, r235 -> r236 */
423
+    h = new /*short*/ unsigned int[N_in+2]; /* short -> overflow, FS, r235 -> r236 */
424 424
     float *percent_gaps = NULL; /* FS, 2010-Nov */
425 425
     char *match_state = NULL;  /* FS, 2010-Nov */
426 426
 
... ...
@@ -552,13 +552,13 @@ Alignment::Compress(const char infile[])
552 552
                had to move declaration of float *percent_gaps out of switch()
553 553
             */
554 554
             //float percent_gaps[MAXCOL]; //percentage of gaps in column k (with weighted sequences)
555
-            percent_gaps = new(float[par.maxColCnt]);
555
+            percent_gaps = new float[par.maxColCnt];
556 556
 
557 557
             //determine number of columns L in alignment
558 558
             L=strlen(seq[kfirst])-1;
559 559
 
560 560
             // Conversion to integer representation, checking for unequal lengths and initialization
561
-            if (nres==NULL) nres=new(int[N_in]);
561
+            if (nres==NULL) nres=new int[N_in];
562 562
             for (k=0; k<N_in; k++)
563 563
                 {
564 564
                     if (!keep[k]) continue;
... ...
@@ -780,7 +780,7 @@ Alignment::Compress(const char infile[])
780 780
                had to move declaration of float *percent_gaps out of switch()
781 781
             */
782 782
             //char match_state[MAXCOL]; //1: column assigned to match state 0: insert state
783
-            match_state = new(char[par.maxColCnt]);
783
+            match_state = new char[par.maxColCnt];
784 784
 
785 785
             // Determine number of columns L in alignment
786 786
             L=strlen(seq[0]+1);
... ...
@@ -942,7 +942,7 @@ Alignment::FilterForDisplay(int max_seqid, int coverage, int qid, float qsc, int
942 942
 
943 943
 
944 944
     if (par.mark) return n_display;
945
-    char *dummy = new(char[N_in+1]);
945
+    char *dummy = new char[N_in+1];
946 946
     int vtmp=v, seqid;
947 947
     v=0;
948 948
     n_display=0;
... ...
@@ -1005,12 +1005,12 @@ Alignment::Filter2(char keep[], int coverage, int qid, float qsc, int seqid1, in
1005 1005
 {
1006 1006
     // In the beginnning, keep[k] is 1 for all regular amino acid sequences and 0 for all others (ss_conf, ss_pred,...)
1007 1007
     // In the end, keep[k] will be 1 for all regular representative sequences kept in the alignment, 0 for all others
1008
-    char* in=new(char[N_in+1]); // in[k]=1: seq k has been accepted; in[k]=0: seq k has not yet been accepted at current seqid
1009
-    char* inkk=new(char[N_in+1]); // inkk[k]=1 iff in[ksort[k]]=1 else 0;
1010
-    int* Nmax=new(int[L+2]); // position-dependent maximum-sequence-identity threshold for filtering /* MR1, used to be called idmax*/
1011
-    int* idmaxwin=new(int[L+2]); // minimum value of idmax[i-WFIL,i+WFIL]
1012
-    int* seqid_prev=new(int[N_in+1]); // maximum-sequence-identity threshold used in previous round of filtering (with lower seqid)
1013
-    int* N=new(int[L+2]); // N[i] number of already accepted sequences at position i
1008
+    char* in=new char[N_in+1]; // in[k]=1: seq k has been accepted; in[k]=0: seq k has not yet been accepted at current seqid
1009
+    char* inkk=new char[N_in+1]; // inkk[k]=1 iff in[ksort[k]]=1 else 0;
1010
+    int* Nmax=new int[L+2]; // position-dependent maximum-sequence-identity threshold for filtering /* MR1, used to be called idmax*/
1011
+    int* idmaxwin=new int[L+2]; // minimum value of idmax[i-WFIL,i+WFIL]
1012
+    int* seqid_prev=new int[N_in+1]; // maximum-sequence-identity threshold used in previous round of filtering (with lower seqid)
1013
+    int* N=new int[L+2]; // N[i] number of already accepted sequences at position i
1014 1014
     const int WFIL=25; // see previous line
1015 1015
 
1016 1016
     int diffNmax=Ndiff;       // current  maximum difference of Nmax[i] and Ndiff /* MR1 */
... ...
@@ -1039,8 +1039,8 @@ Alignment::Filter2(char keep[], int coverage, int qid, float qsc, int seqid1, in
1039 1039
     // Determine first[k], last[k]?
1040 1040
     if (first==NULL)
1041 1041
         {
1042
-            first=new(int[N_in]);// first non-gap position in sequence k
1043
-            last =new(int[N_in]);// last  non-gap position in sequence k
1042
+            first=new int[N_in];// first non-gap position in sequence k
1043
+            last =new int[N_in];// last  non-gap position in sequence k
1044 1044
             for (k=0; k<N_in; k++) // do this for ALL sequences, not only those with in[k]==1 (since in[k] may be display[k])
1045 1045
                 {
1046 1046
                     for (i=1; i<=L; i++) if (X[k][i]<NAA) break;
... ...
@@ -1054,7 +1054,7 @@ Alignment::Filter2(char keep[], int coverage, int qid, float qsc, int seqid1, in
1054 1054
     if ( (nres==NULL)  || (sizeof(nres)<N_in*sizeof(int)) )
1055 1055
         {
1056 1056
     	 if (nres) delete[] nres;
1057
-    		nres=new(int[N_in]);
1057
+    		nres=new int[N_in];
1058 1058
             for (k=0; k<N_in; k++) // do this for ALL sequences, not only those with in[k]==1 (since in[k] may be display[k])
1059 1059
                 {
1060 1060
                     int nr=0;
... ...
@@ -1068,7 +1068,7 @@ Alignment::Filter2(char keep[], int coverage, int qid, float qsc, int seqid1, in
1068 1068
     // Sort sequences according to length; afterwards, nres[ksort[kk]] is sorted by size
1069 1069
     if (ksort==NULL)
1070 1070
         {
1071
-            ksort=new(int[N_in]); // never reuse alignment object for new alignment with more sequences
1071
+            ksort=new int[N_in]; // never reuse alignment object for new alignment with more sequences
1072 1072
             for (k=0; k<N_in; k++) ksort[k]=k;
1073 1073
             QSortInt(nres,ksort,kfirst+1,N_in-1,-1); //Sort sequences after kfirst (query) in descending order
1074 1074
         }
... ...
@@ -1311,7 +1311,7 @@ Alignment::HomologyFilter(int coverage_core, float qsc_core, float coresc)
1311 1311
     const int Ndiff_core=0;
1312 1312
     int n;
1313 1313
     HMM qcore;
1314
-    char* coreseq=new(char[N_in]); // coreseq[k]=1 if sequence belongs to core of alignment (i.e. it is very similar to query)
1314
+    char* coreseq=new char[N_in]; // coreseq[k]=1 if sequence belongs to core of alignment (i.e. it is very similar to query)
1315 1315
     for (int k=0; k<N_in; k++) coreseq[k]=keep[k]; // Copy keep[] into coreseq[]
1316 1316
 
1317 1317
     // Remove sequences with seq. identity larger than seqid percent (remove the shorter of two)
... ...
@@ -1362,7 +1362,7 @@ Alignment::FilterWithCoreHMM(char in[], float coresc, HMM& qcore)
1362 1362
     int i; // column in query alignment
1363 1363
     int a; // amino acid (0..19)
1364 1364
     int n=1; // number of sequences that passed filter
1365
-    float** logodds=new(float*[L+1]); // log-odds ratios for HMM qcore
1365
+    float** logodds=new float*[L+1]; // log-odds ratios for HMM qcore
1366 1366
     char gap; // 1: previous state in seq k was a gap 0: previous state in seq k was an amino acid
1367 1367
     float score; // score of sequence k aligned with qcore
1368 1368
 
... ...
@@ -1371,8 +1371,8 @@ Alignment::FilterWithCoreHMM(char in[], float coresc, HMM& qcore)
1371 1371
     // Determine first[k], last[k]?
1372 1372
     if (first==NULL)
1373 1373
         {
1374
-            first=new(int[N_in]);// first non-gap position in sequence k
1375
-            last =new(int[N_in]);// last non-gap position in sequence k
1374
+            first=new int[N_in];// first non-gap position in sequence k
1375
+            last =new int[N_in];// last non-gap position in sequence k
1376 1376
             for (k=0; k<N_in; k++) // do this for ALL sequences, not only those with in[k]==1 (since in[k] may be display[k])
1377 1377
                 {
1378 1378
                     for (i=1; i<=L; i++) if (X[k][i]<NAA) break;
... ...
@@ -1385,7 +1385,7 @@ Alignment::FilterWithCoreHMM(char in[], float coresc, HMM& qcore)
1385 1385
     // Determine number of residues nres[k]?
1386 1386
     if (nres==NULL)
1387 1387
         {
1388
-            nres=new(int[N_in]);
1388
+            nres=new int[N_in];
1389 1389
             for (k=0; k<N_in; k++) // do this for ALL sequences, not only those with in[k]==1 (since in[k] may be display[k])
1390 1390
                 {
1391 1391
                     int nr=0;
... ...
@@ -1667,18 +1667,18 @@ Alignment::FrequenciesAndTransitions(HMM& q, char* in)
1667 1667
                     q.sname[q.ncons]=new(char[10]);
1668 1668
                     if (!q.sname[q.ncons]) {MemoryError("array of names for displayed sequences");}
1669 1669
                     strcpy(q.sname[q.ncons],"Consensus");
1670
-                    q.seq[q.ncons]=new(char[L+2]);
1670
+                    q.seq[q.ncons]=new char[L+2];
1671 1671
                     if (!q.seq[q.ncons]) {MemoryError("array of names for displayed sequences");}
1672 1672
                 }
1673 1673
             if (par.cons)
1674 1674
                 {
1675 1675
                     // Reserve space for consensus sequence as first sequence in alignment
1676 1676
                     q.nfirst=n++; kfirst=-1;
1677
-                    q.sname[q.nfirst]=new(char[strlen(name)+11]);
1677
+                    q.sname[q.nfirst]=new char[strlen(name)+11];
1678 1678
                     if (!q.sname[q.nfirst]) {MemoryError("array of names for displayed sequences");}
1679 1679
                     strcpy(q.sname[q.nfirst],name);
1680 1680
                     strcat(q.sname[q.nfirst],"_consensus");
1681
-                    q.seq[q.nfirst]=new(char[L+2]);
1681
+                    q.seq[q.nfirst]=new char[L+2];
1682 1682
                     if (!q.seq[q.nfirst]) {MemoryError("array of names for displayed sequences");}
1683 1683
                 }
1684 1684
             // Calculate consensus amino acids using similarity matrix
... ...
@@ -1736,10 +1736,10 @@ Alignment::FrequenciesAndTransitions(HMM& q, char* in)
1736 1736
                     else if (k==kfirst) nn=q.nfirst=n++;
1737 1737
                     else nn=n++;
1738 1738
                     // strcut(sname[k]," "); // delete rest of name line beginning with two spaces " " // Why this?? Problem for pdb seqs without chain
1739
-                    q.sname[nn]=new(char[strlen(sname[k])+1]);
1739
+                    q.sname[nn]=new char[strlen(sname[k])+1];
1740 1740
                     if (!q.sname[nn]) {MemoryError("array of names for displayed sequences");}
1741 1741
                     strcpy(q.sname[nn],sname[k]);
1742
-                    q.seq[nn]=new(char[strlen(seq[k])+1]);
1742
+                    q.seq[nn]=new char[strlen(seq[k])+1];
1743 1743
                     if (!q.seq[nn]) {MemoryError("array of names for displayed sequences");}
1744 1744
                     strcpy(q.seq[nn],seq[k]);
1745 1745
                 }
... ...
@@ -1826,14 +1826,14 @@ Alignment::Amino_acid_frequencies_and_transitions_from_M_state(HMM& q, char* in)
1826 1826
   //float wi[MAXSEQ]; // weight of sequence k in column i, calculated from subalignment i
1827 1827
   float *wi=NULL; // weight of sequence k in column i, calculated from subalignment i
1828 1828
   //float Neff[MAXRES]; // diversity of subalignment i
1829
-  float *Neff = new(float[par.maxResLen]); // diversity of subalignment i
1829
+  float *Neff = new float[par.maxResLen]; // diversity of subalignment i
1830 1830
   int nseqi=0; // number of sequences in subalignment i
1831 1831
   int ncol=0; // number of columns j that contribute to Neff[i]
1832 1832
   char change; // has the set of sequences in subalignment changed? 0:no 1:yes
1833 1833
   float fj[NAA+3]; // to calculate entropy
1834 1834
   float sum;
1835 1835
 
1836
-  wi = new(float[N_in+2]);
1836
+  wi = new float[N_in+2];
1837 1837
 
1838 1838
   // Global weights?
1839 1839
   if (par.wg==1)
... ...
@@ -1842,7 +1842,7 @@ Alignment::Amino_acid_frequencies_and_transitions_from_M_state(HMM& q, char* in)
1842 1842
   // Initialization
1843 1843
   q.Neff_HMM=0.0f;
1844 1844
   Neff[0]=0.0; // if the first column has no residues (i.e. change==0), Neff[i]=Neff[i-1]=Neff[0]
1845
-  n = new(int*[L+2]);
1845
+  n = new int*[L+2];
1846 1846
   for (j=1; j<=L; j++) n[j]=new(int[NAA+3]);
1847 1847
   for (j=1; j<=L; j++)
1848 1848
     for (a=0; a<NAA+3; a++) n[j][a]=0;
... ...
@@ -2052,7 +2052,7 @@ Alignment::Transitions_from_I_state(HMM& q, char* in)
2052 2052
     //float wi[MAXSEQ]; // weight of sequence k in column i, calculated from subalignment i
2053 2053
     float *wi = NULL; // weight of sequence k in column i, calculated from subalignment i
2054 2054
     //float Neff[MAXRES]; // diversity of subalignment i
2055
-    float *Neff = new(float[par.maxResLen]); // diversity of subalignment i
2055
+    float *Neff = new float[par.maxResLen]; // diversity of subalignment i
2056 2056
     int nseqi; // number of sequences in subalignment i
2057 2057
     int ncol; // number of columns j that contribute to Neff[i]
2058 2058
     float fj[NAA+3]; // to calculate entropy
... ...
@@ -2060,7 +2060,7 @@ Alignment::Transitions_from_I_state(HMM& q, char* in)
2060 2060
     float Nlim=0.0; // only for global weights
2061 2061
     float scale=0.0; // only for global weights
2062 2062
 
2063
-    wi = new(float[N_in+2]);
2063
+    wi = new float[N_in+2];
2064 2064
 
2065 2065
     // Global weights?
2066 2066
     if (par.wg==1)
... ...
@@ -2071,7 +2071,7 @@ Alignment::Transitions_from_I_state(HMM& q, char* in)
2071 2071
         }
2072 2072
 
2073 2073
     // Initialization
2074
-    n = new(int*[L+2]);
2074
+    n = new int*[L+2];
2075 2075
     for (j=1; j<=L; j++) n[j]=new(int[NAA+3]);
2076 2076
 
2077 2077
     //////////////////////////////////////////////////////////////////////////////////////////////
... ...
@@ -2254,7 +2254,7 @@ Alignment::Transitions_from_D_state(HMM& q, char* in)
2254 2254
     //float wi[MAXSEQ]; // weight of sequence k in column i, calculated from subalignment i
2255 2255
     float *wi=NULL; // weight of sequence k in column i, calculated from subalignment i
2256 2256
     //float Neff[MAXRES]; // diversity of subalignment i 
2257
-    float *Neff = new(float[par.maxResLen]); // diversity of subalignment i 
2257
+    float *Neff = new float[par.maxResLen]; // diversity of subalignment i
2258 2258
     int nseqi=0; // number of sequences in subalignment i (for DEBUGGING)
2259 2259
     int ncol=0; // number of columns j that contribute to Neff[i]
2260 2260
     char change; // has the set of sequences in subalignment changed? 0:no 1:yes
... ...
@@ -2263,7 +2263,7 @@ Alignment::Transitions_from_D_state(HMM& q, char* in)
2263 2263
     float Nlim=0.0; // only for global weights
2264 2264
     float scale=0.0; // only for global weights
2265 2265
 
2266
-    wi = new(float[N_in+2]); /* FIXME: FS */
2266
+    wi = new float[N_in+2]; /* FIXME: FS */
2267 2267
     // Global weights?
2268 2268
     if (par.wg==1)
2269 2269
         {
... ...
@@ -2273,7 +2273,7 @@ Alignment::Transitions_from_D_state(HMM& q, char* in)
2273 2273
         }
2274 2274
 
2275 2275
     // Initialization
2276
-    n = new(int*[L+2]);
2276
+    n = new int*[L+2];
2277 2277
     for (j=1; j<=L; j++) n[j]=new(int[NAA+3]);
2278 2278
     for (j=1; j<=L; j++)
2279 2279
         for (a=0; a<NAA+3; a++) n[j][a]=0;
... ...
@@ -2544,7 +2544,7 @@ Alignment::MergeMasterSlave(Hit& hit, char ta3mfile[])
2544 2544
  N_filtered = Tali.Filter(par.max_seqid,par.coverage,par.qid,par.qsc,par.Ndiff);
2545 2545
 
2546 2546
  // Record imatch[j]
2547
- int* imatch=new(int[hit.j2+1]);
2547
+ int* imatch=new int[hit.j2+1];
2548 2548
  int step = hit.nsteps;
2549 2549
  for (j=hit.j1; j<=hit.j2; j++)
2550 2550
  {
... ...
@@ -2676,7 +2676,7 @@ Alignment::MergeMasterSlave(Hit& hit, char ta3mfile[])
2676 2676
  iprev=i; lprev=l;
2677 2677
  if (h>=maxcol-1000) // too few columns? Reserve double space
2678 2678
  {
2679
- char* new_seq=new(char[2*maxcol]);
2679
+ char* new_seq=new char[2*maxcol];
2680 2680
  strncpy(new_seq,cur_seq,maxcol); //////// check: maxcol-1 ????
2681 2681
  delete[](cur_seq); (cur_seq) = NULL;
2682 2682
  cur_seq=new_seq;
... ...
@@ -2689,14 +2689,14 @@ Alignment::MergeMasterSlave(Hit& hit, char ta3mfile[])
2689 2689
  cur_seq[h++]='\0';
2690 2690
 
2691 2691
  keep[N_in] = display[N_in] = KEEP_CONDITIONALLY;
2692
- seq[N_in]=new(char[h]);
2692
+ seq[N_in]=new char[h];
2693 2693
  if (!seq[N_in]) MemoryError("array for input sequences");
2694 2694
  strcpy(seq[N_in],cur_seq);
2695
- X[N_in]=new(char[h]);
2695
+ X[N_in]=new char[h];
2696 2696
  if (!X[N_in]) MemoryError("array for input sequences");
2697
- I[N_in]=new(short unsigned int[h]);
2697
+ I[N_in]=new short unsigned int[h];
2698 2698
  if (!I[N_in]) MemoryError("array for input sequences");
2699
- sname[N_in]=new(char[strlen(Tali.sname[k])+1]);
2699
+ sname[N_in]=new char[strlen(Tali.sname[k])+1];
2700 2700
  if (!sname[N_in]) MemoryError("array for input sequences");
2701 2701
  strcpy(sname[N_in],Tali.sname[k]);
2702 2702
  N_in++;
... ...
@@ -2727,7 +2727,7 @@ Alignment::AddSequence(char Xk[], int Ik[])
2727 2727
 {
2728 2728
  int i; // position in query and target
2729 2729
  if (L<=0) InternalError("L is not set in AddSequence()");
2730
- X[N_in]=new(char[L+2]);
2730
+ X[N_in]=new char[L+2];
2731 2731
  for (i=0; i<=L+1; i++) X[N_in][i]=Xk[i];
2732 2732
  if (Ik==NULL)
2733 2733
  for (i=0; i<=L+1; i++) I[N_in][i]=0;
... ...
@@ -2777,7 +2777,7 @@ Alignment::GetPositionSpecificWeights(float* w[])
2777 2777
  {
2778 2778
 
2779 2779
  // Initialization
2780
- n = new(int*[L+2]);
2780
+ n = new int*[L+2];
2781 2781
  for (j=1; j<=L; j++) n[j]=new(int[NAA+3]);
2782 2782
  for (j=1; j<=L; j++)
2783 2783
  for (a=0; a<NAA+3; a++) n[j][a]=0;
... ...
@@ -2894,9 +2894,9 @@ Alignment::Transfer(char **ppcProf, int iCnt){
2894 2894
     /* @<allocate memory for sequences etc@> */
2895 2895
     for (k = 0; k < iCnt; k++){
2896 2896
 #define GOOD_MEASURE 1000 /* Temporary -- can be removed once rest in place */
2897
-        I[k] = new(short unsigned int[iLen+2+GOOD_MEASURE]);
2898
-        X[k] = new(char[iLen+2+GOOD_MEASURE]);
2899
-        seq[k] = new(char[iLen+2+GOOD_MEASURE]);
2897
+        I[k] = new short unsigned int[iLen+2+GOOD_MEASURE];
2898
+        X[k] = new char[iLen+2+GOOD_MEASURE];
2899
+        seq[k] = new char[iLen+2+GOOD_MEASURE];
2900 2900
         seq[k][0] = ' ';
2901 2901
         seq[k][1] = '\0';
2902 2902
         if (NULL == ppcProf[k]){
... ...
@@ -356,8 +356,8 @@ FullAlignment::PrintHHR(FILE* outf, Hit& hit)
356 356
   int iq=hit.i1;  // match state counter for query HMM (displayed in consensus line)
357 357
   int jt=hit.j1;  // match state counter for template HMM (displayed in consensus line)
358 358
 
359
-  lq = new(short unsigned int[qa->n+2]);
360
-  lt = new(short unsigned int[ta->n+2]);
359
+  lq = new short unsigned int[qa->n+2];
360
+  lt = new short unsigned int[ta->n+2];
361 361
 
362 362
   for (k=0; k<qa->n; k++) lq[k]=qa->l[k][hit.i1];
363 363
   for (k=0; k<ta->n; k++) lt[k]=ta->l[k][hit.j1];
... ...
@@ -63,10 +63,10 @@ HalfAlignment::HalfAlignment(int maxseqdis)
63 63
   n=0; 
64 64
   sname=seq=NULL; 
65 65
   nss_dssp = nss_pred = nss_conf = nsa_dssp = ncons= -1;
66
-  h = new(int[maxseqdis]);   //h[k] = next position of sequence k to be written
67
-  s = new(char*[maxseqdis]);  //s[k][h] = character in column h, sequence k of output alignment
68
-  l = new(int*[maxseqdis]);   //counts non-gap residues: l[k][i] = index of last residue AT OR BEFORE match state i in seq k
69
-  m = new(int*[maxseqdis]);   //counts positions:        m[k][i] = position of match state i in string seq[k]  
66
+  h = new int[maxseqdis];   //h[k] = next position of sequence k to be written
67
+  s = new char*[maxseqdis];  //s[k][h] = character in column h, sequence k of output alignment
68
+  l = new int*[maxseqdis];   //counts non-gap residues: l[k][i] = index of last residue AT OR BEFORE match state i in seq k
69
+  m = new int*[maxseqdis];   //counts positions:        m[k][i] = position of match state i in string seq[k]
70 70
 }
71 71
 
72 72
 /////////////////////////////////////////////////////////////////////////////////////
... ...
@@ -176,20 +176,20 @@ void
176 176
 Hit::AllocateBacktraceMatrix(int Nq, int Nt)
177 177
 {
178 178
   int i;
179
-  bMM=new(char*[Nq]);
180
-  bMI=new(char*[Nq]);
181
-  bIM=new(char*[Nq]);
182
-  bDG=new(char*[Nq]);
183
-  bGD=new(char*[Nq]);
184
-  cell_off=new(char*[Nq]);
179
+  bMM=new char*[Nq];
180
+  bMI=new char*[Nq];
181
+  bIM=new char*[Nq];
182
+  bDG=new char*[Nq];
183
+  bGD=new char*[Nq];
184
+  cell_off=new char*[Nq];
185 185
   for (i=0; i<Nq; i++) 
186 186
     {
187
-      bMM[i]=new(char[Nt]);
188
-      bMI[i]=new(char[Nt]);
189
-      bIM[i]=new(char[Nt]);
190
-      bGD[i]=new(char[Nt]);
191
-      bDG[i]=new(char[Nt]);
192
-      cell_off[i]=new(char[Nt]);
187
+      bMM[i]=new char[Nt];
188
+      bMI[i]=new char[Nt];
189
+      bIM[i]=new char[Nt];
190
+      bGD[i]=new char[Nt];
191
+      bDG[i]=new char[Nt];
192
+      cell_off[i]=new char[Nt];
193 193
       if (!bMM[i] || !bMI[i] || !bIM[i] || !bGD[i] || !bDG[i] || !cell_off[i]) 
194 194
 	{
195 195
 	  fprintf(stderr,"Error: out of memory while allocating row %i (out of %i) for dynamic programming matrices \n",i+1,Nq);
... ...
@@ -236,19 +236,19 @@ Hit::DeleteBacktraceMatrix(int Nq)
236 236
 void 
237 237
 Hit::AllocateForwardMatrix(int Nq, int Nt)
238 238
 {
239
-  F_MM=new(double*[Nq]);
240
-  F_MI=new(double*[Nq]);
241
-  F_DG=new(double*[Nq]);
242
-  F_IM=new(double*[Nq]);
243
-  F_GD=new(double*[Nq]);
244
-  scale=new(double[Nq+1]); // need Nq+3?
239
+  F_MM=new double*[Nq];
240
+  F_MI=new double*[Nq];
241
+  F_DG=new double*[Nq];
242
+  F_IM=new double*[Nq];
243
+  F_GD=new double*[Nq];
244
+  scale=new double[Nq+1]; // need Nq+3?
245 245
   for (int i=0; i<Nq; i++) 
246 246
     {
247
-      F_MM[i] = new(double[Nt]);
248
-      F_MI[i] = new(double[Nt]);
249
-      F_DG[i] = new(double[Nt]);
250
-      F_IM[i] = new(double[Nt]);
251
-      F_GD[i] = new(double[Nt]);
247
+      F_MM[i] = new double[Nt];
248
+      F_MI[i] = new double[Nt];
249
+      F_DG[i] = new double[Nt];
250
+      F_IM[i] = new double[Nt];
251
+      F_GD[i] = new double[Nt];
252 252
       if (!F_MM[i] || !F_MI[i] || !F_IM[i] || !F_GD[i] || !F_DG[i]) 
253 253
 	{
254 254
 	  fprintf(stderr,"Error: out of memory while allocating row %i (out of %i) for dynamic programming matrices \n",i+1,Nq);
... ...
@@ -293,14 +293,14 @@ Hit::DeleteForwardMatrix(int Nq)
293 293
 void 
294 294
 Hit::AllocateBackwardMatrix(int Nq, int Nt)
295 295
 {
296
-  B_MM=new(double*[Nq]);
296
+  B_MM=new double*[Nq];
297 297
   B_MI=F_MI; 
298 298
   B_DG=F_DG; 
299 299
   B_IM=F_IM; 
300 300
   B_GD=F_GD; 
301 301
   for (int i=0; i<Nq; i++) 
302 302
     {
303
-      B_MM[i] = new(double[Nt]);
303
+      B_MM[i] = new double[Nt];
304 304
       if (!B_MM[i]) 
305 305
 	{
306 306
 	  fprintf(stderr,"Error: out of memory while allocating row %i (out of %i) for dynamic programming matrices \n",i+1,Nq);
... ...
@@ -373,11 +373,11 @@ Hit::Viterbi(HMM& q, HMM& t, float** Sstruc)
373 373
     //float sDG[MAXRES];          // sDG[i][j] = score of best alignment up to indices (i,j) ending in (Delete,Gap)
374 374
     //float sIM[MAXRES];          // sIM[i][j] = score of best alignment up to indices (i,j) ending in (Ins,Match)
375 375
     //float sMI[MAXRES];          // sMI[i][j] = score of best alignment up to indices (i,j) ending in (Match,Ins) 
376
-    float *sMM = new(float[par.maxResLen]);   // sMM[i][j] = score of best alignment up to indices (i,j) ending in (Match,Match) 
377
-    float *sGD = new(float[par.maxResLen]);   // sGD[i][j] = score of best alignment up to indices (i,j) ending in (Gap,Delete) 
378
-    float *sDG = new(float[par.maxResLen]);   // sDG[i][j] = score of best alignment up to indices (i,j) ending in (Delete,Gap)
379
-    float *sIM = new(float[par.maxResLen]);   // sIM[i][j] = score of best alignment up to indices (i,j) ending in (Ins,Match)
380
-    float *sMI = new(float[par.maxResLen]);   // sMI[i][j] = score of best alignment up to indices (i,j) ending in (Match,Ins) 
376
+    float *sMM = new float[par.maxResLen];   // sMM[i][j] = score of best alignment up to indices (i,j) ending in (Match,Match)
377
+    float *sGD = new float[par.maxResLen];   // sGD[i][j] = score of best alignment up to indices (i,j) ending in (Gap,Delete)
378
+    float *sDG = new float[par.maxResLen];   // sDG[i][j] = score of best alignment up to indices (i,j) ending in (Delete,Gap)
379
+    float *sIM = new float[par.maxResLen];   // sIM[i][j] = score of best alignment up to indices (i,j) ending in (Ins,Match)
380
+    float *sMI = new float[par.maxResLen];   // sMI[i][j] = score of best alignment up to indices (i,j) ending in (Match,Ins)
381 381
     float smin=(par.loc? 0:-FLT_MAX);  //used to distinguish between SW and NW algorithms in maximization         
382 382
     int i=0,j=0;      //query and template match state indices
383 383
     float sMM_i_j=0, sMI_i_j=0, sIM_i_j=0, sGD_i_j=0, sDG_i_j=0;
... ...
@@ -1123,9 +1123,9 @@ Hit::Backtrace(HMM& q, HMM& t)
1123 1123
   nsteps=step; 
1124 1124
   
1125 1125
   // Allocate new space for alignment scores
1126
-  if (t.Xcons) Xcons = new( char[q.L+2]); // for template consensus sequence aligned to query
1127
-  S    = new( float[nsteps+1]);
1128
-  S_ss = new( float[nsteps+1]);
1126
+  if (t.Xcons) Xcons = new char[q.L+2]; // for template consensus sequence aligned to query
1127
+  S    = new  float[nsteps+1];
1128
+  S_ss = new float[nsteps+1];
1129 1129
   if (!S_ss) MemoryError("space for HMM-HMM alignments");
1130 1130
 
1131 1131
   // Add contribution from secondary structure score, record score along alignment,
... ...
@@ -1225,7 +1225,7 @@ Hit::StochasticBacktrace(HMM& q, HMM& t, char maximize)
1225 1225
   int i,j;         // query and template match state indices
1226 1226
 //  float pmin=(par.loc? 1.0: 0.0);    // used to distinguish between SW and NW algorithms in maximization         
1227 1227
   const float pmin=0;
1228
-  double* scale_cum = new(double[q.L+2]);
1228
+  double* scale_cum = new double[q.L+2];
1229 1229
   
1230 1230
 
1231 1231
   scale_cum[0]=1;
... ...
@@ -1244,7 +1244,7 @@ Hit::StochasticBacktrace(HMM& q, HMM& t, char maximize)
1244 1244
   else 
1245 1245
     {
1246 1246
 //      float sumF[q.L+t.L];
1247
-      double* sumF=new(double[q.L+t.L]);
1247
+      double* sumF=new double[q.L+t.L];
1248 1248
       sumF[0]=0.0;
1249 1249
       for (j=1; j<=t.L; j++)        sumF[j] = sumF[j-1] + F_MM[q.L][j]/scale_cum[q.L];;
1250 1250
       for (j=t.L+1; j<t.L+q.L; j++) sumF[j] = sumF[j-1] + F_MM[j-t.L][t.L]/scale_cum[j-t.L];;
... ...
@@ -1368,9 +1368,9 @@ Hit::StochasticBacktrace(HMM& q, HMM& t, char maximize)
1368 1368
   nsteps=step; 
1369 1369
 
1370 1370
   // Allocate new space for alignment scores
1371
-  if (t.Xcons) Xcons = new( char[q.L+2]); // for template consensus sequence aligned to query
1372
-  S    = new( float[nsteps+1]);
1373
-  S_ss = new( float[nsteps+1]);
1371
+  if (t.Xcons) Xcons = new char[q.L+2]; // for template consensus sequence aligned to query
1372
+  S    = new float[nsteps+1];
1373
+  S_ss = new float[nsteps+1];
1374 1374
   if (!S_ss) MemoryError("space for HMM-HMM alignments");
1375 1375
 
1376 1376
   // Add contribution from secondary structure score, record score along alignment,
... ...
@@ -1472,10 +1472,10 @@ Hit::BacktraceMAC(HMM& q, HMM& t)
1472 1472
   nsteps=step; 
1473 1473
     
1474 1474
   // Allocate new space for alignment scores
1475
-  if (t.Xcons) Xcons = new( char[q.L+2]); // for template consensus sequence aligned to query
1476
-  S    = new( float[nsteps+1]);
1477
-  S_ss = new( float[nsteps+1]);
1478
-  P_posterior = new( float[nsteps+1]);
1475
+  if (t.Xcons) Xcons = new char[q.L+2]; // for template consensus sequence aligned to query
1476
+  S    = new float[nsteps+1];
1477
+  S_ss = new float[nsteps+1];
1478
+  P_posterior = new float[nsteps+1];
1479 1479
   if (!P_posterior) MemoryError("space for HMM-HMM alignments");
1480 1480
 
1481 1481
   // Add contribution from secondary structure score, record score along alignment,
... ...
@@ -1680,9 +1680,9 @@ Hit::InitializeBacktrace(HMM& q, HMM& t)
1680 1680
     if (irep==1) //if this is the first single repeat repeat hit with this template
1681 1681
         {
1682 1682
             //Copy information about template profile to hit and reset template pointers to avoid destruction
1683
-            longname=new(char[strlen(t.longname)+1])();
1684
-            name    =new(char[strlen(t.name)+1])();
1685
-            file    =new(char[strlen(t.file)+1])();
1683
+            longname=new char[strlen(t.longname)+1]();
1684
+            name    =new char[strlen(t.name)+1]();
1685
+            file    =new char[strlen(t.file)+1]();
1686 1686
             if (!file) {
1687 1687
                 MemoryError("space for alignments with database HMMs. \nNote that all alignments have to be kept in memory");
1688 1688
             }
... ...
@@ -1693,8 +1693,8 @@ Hit::InitializeBacktrace(HMM& q, HMM& t)
1693 1693
             strcpy(fold ,t.fold);
1694 1694
             strcpy(cl ,t.cl);
1695 1695
             strcpy(file,t.file);
1696
-            sname=new(char*[t.n_display])();   // Call Compare only once with irep=1
1697
-            seq  =new(char*[t.n_display])();   // Call Compare only once with irep=1
1696
+            sname=new char*[t.n_display]();   // Call Compare only once with irep=1
1697
+            seq  =new char*[t.n_display]();   // Call Compare only once with irep=1
1698 1698
             if (!sname || !seq) {
1699 1699
                 MemoryError("space for alignments with database HMMs.\nNote that all sequences for display have to be kept in memory");
1700 1700
             }
... ...
@@ -1727,9 +1727,9 @@ Hit::InitializeBacktrace(HMM& q, HMM& t)
1727 1727
         }    
1728 1728
     
1729 1729
     // Allocate new space
1730
-    this->i = new( int[i2+j2+2])();
1731
-    this->j = new( int[i2+j2+2])();
1732
-    states  = new( char[i2+j2+2])();
1730
+    this->i = new int[i2+j2+2]();
1731
+    this->j = new int[i2+j2+2]();
1732
+    states  = new char[i2+j2+2]();
1733 1733
     S = S_ss = P_posterior = NULL; // set to NULL to avoid deleting data from irep=1 when hit with irep=2 is removed 
1734 1734
     Xcons = NULL;
1735 1735
 } /* this is the end of Hit::InitializeBacktrace() */
... ...
@@ -1285,32 +1285,32 @@ HitList::TransitiveScoring()
1285 1285
       index.Add(name,k);
1286 1286
     }
1287 1287
   // Read symmetric Z-scores matrix
1288
-  Z = new(float*[N]);
1288
+  Z = new float*[N];
1289 1289
   for (k=0; k<N; k++) 
1290 1290
     {
1291
-      Z[k] = new(float[N]);
1291
+      Z[k] = new float[N];
1292 1292
       for (l=0; l<k; l++) Z[k][l] = Z[l][k];
1293 1293
       unused = fread(Z[k]+k,sizeof(float),N-k,wfile);   
1294 1294
     }
1295 1295
   // Read symmetric covariance matrix
1296
-  C = new(float*[N]);
1296
+  C = new float*[N];
1297 1297
   for (k=0; k<N; k++) 
1298 1298
     {
1299
-      C[k] = new(float[N]);
1299
+      C[k] = new float[N];
1300 1300
       for (l=0; l<k; l++) C[k][l] = C[l][k];
1301 1301
       unused = fread(C[k]+k,sizeof(float),N-k,wfile);
1302 1302
     }
1303 1303
   fclose(wfile);
1304 1304
 
1305 1305
   // Allocate memory
1306
-  Zq = new(float[N]);
1307
-  Ztq = new(float[N]);
1308
-  Zrq = new(float[N]);
1309
-  fold = new(char*[N]);
1310
-  fam = new(char*[N]);
1311
-  Prob = new(float[N]);
1312
-  ll = new(int[N]);
1313
-  w = new(float[N]);
1306
+  Zq = new float[N];
1307
+  Ztq = new float[N];
1308
+  Zrq = new float[N];
1309
+  fold = new char*[N];
1310
+  fam = new char*[N];
1311
+  Prob = new float[N];
1312
+  ll = new int[N];
1313
+  w = new float[N];
1314 1314
 
1315 1315
   // Transform P-values to normally distributed Z-scores and store in Zq vector
1316 1316
   fprintf(stderr,"Transform P-values to Z-scores\n");
... ...
@@ -1373,12 +1373,12 @@ HitList::TransitiveScoring()
1373 1373
   else
1374 1374
     {
1375 1375
       // Generate submatrix of C for indices l for which Z_lq,Z_lk > Zmin_trans 
1376
-      double** Csub = new(double*[M]);
1377
-      double** Cinv = new(double*[M]);
1376
+      double** Csub = new double*[M];
1377
+      double** Cinv = new double*[M];
1378 1378
       for (m=0; m<M; m++) 
1379 1379
 	{
1380
-	  Csub[m] = new(double[M]);
1381
-	  Cinv[m] = new(double[M]);
1380
+	  Csub[m] = new double[M];
1381
+	  Cinv[m] = new double[M];
1382 1382
 	  for (n=0; n<M; n++)
1383 1383
 	    Csub[m][n] = double(C[ll[m]][ll[n]]);
1384 1384
 	}
... ...
@@ -1453,10 +1453,10 @@ HitList::TransitiveScoring()
1453 1453
       else 
1454 1454
 	{
1455 1455
 	  // Generate submatrix of C for indices l for which Z_lq,Z_lk > Zmin_trans 
1456
-	  double** Csub = new(double*[M]);
1456
+	  double** Csub = new double*[M];
1457 1457
 	  for (m=0; m<M; m++) 
1458 1458
 	    {
1459
-	      Csub[m] = new(double[M]);
1459
+	      Csub[m] = new double[M];
1460 1460
 	      for (n=0; n<M; n++)
1461 1461
 		Csub[m][n] = double(C[ll[m]][ll[n]]);
1462 1462
 	    }
... ...
@@ -1470,8 +1470,8 @@ HitList::TransitiveScoring()
1470 1470
 	  else 
1471 1471
 	    {
1472 1472
 	      
1473
-	      double** Cinv = new(double*[M]);
1474
-	      for (m=0; m<M; m++) Cinv[m] = new(double[M]);
1473
+	      double** Cinv = new double*[M];
1474
+	      for (m=0; m<M; m++) Cinv[m] = new double[M];
1475 1475
 
1476 1476
 	      // Invert Csub
1477 1477
 	      InvertMatrix(Cinv,Csub,M);
... ...
@@ -1650,32 +1650,32 @@ HitList::TransitiveScoring2()
1650 1650