[med-svn] [Git][med-team/kma][master] 6 commits: routine-update: New upstream version

Lance Lin (@linqigang) gitlab at salsa.debian.org
Thu Jan 12 14:54:07 GMT 2023



Lance Lin pushed to branch master at Debian Med / kma


Commits:
31ce0d77 by Lance Lin at 2023-01-12T21:14:33+07:00
routine-update: New upstream version

- - - - -
b4956cdf by Lance Lin at 2023-01-12T21:14:42+07:00
New upstream version 1.4.10
- - - - -
2b2928ec by Lance Lin at 2023-01-12T21:14:42+07:00
Update upstream source from tag 'upstream/1.4.10'

Update to upstream version '1.4.10'
with Debian dir 14e32467fbd35c9288ac7a4828160b3aa056ea7d
- - - - -
457a6c53 by Lance Lin at 2023-01-12T21:14:42+07:00
routine-update: Standards-Version: 4.6.2

- - - - -
18a077b5 by Lance Lin at 2023-01-12T21:15:30+07:00
routine-update: Ready to upload to unstable

- - - - -
8abb01c8 by Lance Lin at 2023-01-12T21:50:41+07:00
Update to new upstream version 1.4.10

- - - - -


8 changed files:

- compress.c
- debian/changelog
- debian/control
- debian/copyright
- debian/patches/blhc.patch
- debian/upstream/metadata
- dist.c
- version.h


Changes:

=====================================
compress.c
=====================================
@@ -659,7 +659,7 @@ HashMapKMA * compressKMA_megaDB(HashMap *templates, FILE *out) {
 	fprintf(stderr, "# Calculating relative indexes.\n");
 	null_index = finalDB->n;
 	v_index = 0;
-	while(templates->values[v_index] != 0) {
+	while(v_index != finalDB->size && templates->values[v_index] != 0) {
 		finalDB->exist[v_index] = v_index;
 		++v_index;
 	}
@@ -673,6 +673,7 @@ HashMapKMA * compressKMA_megaDB(HashMap *templates, FILE *out) {
 			finalDB->exist[i] = null_index;
 		}
 	}
+	
 	/* decrease size of values to what is actually used */
 	templates->values = realloc(templates->values, templates->n * sizeof(unsigned *));
 	if(!templates->values) {


=====================================
debian/changelog
=====================================
@@ -1,3 +1,14 @@
+kma (1.4.10-1) unstable; urgency=medium
+
+  * Team upload.
+  * New upstream version
+  * Standards-Version: 4.6.2 (routine-update)
+  * d/copyright: Update debian copyright year to 2023
+  * d/patches/blhc.patch: Add Forwarded field
+  * d/upstream/metadata: Add Bug-Database and Bug-Submit fields
+
+ -- Lance Lin <lq27267 at gmail.com>  Thu, 12 Jan 2023 21:15:30 +0700
+
 kma (1.4.8-1) unstable; urgency=medium
 
   * Team upload.


=====================================
debian/control
=====================================
@@ -5,7 +5,7 @@ Section: science
 Priority: optional
 Build-Depends: debhelper-compat (= 13),
                zlib1g-dev
-Standards-Version: 4.6.1
+Standards-Version: 4.6.2
 Vcs-Browser: https://salsa.debian.org/med-team/kma
 Vcs-Git: https://salsa.debian.org/med-team/kma.git
 Homepage: https://bitbucket.org/genomicepidemiology/kma


=====================================
debian/copyright
=====================================
@@ -8,7 +8,7 @@ Copyright: 2015-2017, Philip Clausen, Technical University of Denmark
 License: Apache-2.0
 
 Files: debian/*
-Copyright: 2018 Andreas Tille <tille at debian.org>
+Copyright: 2023 Andreas Tille <tille at debian.org>
 License: Apache-2.0
 
 License: Apache-2.0


=====================================
debian/patches/blhc.patch
=====================================
@@ -1,5 +1,6 @@
 Description: Propagate CPPFLAGS into Makefile
 Author: Nilesh Patra <nilesh at debian.org>
+Forwarded: yes
 Last-Update: 2021-04-14
 --- a/Makefile
 +++ b/Makefile


=====================================
debian/upstream/metadata
=====================================
@@ -20,3 +20,6 @@ Registry:
  - Name: conda:bioconda
    Entry: kma
 Repository: https://bitbucket.org/genomicepidemiology/kma
+Bug-Database: https://bitbucket.org/genomicepidemiology/kma/issues?status=new&status=open
+Bug-Submit: https://bitbucket.org/genomicepidemiology/kma/issues/new
+


=====================================
dist.c
=====================================
@@ -19,6 +19,7 @@
 
 #define _XOPEN_SOURCE 600
 #include <limits.h>
+#include <math.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -318,7 +319,8 @@ void kmerSimilarity_thread(HashMapKMA *DB, Matrix *Dist, int *N, int thread_num,
 }
 
 int kmerDist(int Ni, int Nj, int D) {
-	return Ni + Nj - (D << 1);
+	D = Ni + Nj - (D << 1);
+	return (D < 0) ? 0 : D;
 }
 
 int kmerShared(int Ni, int Nj, int D) {
@@ -326,8 +328,9 @@ int kmerShared(int Ni, int Nj, int D) {
 }
 
 int chi2dist(int Ni, int Nj, int D) {
-	D = (Ni + Nj - (D << 1));
-	return D * D / (Ni + Nj);
+	long d = (Ni + Nj - (D << 1));
+	d = d * d / (Ni + Nj);
+	return (d < 0) ? 0 : d;
 }
 
 void printIntLtdPhy(char *outfile, Matrix *Dist, int *N, FILE *name_file, Qseqs *template_name, unsigned format, int thread_num, volatile int *lock, const char *method, int (*distPtr)(int, int, int)) {
@@ -336,7 +339,7 @@ void printIntLtdPhy(char *outfile, Matrix *Dist, int *N, FILE *name_file, Qseqs
 	static int next_i, next_j, entrance = 0;
 	static long unsigned row_bias = 0;
 	volatile int *thread_wait;
-	int i, j, j_end, chunk, N_i, *Nj, **D, *Di;
+	int i, j, j_end, d, chunk, N_i, *Nj, **D, *Di;
 	char *outfile_chunk, *name;
 	
 	/* init */
@@ -402,7 +405,8 @@ void printIntLtdPhy(char *outfile, Matrix *Dist, int *N, FILE *name_file, Qseqs
 			Di = D[i] + --j;
 			Nj = N + j;
 			while(++j < j_end) {
-				outfile_chunk += sprintf(outfile_chunk, "\t%10d", distPtr(N_i, *++Nj, *++Di));
+				d = distPtr(N_i, *++Nj, *++Di);
+				outfile_chunk += sprintf(outfile_chunk, "\t%10d", (d < 0 ? 0 : d));
 			}
 			/* fix null character */
 			*outfile_chunk = (j == i) ? '\n' : '\t';
@@ -422,43 +426,53 @@ void printIntLtdPhy(char *outfile, Matrix *Dist, int *N, FILE *name_file, Qseqs
 }
 
 double kmerQuery(int Ni, int Nj, int D) {
-	return 100.0 * D / Ni;
+	double d = 100.0 * D / Ni;
+	return (d < 0) ? 0.0 : ((100 < d) ? 100.0 : d);
 }
 
 double kmerTemplate(int Ni, int Nj, int D) {
-	return 100.0 * D / Nj;
+	double d = 100.0 * D / Nj;
+	return (d < 0) ? 0.0 : ((100 < d) ? 100.0 : d);
 }
 
 double kmerAvg(int Ni, int Nj, int D) {
-	return 200.0 * D / (Ni + Nj);
+	double d = 200.0 * D / (Ni + Nj);
+	return (d < 0) ? 0.0 : ((100 < d) ? 100.0 : d);
 }
 
 double kmerInvAvg(int Ni, int Nj, int D) {
-	return 100.0 - 200.0 * D / (Ni + Nj);
+	double d = 100.0 - 200.0 * D / (Ni + Nj);
+	return (d < 0) ? 0.0 : ((100 < d) ? 100.0 : d);
 }
 
 double kmerJaccardDist(int Ni, int Nj, int D) {
-	return 1.0 - (double)(D) / (Ni + Nj - D);
+	double d = 1.0 - (double)(D) / (Ni + Nj - D);
+	return (d < 0) ? 0.0 : ((1 < d) ? 1.0 : d);
 }
 
 double kmerJaccardSim(int Ni, int Nj, int D) {
-	return (double)(D) / (Ni + Nj - D);
+	double d = (double)(D) / (Ni + Nj - D);
+	return (d < 0) ? 0.0 : ((1 < d) ? 1.0 : d);
 }
 
 double kmerCosineDist(int Ni, int Nj, int D) {
-	return 1.0 - (double)(D) / (Ni + Nj);
+	double d = 1.0 - (double)(D) / (sqrt(Ni) * sqrt(Nj));
+	return (d < 0) ? 0.0 : ((1 < d) ? 1.0 : d);
 }
 
 double kmerCosineSim(int Ni, int Nj, int D) {
-	return (double)(D) / (Ni + Nj);
+	double d = (double)(D) / (sqrt(Ni) * sqrt(Nj));
+	return (d < 0) ? 0.0 : ((1 < d) ? 1.0 : d);
 }
 
 double kmerOverlapCoef(int Ni, int Nj, int D) {
-	return (double)(D) / (Ni < Nj ? Ni : Nj);
+	double d = (double)(D) / (Ni < Nj ? Ni : Nj);
+	return (d < 0) ? 0.0 : ((1 < d) ? 1.0 : d);
 }
 
 double kmerInvOverlapCoef(int Ni, int Nj, int D) {
-	return 1.0 - (double)(D) / (Ni < Nj ? Ni : Nj);
+	double d = 1.0 - (double)(D) / (Ni < Nj ? Ni : Nj);
+	return (d < 0) ? 0.0 : ((1 < d) ? 1.0 : d);
 }
 
 void printDoublePhy(char *outfile, Matrix *Dist, int *N, FILE *name_file, Qseqs *template_name, unsigned format, const char *formatString, int ltd, int thread_num, volatile int *lock, const char *method, double (*distPtr)(int, int, int)) {
@@ -469,6 +483,7 @@ void printDoublePhy(char *outfile, Matrix *Dist, int *N, FILE *name_file, Qseqs
 	volatile int *thread_wait;
 	int i, j, j_end, chunk, N_i, *Nj, **D, *Di;
 	char endChar, *outfile_chunk, *name;
+	double d;
 	
 	/* init */
 	D = Dist->mat;
@@ -541,18 +556,22 @@ void printDoublePhy(char *outfile, Matrix *Dist, int *N, FILE *name_file, Qseqs
 			
 			if(j_end < i) {
 				while(++j < j_end) {
-					outfile_chunk += sprintf(outfile_chunk, formatString, distPtr(N_i, *++Nj, *++Di));
+					d = distPtr(N_i, *++Nj, *++Di);
+					outfile_chunk += sprintf(outfile_chunk, formatString, (d < 0 ? 0 : d));
 				}
 			} else if(i < j) {
 				while(++j < j_end) {
-					outfile_chunk += sprintf(outfile_chunk, formatString, distPtr(N_i, *++Nj, D[j][i]));
+					d = distPtr(N_i, *++Nj, D[j][i]);
+					outfile_chunk += sprintf(outfile_chunk, formatString, (d < 0 ? 0 : d));
 				}
 			} else {
 				while(++j < j_end) {
 					if(j < i) {
-						outfile_chunk += sprintf(outfile_chunk, formatString, distPtr(N_i, *++Nj, *++Di));
+						d = distPtr(N_i, *++Nj, *++Di);
+						outfile_chunk += sprintf(outfile_chunk, formatString, (d < 0 ? 0 : d));
 					} else if(i < j) {
-						outfile_chunk += sprintf(outfile_chunk, formatString, distPtr(N_i, *++Nj, D[j][i]));
+						d = distPtr(N_i, *++Nj, D[j][i]);
+						outfile_chunk += sprintf(outfile_chunk, formatString, (d < 0 ? 0 : d));
 					} else {
 						outfile_chunk += sprintf(outfile_chunk, formatString, 100.0);
 						++Nj;
@@ -944,7 +963,7 @@ int dist_main(int argc, char *argv[]) {
 				fprintf(stdout, "#%9d\t%s\n", 256, "Cosine distance");
 				fprintf(stdout, "#%9d\t%s\n", 512, "Cosine similarity");
 				fprintf(stdout, "#%9d\t%s\n", 1024, "Szymkiewicz–Simpson similarity");
-				fprintf(stdout, "#%9d\t%s\n", 2048, "Szymkiewicz–Simpson distance");
+				fprintf(stdout, "#%9d\t%s\n", 2048, "Szymkiewicz–Simpson dissimilarity");
 				fprintf(stdout, "#%9d\t%s\n", 4096, "Chi-square distance");
 				fprintf(stdout, "#\n");
 				return 0;


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



View it on GitLab: https://salsa.debian.org/med-team/kma/-/compare/db6e46023ae878261b9d66dbb493ea2cbb75b94c...8abb01c868a622ecb0d2d76987350483a62fcfe6

-- 
View it on GitLab: https://salsa.debian.org/med-team/kma/-/compare/db6e46023ae878261b9d66dbb493ea2cbb75b94c...8abb01c868a622ecb0d2d76987350483a62fcfe6
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/20230112/b3b8ba1d/attachment-0001.htm>


More information about the debian-med-commit mailing list