[med-svn] [Git][med-team/kma][upstream] New upstream version 1.4.21

Étienne Mollier (@emollier) gitlab at salsa.debian.org
Wed Mar 5 12:50:33 GMT 2025



Étienne Mollier pushed to branch upstream at Debian Med / kma


Commits:
9c6d1efa by Étienne Mollier at 2025-03-05T13:43:42+01:00
New upstream version 1.4.21
- - - - -


5 changed files:

- assembly.c
- index.c
- kma.c
- update.c
- version.h


Changes:

=====================================
assembly.c
=====================================
@@ -517,9 +517,7 @@ void * assemble_KMA_threaded(void *arg) {
 										for(j = 0; j < 6; ++j) {
 											myBias += assembly[pos].counts[j];
 										}
-										if(myBias > 0) { /* here */ /* not here */ /* why subtract one */ /* and check prior to insertion, for which -- is appropiate */
-											--myBias;
-										}
+										
 										/* find position of insertion */
 										gaps = pos;
 										if(pos != 0) {
@@ -1320,7 +1318,7 @@ void alnToMat(AssemInfo *matrix, Assem *aligned_assem, Aln *aligned, AlnScore al
 	
 	static volatile int Lock = 0;
 	volatile int *excludeMatrix = &Lock;
-	int i, pos, aln_len, start, read_score, myBias, gaps;
+	int i, pos, aln_len, start, read_score, myBias, tmp, gaps;
 	short unsigned *counts;
 	Assembly *assembly;
 	
@@ -1339,8 +1337,23 @@ void alnToMat(AssemInfo *matrix, Assem *aligned_assem, Aln *aligned, AlnScore al
 	}
 	++aligned_assem->readCountAln;
 	
-	/* diff */
+	/* trim trailing gaps */
+	i = aln_len - 1;
+	while(i && (aligned->t[i] == 5 || aligned->q[i] == 5)) {
+		--i;
+	}
+	aln_len = i + 1;
+	
+	/* trim leading gaps */
 	i = 0;
+	while(i < aln_len && (aligned->t[i] == 5 || aligned->q[i] == 5)) {
+		if(aligned->q[i] == 5) {
+			++start;
+		}
+		++i;
+	}
+	
+	/* diff */
 	pos = start;
 	assembly = matrix->assmb;
 	while(i < aln_len) {
@@ -1356,20 +1369,29 @@ void alnToMat(AssemInfo *matrix, Assem *aligned_assem, Aln *aligned, AlnScore al
 				gaps = pos;
 				pos = pos ? (pos - 1) : (t_len - 1);
 				
-				/* find position of insertion, it it already exists */
+				/* find position of insertion, if it already exists */
 				while(assembly[pos].next != gaps) {
 					pos = assembly[pos].next;
 				}
 				
 				/* get number of bases not supporting the insertion */
 				counts = assembly[pos].counts;
-				myBias = counts[0] + counts[1] + counts[2] + counts[3] + counts[4] + counts[5] - 1;
+				myBias = *counts;
+				myBias += *++counts;
+				myBias += *++counts;
+				myBias += *++counts;
+				myBias += *++counts;
+				myBias += *++counts;
 				
 				/* get minimum of bases sorrounding new insertion */
 				counts = assembly[gaps].counts;
-				if((counts[0] + counts[1] + counts[2] + counts[3] + counts[4] + counts[5]) < myBias) {
-					myBias = counts[0] + counts[1] + counts[2] + counts[3] + counts[4] + counts[5];
-				}
+				tmp = *counts;
+				tmp += *++counts;
+				tmp += *++counts;
+				tmp += *++counts;
+				tmp += *++counts;
+				tmp += *++counts;
+				myBias = (tmp < myBias) ? tmp : (myBias - 1);
 				if(USHRT_MAX < myBias) {
 					myBias = USHRT_MAX;
 				}
@@ -1443,15 +1465,33 @@ void alnToMatDense(AssemInfo *matrix, Assem *aligned_assem, Aln *aligned, AlnSco
 	}
 	++aligned_assem->readCountAln;
 	
+	/* trim trailing gaps */
+	i = aln_len - 1;
+	while(i < aln_len && (aligned->t[i] == 5 || aligned->q[i] == 5)) {
+		--i;
+	}
+	aln_len = i + 1;
+	
+	/* trim leading gaps */
+	i = 0;
+	while(i && (aligned->t[i] == 5 || aligned->q[i] == 5)) {
+		if(aligned->q[i] == 5) {
+			++start;
+		}
+		++i;
+	}
+	
 	/* diff */
+	pos = start;
 	assembly = matrix->assmb;
-	for(i = 0, pos = start; i < aln_len; ++i) {
+	while(i < aln_len) {
 		if(aligned->t[i] != 5) {
 			if(!++assembly[pos].counts[aligned->q[i]]) {
 				assembly[pos].counts[aligned->q[i]] = USHRT_MAX;	
 			}
 			pos = assembly[pos].next;
 		}
+		++i;
 	}
 	unlock(excludeMatrix);
 }


=====================================
index.c
=====================================
@@ -676,7 +676,7 @@ int index_main(int argc, char *argv[]) {
 	/* decontaminate */
 	if(deconcount != 0) {
 		/* open values */
-		fprintf(stderr, "# Openning values\n");
+		fprintf(stderr, "# Opening values\n");
 		if(!finalDB) {
 			strcat(outputfilename, ".comp.b");
 			out = sfopen(outputfilename, "rb");


=====================================
kma.c
=====================================
@@ -164,7 +164,7 @@ static void helpMessage(int exitStatus) {
 	fprintf(out, "# %16s\t%-32s\t%s\n", "-1t1", "One query to one template", "False");
 	fprintf(out, "# %16s\t%-32s\t%s\n", "-hmm", "Use a HMM to assign template(s)", "False");
 	fprintf(out, "# %16s\t%-32s\t%s\n", "-ck", "Count k-mers over pseudo alignment", "False");
-	fprintf(out, "# %16s\t%-32s\t%s\n", "-localopen", "Penalty for openning a local chain", "6");
+	fprintf(out, "# %16s\t%-32s\t%s\n", "-localopen", "Penalty for opening a local chain", "6");
 	fprintf(out, "# %16s\t%-32s\t%s\n", "-mct", "Max overlap between templates", "0.1");
 	fprintf(out, "# %16s\t%-32s\t%s\n", "-lc", "Length corrected template chaining", "False");
 	


=====================================
update.c
=====================================
@@ -238,7 +238,7 @@ static void helpMessage(int exeStatus) {
 	} else {
 		helpOut = stderr;
 	}
-	fprintf(helpOut, "# KMA_update syncronises kma-indexes to the needed version.\n");
+	fprintf(helpOut, "# KMA_update synchronises kma-indexes to the needed version.\n");
 	fprintf(helpOut, "# Options are:\t\tDesc:\t\t\t\t\tRequirements:\n");
 	fprintf(helpOut, "#\n");
 	fprintf(helpOut, "#\t-t_db\t\tTemplate DB\t\t\t\tREQUIRED\n");


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



View it on GitLab: https://salsa.debian.org/med-team/kma/-/commit/9c6d1efa2d54895dd1ab122ffe5613ab50282bf5

-- 
View it on GitLab: https://salsa.debian.org/med-team/kma/-/commit/9c6d1efa2d54895dd1ab122ffe5613ab50282bf5
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/20250305/785cb350/attachment-0001.htm>


More information about the debian-med-commit mailing list