[med-svn] [Git][med-team/kma][master] 5 commits: New upstream version 1.2.16

Steffen Möller gitlab at salsa.debian.org
Sat Nov 30 15:01:52 GMT 2019



Steffen Möller pushed to branch master at Debian Med / kma


Commits:
18e38cc7 by Steffen Moeller at 2019-11-30T15:00:12Z
New upstream version 1.2.16
- - - - -
cbfc50a6 by Steffen Moeller at 2019-11-30T15:00:12Z
New upstream version

- - - - -
669933a1 by Steffen Moeller at 2019-11-30T15:00:12Z
Update upstream source from tag 'upstream/1.2.16'

Update to upstream version '1.2.16'
with Debian dir 4b333b64b71a29351ce58f24bf96a760d354282b
- - - - -
dfa0d30d by Steffen Moeller at 2019-11-30T15:00:16Z
Set upstream metadata fields: Repository.
- - - - -
d6256546 by Steffen Moeller at 2019-11-30T15:00:38Z
Upload to unstable

- - - - -


8 changed files:

- align.c
- assembly.c
- debian/changelog
- debian/upstream/metadata
- kma.c
- main.c
- nw.c
- version.h


Changes:

=====================================
align.c
=====================================
@@ -601,6 +601,7 @@ AlnScore KMA_score(const HashMap_index *template_index, const unsigned char *qse
 				NWstat = NW_score(template_index->seq, qseq, -1 - (t_s == 0), t_s, t_e, q_s, q_e, matrices, t_len);
 			} else {
 				NWstat = NW_band_score(template_index->seq, qseq, -1 - (t_s == 0), t_s, t_e, q_s, q_e, band, matrices, t_len);
+				//NWstat = NW_score(template_index->seq, qseq, -1 - (t_s == 0), t_s, t_e, q_s, q_e, matrices, t_len);
 			}
 			Stat.pos -= (NWstat.len - NWstat.gaps);
 			Stat.score = NWstat.score;


=====================================
assembly.c
=====================================
@@ -18,6 +18,7 @@
 */
 #define _XOPEN_SOURCE 600
 #include <ctype.h>
+#include <limits.h>
 #include <math.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -167,7 +168,7 @@ unsigned char baseCaller(unsigned char bestNuc, unsigned char tNuc, int bestScor
 	} else {
 		/* Use MnNemars test to test significance of the base call */
 		if(significantBase(bestScore, depthUpdate - bestScore, evalue) == 0) {
-			if(bestNuc == '-' && tNuc != '-') {
+			if(bestNuc == '-' && tNuc != '-' && bestScore != depthUpdate) {
 				bestNuc = 'n';
 			} else {
 				bestNuc = tolower(bestNuc);
@@ -213,7 +214,7 @@ unsigned char nanoCaller(unsigned char bestNuc, unsigned char tNuc, int bestScor
 	} else {
 		/* Use MC Neymars test to test significance of the base call */
 		if(significantBase(bestScore, depthUpdate - bestScore, evalue) == 0) {
-			if(bestNuc == '-' && tNuc != '-') {
+			if(bestNuc == '-' && tNuc != '-' && bestScore != depthUpdate) {
 				bestBaseScore = 0;
 				for(j = 0; j < 5; ++j) {
 					if(bestBaseScore < calls->counts[j]) {
@@ -337,10 +338,7 @@ void * assemble_KMA_threaded(void *arg) {
 		if(matrix->size < (t_len << 1)) {
 			matrix->size = (t_len << 1);
 			free(matrix->assmb);
-			matrix->assmb = malloc(matrix->size * sizeof(Assembly));
-			if(!matrix->assmb) {
-				ERROR();
-			}
+			matrix->assmb = smalloc(matrix->size * sizeof(Assembly));
 		}
 		
 		/* cpy template seq */
@@ -473,7 +471,9 @@ void * assemble_KMA_threaded(void *arg) {
 							while(i < aln_len) {
 								if(aligned->t[i] == 5) { // Template gap, insertion
 									if(t_len <= pos) {
-										assembly[pos].counts[aligned->q[i]]++;
+										if(!++assembly[pos].counts[aligned->q[i]]) {
+											assembly[pos].counts[aligned->q[i]] = USHRT_MAX;
+										}
 										++i;
 										pos = assembly[pos].next;
 									} else {
@@ -517,8 +517,8 @@ void * assemble_KMA_threaded(void *arg) {
 											assembly[pos].counts[2] = 0;
 											assembly[pos].counts[3] = 0;
 											assembly[pos].counts[4] = 0;
-											assembly[pos].counts[5] = myBias;
-											assembly[pos].counts[aligned->q[i]]++;
+											assembly[pos].counts[5] = myBias < USHRT_MAX ? myBias : USHRT_MAX;
+											assembly[pos].counts[aligned->q[i]] = 1;
 											
 											++i;
 										}
@@ -528,7 +528,9 @@ void * assemble_KMA_threaded(void *arg) {
 									assembly[pos].counts[5]++;
 									pos = assembly[pos].next;
 								} else {
-									assembly[pos].counts[aligned->q[i]]++;
+									if(!++assembly[pos].counts[aligned->q[i]]) {
+										assembly[pos].counts[aligned->q[i]] = USHRT_MAX;
+									}
 									++i;
 									pos = assembly[pos].next;
 								}
@@ -651,10 +653,10 @@ void * assemble_KMA_threaded(void *arg) {
 		}
 		
 		/* call query */
-		bestNuc = 5;
-		bestScore = 0;
-		depthUpdate = 0;
-		for(j = 0; j < 6; ++j) {
+		bestNuc = 0;
+		bestScore = assembly[pos].counts[0];
+		depthUpdate = bestScore;
+		for(j = 1; j < 6; ++j) {
 			if(bestScore < assembly[pos].counts[j]) {
 				bestScore = assembly[pos].counts[j];
 				bestNuc = j;
@@ -666,9 +668,9 @@ void * assemble_KMA_threaded(void *arg) {
 		/* check for minor base call */
 		if((bestScore << 1) < depthUpdate) {
 			if(bestNuc == '-') {
-				bestBaseScore = 0;
+				bestBaseScore = assembly[pos].counts[4];
 				bestNuc = 4;
-				for(j = 0; j < 5; ++j) {
+				for(j = 0; j < 4; ++j) {
 					if(bestBaseScore < assembly[pos].counts[j]) {
 						bestBaseScore = assembly[pos].counts[j];
 						bestNuc = j;
@@ -948,7 +950,9 @@ void * assemble_KMA_dense_threaded(void *arg) {
 							/* diff */
 							for(i = 0, pos = start; i < aln_len; ++i) {
 								if(aligned->t[i] == aligned_assem->t[pos]) {
-									assembly[pos].counts[aligned->q[i]]++;
+									if(!++assembly[pos].counts[aligned->q[i]]) {
+										assembly[pos].counts[aligned->q[i]] = USHRT_MAX;	
+									}
 									pos = assembly[pos].next;
 								}
 							}


=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+kma (1.2.16-1) unstable; urgency=medium
+
+  * Team upload.
+  * New upstream version
+  * Set upstream metadata fields: Repository.
+
+ -- Steffen Moeller <moeller at debian.org>  Sat, 30 Nov 2019 16:00:16 +0100
+
 kma (1.2.15-1) unstable; urgency=medium
 
   * Team upload.


=====================================
debian/upstream/metadata
=====================================
@@ -1,21 +1,21 @@
 Reference:
- Author: Philip T. L. C. Clausen and Frank M. Aarestrup and Ole Lund
- Title: >
-  Rapid and precise alignment of raw reads against redundant databases
-  with KMA
- Journal: BMC Bioinformatics
- Year: 2018
- Volume: 19
- Pages: 307
- DOI: 10.1186/s12859-018-2336-6
- PMID: 30157759
- URL: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6116485/
- eprint: "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6116485/\
-  pdf/12859_2018_Article_2336.pdf"
+  Author: Philip T. L. C. Clausen and Frank M. Aarestrup and Ole Lund
+  Title: >
+    Rapid and precise alignment of raw reads against redundant databases
+    with KMA
+  Journal: BMC Bioinformatics
+  Year: 2018
+  Volume: 19
+  Pages: 307
+  DOI: 10.1186/s12859-018-2336-6
+  PMID: 30157759
+  URL: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6116485/
+  eprint: "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6116485/pdf/12859_2018_Article_2336.pdf"
 Registry:
- - Name: OMICtools
-   Entry: OMICS_31606
- - Name: bio.tools
-   Entry: NA
- - Name: conda:bioconda
-   Entry: kma
+- Name: OMICtools
+  Entry: OMICS_31606
+- Name: bio.tools
+  Entry: NA
+- Name: conda:bioconda
+  Entry: kma
+Repository: https://bitbucket.org/genomicepidemiology/kma


=====================================
kma.c
=====================================
@@ -164,6 +164,7 @@ static void helpMessage(int exeStatus) {
 	fprintf(helpOut, "#\t-transversion\tPenalty for transversion\t-2\n");
 	fprintf(helpOut, "#\t-cge\t\tSet CGE penalties and rewards\tFalse\n");
 	fprintf(helpOut, "#\t-t\t\tNumber of threads\t\t1\n");
+	fprintf(helpOut, "#\t-c\t\tCitation\n");
 	fprintf(helpOut, "#\t-v\t\tVersion\n");
 	fprintf(helpOut, "#\t-h\t\tShows this help message\n");
 	fprintf(helpOut, "#\n");
@@ -789,6 +790,9 @@ int kma_main(int argc, char *argv[]) {
 			} else if(strcmp(argv[args], "-v") == 0) {
 				fprintf(stdout, "KMA-%s\n", KMA_VERSION);
 				exit(0);
+			} else if(strcmp(argv[args], "-c") == 0) {
+				fprintf(stdout, "Philip T.L.C. Clausen, Frank M. Aarestrup & Ole Lund, \"Rapid and precise alignment of raw reads against redundant databases with KMA\", BMC Bioinformatics, 2018;19:307.\n");
+				exit(0);
 			} else if(strcmp(argv[args], "-h") == 0) {
 				helpMessage(0);
 			} else {


=====================================
main.c
=====================================
@@ -24,14 +24,18 @@
 #include "seq2fasta.h"
 #include "update.h"
 
-static int helpmessage() {
+static int helpmessage(FILE *out) {
 	
-	fprintf(stderr, "# For help please use:\n");
-	fprintf(stderr, "#\tkma -h\n");
-	fprintf(stderr, "#\tkma index -h\n");
-	fprintf(stderr, "#\tkma shm -h\n");
-	fprintf(stderr, "#\tkma seq2fasta -h\n");
-	fprintf(stderr, "#\tkma update -h\n");
+	fprintf(out, "# KMA enables alignment towards databases, using two k-mer mapping steps and one alignment step.\n");
+	fprintf(out, "# %16s\t%-32s\n", "Options are:", "Desc:");
+	fprintf(out, "# %16s\t%-32s\n", "", "Alignment and mapping");
+	fprintf(out, "# %16s\t%-32s\n", "index", "Indexing of databases");
+	fprintf(out, "# %16s\t%-32s\n", "shm", "Shared memory");
+	fprintf(out, "# %16s\t%-32s\n", "seq2fasta", "Conversion of database to fasta");
+	fprintf(out, "# %16s\t%-32s\n", "update", "Update database to current version");
+	fprintf(out, "# %16s\t%-32s\n", "-c", "Citation");
+	fprintf(out, "# %16s\t%-32s\n", "-v", "Version");
+	fprintf(out, "# %16s\t%-32s\n", "-h", "Help on alignment and mapping");
 	return 1;
 }
 
@@ -52,11 +56,10 @@ int main(int argc, char *argv[]) {
 			status = update_main(argc, argv);
 		} else {
 			fprintf(stderr, "Invalid option:\t%s\n", *argv);
-			status = helpmessage();
+			status = helpmessage(stderr);
 		}
 	} else {
-		fprintf(stderr, "Too few arguments handed\n");
-		status = helpmessage();
+		status = helpmessage(stdout);
 	}
 	
 	return status;


=====================================
nw.c
=====================================
@@ -556,7 +556,7 @@ AlnScore NW_band(const long unsigned *template, const unsigned char *queryOrg, i
 				Stat.score = D_prev[n];
 				pos[0] = 0;
 				pos[1] = n;
-				q_pos = n;
+				q_pos = n - en;
 			}
 		}
 	}


=====================================
version.h
=====================================
@@ -17,4 +17,4 @@
  * limitations under the License.
 */
 
-#define KMA_VERSION "1.2.15"
+#define KMA_VERSION "1.2.16"



View it on GitLab: https://salsa.debian.org/med-team/kma/compare/7f765c85bf8713aef54ba0c142a3d1827e8d0fd7...d6256546f2607e48f3b102a45fbb211d8a491620

-- 
View it on GitLab: https://salsa.debian.org/med-team/kma/compare/7f765c85bf8713aef54ba0c142a3d1827e8d0fd7...d6256546f2607e48f3b102a45fbb211d8a491620
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20191130/a1b25d4c/attachment-0001.html>


More information about the debian-med-commit mailing list