Browse code

fix of custom substitution matrices in ClustalW; version number bumped to 1.11.1

Ulrich Bodenhofer authored on 23/04/2018 11:29:24
Showing 5 changed files

... ...
@@ -1,8 +1,8 @@
1 1
 Package: msa
2 2
 Type: Package
3 3
 Title: Multiple Sequence Alignment
4
-Version: 1.11.0
5
-Date: 2017-04-17
4
+Version: 1.11.1
5
+Date: 2018-04-23
6 6
 Author: Enrico Bonatesta, Christoph Horejs-Kainrath, Ulrich Bodenhofer
7 7
 Maintainer: Ulrich Bodenhofer <bodenhofer@bioinf.jku.at>
8 8
 Description: The 'msa' package provides a unified R/Bioconductor interface to
... ...
@@ -154,7 +154,7 @@ msaClustalW <- function(inputSeqs,
154 154
 
155 155
             params[["substitutionMatrixIsStringFlag"]] <- FALSE
156 156
             params[["substitutionMatrixIsDefaultFlag"]] <- TRUE
157
-            params[["dnamatrix"]] <- substitutionMatrix
157
+            params[["pwdnamatrix"]] <- substitutionMatrix
158 158
             substitutionMatrix <- "default"
159 159
         }
160 160
     } else {
... ...
@@ -334,8 +334,7 @@ msaClustalW <- function(inputSeqs,
334 334
 
335 335
     ###########
336 336
     # convert #
337
-    ###########
338
-    ##output the input sequences in a different file format.
337
+    ###########    ##output the input sequences in a different file format.
339 338
     params[["convert"]] <- checkLogicalParams("convert", params, FALSE)
340 339
 
341 340
     ##delete param in copy
... ...
@@ -655,7 +654,7 @@ msaClustalW <- function(inputSeqs,
655 654
     } else {
656 655
         posVal <- c("iub", "clustalw")
657 656
         params[["pwdnamatrix"]] <- checkSingleValParamsNew("pwdnamatrix",
658
-                                    params, posVal)
657
+                                                           params, posVal)
659 658
     }
660 659
 
661 660
     ##delete param in copy
... ...
@@ -729,16 +728,16 @@ msaClustalW <- function(inputSeqs,
729 728
     #############
730 729
     ##DNA weight matrix=IUB, CLUSTALW or filename
731 730
 
732
-    ##if filename (seperated with ".") check and use file;
731
+    ##if filename (separated with ".") check and use file;
733 732
     ##else check whether value is iub or clustalw;
734 733
     ##if nothing is given, use iub
735 734
     if (!is.null(params[["dnamatrix"]]) &&
736 735
             grepl("\\.", params[["dnamatrix"]], perl=TRUE)) {
737 736
         checkInFile("dnamatrix", params)
738
-    } else {
737
+    } else if (is.null(params[["pwdnamatrix"]])) {
739 738
         posVal <- c("iub", "clustalw")
740
-        params[["dnamatrix"]] <- checkSingleValParamsNew("dnamatrix",
741
-                                    params, posVal)
739
+        params[["pwdnamatrix"]] <- checkSingleValParamsNew("dnamatrix",
740
+                                                           params, posVal)
742 741
     }
743 742
 
744 743
     ##delete param in copy
... ...
@@ -1,6 +1,24 @@
1 1
 Change history of package msa:
2 2
 ==============================
3 3
 
4
+Version 1.12.0:
5
+- release as part of Bioconductor 3.7
6
+
7
+Version 1.11.1:
8
+- fix of code for using custom substitution matrices in ClustalW
9
+
10
+Version 1.11.0:
11
+- new branch for Bioconductor 3.7 devel
12
+
13
+Version 1.10.0:
14
+- release as part of Bioconductor 3.6
15
+
16
+Version 1.9.0:
17
+- new branch for Bioconductor 3.6 devel
18
+
19
+Version 1.8.0:
20
+- release as part of Bioconductor 3.5
21
+
4 22
 Version 1.7.2:
5 23
 - fix for new clang 4 compiler on Mac OS
6 24
 
... ...
@@ -116,6 +116,16 @@ SEXP RClustalW(SEXP rInputSeqs,
116 116
             args.push_back(std::string(numiter));
117 117
         }
118 118
 
119
+        //type
120
+        if (!Rf_isNull(rType)) {
121
+            string type = as<string>(rType);
122
+            string autoType = "auto";
123
+            //clustalW don't know type == "rna"
124
+            if (autoType.compare(type) != 0 && type != "rna") {
125
+                args.push_back(" TYPE=" + type);
126
+            }
127
+        }
128
+
119 129
         //rSubstitutionMatrix
120 130
         bool defaultFlag = false;
121 131
         if (hasClustalWEntry(rparam, "substitutionMatrixIsDefaultFlag")) {
... ...
@@ -127,8 +137,13 @@ SEXP RClustalW(SEXP rInputSeqs,
127 137
         }
128 138
 
129 139
         if (defaultFlag) {
130
-            //do nothing
131
-            Rprintf("use default substitution matrix\n");
140
+            if (hasClustalWEntry(rparam, "pwdnamatrix")) {
141
+		string pwDnaMat = as<string>(rparam["pwdnamatrix"]);
142
+		Rprintf("use DNA substitution matrix: %s\n", pwDnaMat.c_str());
143
+	    }
144
+	    else {
145
+		Rprintf("use default substitution matrix\n");
146
+	    }
132 147
         } else if (stringFlag) {
133 148
             /*FIXME TODO change hardcoded rows and numbers*/
134 149
             string inputMatrixFile = as<string>(rSubstitutionMatrix);
... ...
@@ -145,16 +160,6 @@ SEXP RClustalW(SEXP rInputSeqs,
145 160
             input.substitutionMatrix = substitutionMatrix;
146 161
         }
147 162
 
148
-        //type
149
-        if (!Rf_isNull(rType)) {
150
-            string type = as<string>(rType);
151
-            string autoType = "auto";
152
-            //clustalW don't know type == "rna"
153
-            if (autoType.compare(type) != 0 && type != "rna") {
154
-                args.push_back(" TYPE=" + type);
155
-            }
156
-        }
157
-
158 163
         //verbose
159 164
         bool verbose = false;
160 165
         if (!Rf_isNull(rVerbose)) {
... ...
@@ -465,6 +470,10 @@ SEXP RClustalW(SEXP rInputSeqs,
465 470
             string pwdnamatrix = as<string>(rparam["pwdnamatrix"]);
466 471
             args.push_back(" PWDNAMATRIX=" + pwdnamatrix);
467 472
         }
473
+	else if (hasClustalWEntry(rparam, "dnamatrix")) {
474
+            string pwdnamatrix = as<string>(rparam["dnamatrix"]);
475
+            args.push_back(" PWDNAMATRIX=" + pwdnamatrix);
476
+	}
468 477
 
469 478
         //params$pwgapext
470 479
         if (hasClustalWEntry(rparam, "pwgapext")) {
... ...
@@ -889,6 +889,14 @@ bibliography below).
889 889
 \section{Change Log}
890 890
 
891 891
 \begin{description}
892
+\item[Version 1.12.0:] release as part of Bioconductor 3.7
893
+\item[Version 1.11.1:] \mbox{ }  \begin{itemize}
894
+   \item fix of code for using custom substitution matrices in ClustalW
895
+  \end{itemize}
896
+\item[Version 1.11.0:] new branch for Bioconductor 3.7 devel
897
+\item[Version 1.10.0:] release as part of Bioconductor 3.56
898
+\item[Version 1.9.0:] new branch for Bioconductor 3.6 devel
899
+\item[Version 1.8.0:] release as part of Bioconductor 3.5
892 900
 \item[Version 1.7.2:] \mbox{ }  \begin{itemize}
893 901
    \item fix for new \verb+clang+ 4 compiler on Mac OS
894 902
   \end{itemize}