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

Steffen Möller gitlab at salsa.debian.org
Wed Sep 2 19:37:21 BST 2020



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


Commits:
a5deda4a by Steffen Moeller at 2020-09-02T20:16:01+02:00
New upstream version 1.3.3
- - - - -


5 changed files:

- align.c
- dist.c
- matrix.c
- nw.c
- version.h


Changes:

=====================================
align.c
=====================================
@@ -211,7 +211,6 @@ AlnScore KMA(const HashMapCCI *template_index, const unsigned char *qseq, int q_
 	/* get best seed chain, returns best starting point */
 	start = chainSeedsPtr(points, q_len, t_len, kmersize, &aligned->mapQ);
 	score = points->score[start];
-	
 	if(aligned->mapQ < mq || score < kmersize) {
 		Stat.score = 0;
 		Stat.len = 1;
@@ -342,7 +341,7 @@ AlnScore KMA(const HashMapCCI *template_index, const unsigned char *qseq, int q_
 				return Stat;
 			}
 			if((t_l > 0 || q_e - q_s > 0)) {
-				band = 4 * abs(t_e - t_s - q_e + q_s) + bandwidth;
+				band = 4 * abs(t_l - q_e + q_s) + bandwidth;
 				if(q_e - q_s <= band || t_l <= band) {// || abs(t_e - t_s - q_e - q_s) >= 32) {
 					NWstat = NW(template_index->seq, qseq, 0, t_s, t_e, q_s, q_e, Frag_align, matrices);
 				} else {


=====================================
dist.c
=====================================
@@ -233,11 +233,11 @@ void kmerSimilarity_thread(HashMapKMA *DB, Matrix *Dist, int *N, int thread_num,
 	el = DB->v_index < UINT_MAX;
 	vs = DB->DB_size < USHRT_MAX;
 	D = Dist->mat;
-	chunk = 1024;
+	chunk = 131072;
 	size = ((DB->size - 1) == DB->mask) ? DB->size : DB->n;
 	
 	/* static init */
-	lock(lock);
+	lockTime(lock, 10);
 	if(!thread_wait) {
 		thread_wait = thread_num;
 		next = 0;
@@ -249,7 +249,7 @@ void kmerSimilarity_thread(HashMapKMA *DB, Matrix *Dist, int *N, int thread_num,
 	/* get values */
 	while(n && chunk) {
 		/* get next chunk */
-		lock(lock);
+		lockTime(lock, 10);
 		pos = next;
 		if(size < (next += chunk)) {
 			next = size;
@@ -337,8 +337,8 @@ void printIntLtdPhy(char *outfile, Matrix *Dist, int *N, FILE *name_file, Qseqs
 	
 	/* init */
 	D = Dist->mat;
-	chunk = 1048576;
-	lock(lock);
+	chunk = 65536;
+	lockTime(lock, 10);
 	if(!row_bias) {
 		if(format & 4) {
 			row_bias += sprintf(outfile, "# %-35s\n", method);
@@ -361,9 +361,11 @@ void printIntLtdPhy(char *outfile, Matrix *Dist, int *N, FILE *name_file, Qseqs
 	unlock(lock);
 	
 	while(next_i < Dist->n) {
-		lock(lock);
+		lockTime(lock, 10);
 		/* check for new row */
-		if(next_i <= next_j) {
+		if(Dist->n <= next_i) {
+			chunk = 0;
+		} else if(next_i <= next_j) {
 			i = ++next_i;
 			if(i) {
 				row_bias += (i - 1) * 11;
@@ -404,7 +406,7 @@ void printIntLtdPhy(char *outfile, Matrix *Dist, int *N, FILE *name_file, Qseqs
 	}
 	
 	/* wait for matrix to finish */
-	lock(lock);
+	lockTime(lock, 10);
 	if(--*thread_wait) {
 		unlock(lock);
 		wait_atomic(*thread_wait);
@@ -466,8 +468,8 @@ void printDoublePhy(char *outfile, Matrix *Dist, int *N, FILE *name_file, Qseqs
 	
 	/* init */
 	D = Dist->mat;
-	chunk = 1048576;
-	lock(lock);
+	chunk = 65536;
+	lockTime(lock, 10);
 	if(!row_bias) {
 		if(format & 4) {
 			row_bias += sprintf(outfile, "# %-35s\n", method);
@@ -490,9 +492,11 @@ void printDoublePhy(char *outfile, Matrix *Dist, int *N, FILE *name_file, Qseqs
 	unlock(lock);
 	
 	while(next_i < Dist->n) {
-		lock(lock);
+		lockTime(lock, 10);
 		/* check for new row */
-		if((ltd && next_i <= next_j) || (Dist->n <= next_j)) {
+		if(Dist->n <= next_i) {
+			chunk = 0;
+		} else if((ltd && next_i <= next_j) || (Dist->n <= next_j)) {
 			i = ++next_i;
 			if(i) {
 				row_bias += (ltd ? (i - 1) : Dist->n) * 11;
@@ -557,7 +561,7 @@ void printDoublePhy(char *outfile, Matrix *Dist, int *N, FILE *name_file, Qseqs
 	}
 	
 	/* wait for matrix to finish */
-	lock(lock);
+	lockTime(lock, 10);
 	if(--*thread_wait) {
 		unlock(lock);
 		wait_atomic(*thread_wait);
@@ -620,7 +624,7 @@ char * mfile(FILE *outfile, long unsigned size) {
 		ERROR();
 	}
 	rewind(outfile);
-	outfileM = mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, fileno(outfile), 0);
+	outfileM = mmap(0, size, PROT_WRITE, MAP_SHARED, fileno(outfile), 0);
 	if(outfileM == MAP_FAILED) {
 		ERROR();
 	}
@@ -832,7 +836,9 @@ void runDist(char *templatefilename, char *outputfilename, int flag, int format,
 		free(threads);
 		threads = thread;
 	}
-	munmap(outfileM - out_size, out_size);
+	outfileM -= out_size;
+	msync(outfileM, out_size, MS_SYNC);
+	munmap(outfileM, out_size);
 	fclose(outfile);
 	fclose(name_file);
 	free(N);


=====================================
matrix.c
=====================================
@@ -148,7 +148,11 @@ void Matrix_destroy(Matrix *src) {
 
 void Matrix_mdestroy(Matrix *src) {
 	
-	munmap(*(src->mat), src->size * src->size * sizeof(int) / 2);
+	long unsigned size;
+	
+	size = src->size * (src->size - 1) * sizeof(int) / 2;
+	msync(*(src->mat), size, MS_SYNC);
+	munmap(*(src->mat), size);
 	free(src->mat);
 	free(src);
 }


=====================================
nw.c
=====================================
@@ -68,7 +68,7 @@ AlnScore NW(const long unsigned *template, const unsigned char *queryOrg, int k,
 			aligned->s[t_len] = 0;
 			memset(aligned->q, 5, t_len);
 			m = t_len;
-			nuc_pos = t_e - 1;
+			nuc_pos = (t_e ? t_e : aligned->pos) - 1;
 			while(m--) {
 				aligned->t[m] = getNuc(template, nuc_pos);
 				if(--nuc_pos < 0) {
@@ -157,7 +157,6 @@ AlnScore NW(const long unsigned *template, const unsigned char *queryOrg, int k,
 		
 		D_ptr[q_len] = (0 < k) ? 0 : (W1 + (t_len - 1 - m) * U);
 		Q_prev = (t_len + q_len) * (MM + U + W1);
-		
 		t_nuc = getNuc(template, nuc_pos);
 		for(n = q_len - 1; n >= 0; --n) {
 			E_ptr[n] = 0;
@@ -344,7 +343,7 @@ AlnScore NW_band(const long unsigned *template, const unsigned char *queryOrg, i
 			aligned->s[t_len] = 0;
 			memset(aligned->q, 5, t_len);
 			m = t_len;
-			nuc_pos = t_e - 1;
+			nuc_pos = (t_e ? t_e : aligned->pos) - 1;
 			while(m--) {
 				aligned->t[m] = getNuc(template, nuc_pos);
 				if(--nuc_pos < 0) {


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



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

-- 
View it on GitLab: https://salsa.debian.org/med-team/kma/-/commit/a5deda4a5ee6ea93c9d0732d1d955cf05160dada
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/20200902/95094ad5/attachment-0001.html>


More information about the debian-med-commit mailing list