[med-svn] [Git][med-team/kma][master] 4 commits: New upstream version 1.3.9

Nilesh Patra gitlab at salsa.debian.org
Fri Dec 4 14:40:07 GMT 2020



Nilesh Patra pushed to branch master at Debian Med / kma


Commits:
45e840d8 by Nilesh Patra at 2020-12-04T20:07:00+05:30
New upstream version 1.3.9
- - - - -
e6f4d94c by Nilesh Patra at 2020-12-04T20:07:00+05:30
routine-update: New upstream version

- - - - -
dd470a8e by Nilesh Patra at 2020-12-04T20:07:01+05:30
Update upstream source from tag 'upstream/1.3.9'

Update to upstream version '1.3.9'
with Debian dir c32ba39aa0459cdf9feb7f9e976a59e92c260cbe
- - - - -
ae65bf4d by Nilesh Patra at 2020-12-04T20:07:06+05:30
routine-update: Ready to upload to unstable

- - - - -


9 changed files:

- debian/changelog
- kma.c
- runinput.c
- runinput.h
- sparse.c
- sparse.h
- stdstat.c
- stdstat.h
- version.h


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,9 @@
+kma (1.3.9-1) unstable; urgency=medium
+
+  * New upstream version
+
+ -- Nilesh Patra <npatra974 at gmail.com>  Fri, 04 Dec 2020 20:07:06 +0530
+
 kma (1.3.8-1) unstable; urgency=medium
 
   * New upstream version


=====================================
kma.c
=====================================
@@ -132,6 +132,7 @@ static void helpMessage(int exeStatus) {
 	fprintf(helpOut, "#\t-matrix\t\tPrint assembly matrix\t\tFalse\n");
 	fprintf(helpOut, "#\t-a\t\tPrint all best mappings\t\tFalse\n");
 	fprintf(helpOut, "#\t-mp\t\tMinimum phred score\t\t20\n");
+	fprintf(helpOut, "#\t-eq\t\tMinimum avg. quality score\t0\n");
 	fprintf(helpOut, "#\t-5p\t\tCut a constant number of\n#\t\t\tnucleotides from the 5 prime.\t0\n");
 	fprintf(helpOut, "#\t-3p\t\tCut a constant number of\n#\t\t\tnucleotides from the 3 prime.\t0\n");
 	fprintf(helpOut, "#\t-Sparse\t\tOnly count kmers\t\tFalse\n");
@@ -180,11 +181,28 @@ static void helpMessage(int exeStatus) {
 
 int kma_main(int argc, char *argv[]) {
 	
-	static int minPhred, fiveClip, threeClip, ConClave, mem_mode, sparse_run;
+	static const double prob[128] = {
+		1.0000000000000000, 0.7943282347242815, 0.6309573444801932, 0.5011872336272722, 0.3981071705534972, 0.3162277660168379, 0.2511886431509580, 0.1995262314968880,
+		0.1584893192461113, 0.1258925411794167, 0.1000000000000000, 0.0794328234724281, 0.0630957344480193, 0.0501187233627272, 0.0398107170553497, 0.0316227766016838,
+		0.0251188643150958, 0.0199526231496888, 0.0158489319246111, 0.0125892541179417, 0.0100000000000000, 0.0079432823472428, 0.0063095734448019, 0.0050118723362727,
+		0.0039810717055350, 0.0031622776601684, 0.0025118864315096, 0.0019952623149689, 0.0015848931924611, 0.0012589254117942, 0.0010000000000000, 0.0007943282347243,
+		0.0006309573444802, 0.0005011872336273, 0.0003981071705535, 0.0003162277660168, 0.0002511886431510, 0.0001995262314969, 0.0001584893192461, 0.0001258925411794,
+		0.0001000000000000, 0.0000794328234724, 0.0000630957344480, 0.0000501187233627, 0.0000398107170553, 0.0000316227766017, 0.0000251188643151, 0.0000199526231497,
+		0.0000158489319246, 0.0000125892541179, 0.0000100000000000, 0.0000079432823472, 0.0000063095734448, 0.0000050118723363, 0.0000039810717055, 0.0000031622776602,
+		0.0000025118864315, 0.0000019952623150, 0.0000015848931925, 0.0000012589254118, 0.0000010000000000, 0.0000007943282347, 0.0000006309573445, 0.0000005011872336,
+		0.0000003981071706, 0.0000003162277660, 0.0000002511886432, 0.0000001995262315, 0.0000001584893192, 0.0000001258925412, 0.0000001000000000, 0.0000000794328235,
+		0.0000000630957344, 0.0000000501187234, 0.0000000398107171, 0.0000000316227766, 0.0000000251188643, 0.0000000199526231, 0.0000000158489319, 0.0000000125892541,
+		0.0000000100000000, 0.0000000079432823, 0.0000000063095734, 0.0000000050118723, 0.0000000039810717, 0.0000000031622777, 0.0000000025118864, 0.0000000019952623,
+		0.0000000015848932, 0.0000000012589254, 0.0000000010000000, 0.0000000007943282, 0.0000000006309573, 0.0000000005011872, 0.0000000003981072, 0.0000000003162278,
+		0.0000000002511886, 0.0000000001995262, 0.0000000001584893, 0.0000000001258925, 0.0000000001000000, 0.0000000000794328, 0.0000000000630957, 0.0000000000501187,
+		0.0000000000398107, 0.0000000000316228, 0.0000000000251189, 0.0000000000199526, 0.0000000000158489, 0.0000000000125893, 0.0000000000100000, 0.0000000000079433,
+		0.0000000000063096, 0.0000000000050119, 0.0000000000039811, 0.0000000000031623, 0.0000000000025119, 0.0000000000019953, 0.0000000000015849, 0.0000000000012589,
+		0.0000000000010000, 0.0000000000007943, 0.0000000000006310, 0.0000000000005012, 0.0000000000003981, 0.0000000000003162, 0.0000000000002512, 0.0000000000001995};
+	static int minPhred, minQ, fiveClip, threeClip, ConClave, mem_mode;
 	static int fileCounter, fileCounter_PE, fileCounter_INT, Ts, Tv, minlen;
 	static int extendedFeatures, spltDB, thread_num, kmersize, targetNum, mq;
 	static int ref_fsa, print_matrix, print_all, sam, vcf, Mt1, bcd, one2one;
-	static int **d, status = 0;
+	static int sparse_run, **d, status = 0;
 	static unsigned xml, nc, nf, shm, exhaustive, verbose;
 	static char *outputfilename, *templatefilename, **templatefilenames;
 	static char **inputfiles, **inputfiles_PE, **inputfiles_INT, ss;
@@ -220,6 +238,7 @@ int kma_main(int argc, char *argv[]) {
 		spltDB = 0;
 		extendedFeatures = 0;
 		minPhred = 20;
+		minQ = 0;
 		fiveClip = 0;
 		threeClip = 0;
 		sparse_run = 0;
@@ -499,6 +518,15 @@ int kma_main(int argc, char *argv[]) {
 						exit(1);
 					}
 				}
+			} else if(strcmp(argv[args], "-eq") == 0) {
+				++args;
+				if(args < argc) {
+					minQ = strtoul(argv[args], &exeBasic, 10);
+					if(*exeBasic != 0) {
+						fprintf(stderr, "# Invalid average quality score parsed\n");
+						exit(1);
+					}
+				}
 			} else if(strcmp(argv[args], "-mq") == 0) {
 				++args;
 				if(args < argc) {
@@ -896,7 +924,7 @@ int kma_main(int argc, char *argv[]) {
 			} else if(strcmp(argv[args], "-mint3") == 0) {
 				/* equivalent to:
 				-1t1, -mem_mode, -ca, -mq 1, -ref_fsa, -dense, 
-				-bcNano, -bcd 10 -bc 0.7  -vcf -ef */
+				-bcNano, -bcd 10, -bc 0.7, -vcf -ef */
 				kmerScan = &save_kmers;
 				one2one = 1;
 				mem_mode = 1;
@@ -1193,7 +1221,7 @@ int kma_main(int argc, char *argv[]) {
 				fprintf(stderr, "Interleaved information is not considered in Sparse mode.\n");
 			}
 			
-			run_input_sparse(templates, inputfiles, fileCounter, minPhred, fiveClip, threeClip, kmersize, to2Bit, ioStream);
+			run_input_sparse(templates, inputfiles, fileCounter, minPhred, minQ, fiveClip, threeClip, kmersize, to2Bit, prob, ioStream);
 			hashMapKMA_destroy(templates);
 			free(myTemplatefilename);
 		} else {
@@ -1215,17 +1243,17 @@ int kma_main(int argc, char *argv[]) {
 			
 			/* SE */
 			if(fileCounter > 0) {
-				totFrags += run_input(inputfiles, fileCounter, minPhred, fiveClip, threeClip, minlen, to2Bit, ioStream);
+				totFrags += run_input(inputfiles, fileCounter, minPhred, minQ, fiveClip, threeClip, minlen, to2Bit, prob, ioStream);
 			}
 			
 			/* PE */
 			if(fileCounter_PE > 0) {
-				totFrags += run_input_PE(inputfiles_PE, fileCounter_PE, minPhred, fiveClip, threeClip, minlen, to2Bit, ioStream);
+				totFrags += run_input_PE(inputfiles_PE, fileCounter_PE, minPhred, minQ, fiveClip, threeClip, minlen, to2Bit, prob, ioStream);
 			}
 			
 			/* INT */
 			if(fileCounter_INT > 0) {
-				totFrags += run_input_INT(inputfiles_INT, fileCounter_INT, minPhred, fiveClip, threeClip, minlen, to2Bit, ioStream);
+				totFrags += run_input_INT(inputfiles_INT, fileCounter_INT, minPhred, minQ, fiveClip, threeClip, minlen, to2Bit, prob, ioStream);
 			}
 			
 			status |= errno;


=====================================
runinput.c
=====================================
@@ -24,13 +24,14 @@
 #include "runinput.h"
 #include "qseqs.h"
 #include "seqparse.h"
+#include "stdstat.h"
 
 void (*printFsa_ptr)(Qseqs*, Qseqs*, CompDNA*, FILE*) = &printFsa;
 void (*printFsa_pair_ptr)(Qseqs*, Qseqs*, Qseqs*, Qseqs*, CompDNA*, FILE*) = &printFsa_pair;
 
-long unsigned run_input(char **inputfiles, int fileCount, int minPhred, int fiveClip, int threeClip, int minlen, char *trans, FILE *out) {
+long unsigned run_input(char **inputfiles, int fileCount, int minPhred, int minQ, int fiveClip, int threeClip, int minlen, char *trans, const double *prob, FILE *out) {
 	
-	int fileCounter, phredCut, start, end;
+	int fileCounter, phredScale, phredCut, start, end;
 	unsigned FASTQ;
 	long unsigned count;
 	char *filename;
@@ -58,9 +59,9 @@ long unsigned run_input(char **inputfiles, int fileCount, int minPhred, int five
 		/* parse the file */
 		if(FASTQ & 1) {
 			/* get phred scale */
-			phredCut = getPhredFileBuff(inputfile);
-			fprintf(stderr, "# Phred scale:\t%d\n", phredCut);
-			phredCut += minPhred;
+			phredScale = getPhredFileBuff(inputfile);
+			fprintf(stderr, "# Phred scale:\t%d\n", phredScale);
+			phredCut = phredScale + minPhred;
 			
 			/* parse reads */
 			while(FileBuffgetFq(inputfile, header, qseq, qual, trans)) {
@@ -85,7 +86,7 @@ long unsigned run_input(char **inputfiles, int fileCount, int minPhred, int five
 				*/
 				qseq->len = end - start;
 				/* print */
-				if(qseq->len > minlen) {
+				if(qseq->len > minlen && minQ <= eQual(seq + start, qseq->len, minQ, prob - phredScale)) {
 					/* dump seq */
 					qseq->seq += start;
 					printFsa_ptr(header, qseq, compressor, out);
@@ -134,13 +135,14 @@ long unsigned run_input(char **inputfiles, int fileCount, int minPhred, int five
 	return count;
 }
 
-long unsigned run_input_PE(char **inputfiles, int fileCount, int minPhred, int fiveClip, int threeClip, int minlen, char *trans, FILE *out) {
+long unsigned run_input_PE(char **inputfiles, int fileCount, int minPhred, int minQ, int fiveClip, int threeClip, int minlen, char *trans, const double *prob, FILE *out) {
 	
-	int fileCounter, phredCut, start, start2, end;
+	int fileCounter, phredScale, phredCut, start, start2, end;
 	unsigned FASTQ, FASTQ2;
 	long unsigned count;
 	char *filename;
 	unsigned char *seq;
+	double eq1, eq2;
 	Qseqs *header, *qseq, *qual, *header2, *qseq2, *qual2;
 	FileBuff *inputfile, *inputfile2;
 	CompDNA *compressor;
@@ -179,12 +181,12 @@ long unsigned run_input_PE(char **inputfiles, int fileCount, int minPhred, int f
 		/* parse the file */
 		if(FASTQ & 1) {
 			/* get phred scale */
-			phredCut = getPhredFileBuff(inputfile);
-			if(phredCut == 0) {
-				phredCut = getPhredFileBuff(inputfile2);
+			phredScale = getPhredFileBuff(inputfile);
+			if(phredScale == 0) {
+				phredScale = getPhredFileBuff(inputfile2);
 			}
-			fprintf(stderr, "# Phred scale:\t%d\n", phredCut);
-			phredCut += minPhred;
+			fprintf(stderr, "# Phred scale:\t%d\n", phredScale);
+			phredCut = phredScale + minPhred;
 			
 			/* parse reads */
 			//while(FileBuffgetFq(inputfile, header, qseq, qual) && FileBuffgetFq(inputfile2, header2, qseq2, qual2)) {
@@ -210,6 +212,7 @@ long unsigned run_input_PE(char **inputfiles, int fileCount, int minPhred, int f
 				}
 				*/
 				qseq->len = end - start;
+				eq1 = eQual(seq + start, qseq->len, minQ, prob - phredScale);
 				
 				/* trim reverse */
 				seq = qual2->seq;
@@ -230,21 +233,22 @@ long unsigned run_input_PE(char **inputfiles, int fileCount, int minPhred, int f
 				}
 				*/
 				qseq2->len = end - start2;
+				eq2 = eQual(seq + start2, qseq2->len, minQ, prob - phredScale);
 				
 				/* print */
-				if(qseq->len > minlen && qseq2->len > minlen) {
+				if(qseq->len > minlen && qseq2->len > minlen && minQ <= eq1 && minQ <= eq2) {
 					qseq->seq += start;
 					qseq2->seq += start2;
 					printFsa_pair_ptr(header, qseq, header2, qseq2, compressor, out);
 					qseq->seq -= start;
 					qseq2->seq -= start2;
 					++count;
-				} else if(qseq->len > minlen) {
+				} else if(qseq->len > minlen && minQ <= eq1) {
 					qseq->seq += start;
 					printFsa_ptr(header, qseq, compressor, out);
 					qseq->seq -= start;
 					++count;
-				} else if(qseq2->len > minlen) {
+				} else if(qseq2->len > minlen && minQ <= eq2) {
 					qseq2->seq += start2;
 					printFsa_ptr(header2, qseq2, compressor, out);
 					qseq2->seq -= start2;
@@ -328,13 +332,14 @@ long unsigned run_input_PE(char **inputfiles, int fileCount, int minPhred, int f
 	return count;
 }
 
-long unsigned run_input_INT(char **inputfiles, int fileCount, int minPhred, int fiveClip, int threeClip, int minlen, char *trans, FILE *out) {
+long unsigned run_input_INT(char **inputfiles, int fileCount, int minPhred, int minQ, int fiveClip, int threeClip, int minlen, char *trans, const double *prob, FILE *out) {
 	
-	int fileCounter, phredCut, start, start2, end;
+	int fileCounter, phredScale, phredCut, start, start2, end;
 	unsigned FASTQ;
 	long unsigned count;
 	char *filename;
 	unsigned char *seq;
+	double eq1, eq2;
 	Qseqs *header, *qseq, *qual, *header2, *qseq2, *qual2;
 	FileBuff *inputfile;
 	CompDNA *compressor;
@@ -365,9 +370,9 @@ long unsigned run_input_INT(char **inputfiles, int fileCount, int minPhred, int
 		/* parse the file */
 		if(FASTQ & 1) {
 			/* get phred scale */
-			phredCut = getPhredFileBuff(inputfile);
-			fprintf(stderr, "# Phred scale:\t%d\n", phredCut);
-			phredCut += minPhred;
+			phredScale = getPhredFileBuff(inputfile);
+			fprintf(stderr, "# Phred scale:\t%d\n", phredScale);
+			phredCut = phredScale + minPhred;
 			
 			/* parse reads */
 			while((FileBuffgetFq(inputfile, header, qseq, qual, trans) | FileBuffgetFq(inputfile, header2, qseq2, qual2, trans))) {
@@ -391,6 +396,7 @@ long unsigned run_input_INT(char **inputfiles, int fileCount, int minPhred, int
 				}
 				*/
 				qseq->len = end - start;
+				eq1 = eQual(seq + start, qseq->len, minQ, prob - phredScale);
 				
 				/* trim reverse */
 				seq = qual2->seq;
@@ -411,21 +417,22 @@ long unsigned run_input_INT(char **inputfiles, int fileCount, int minPhred, int
 				}
 				*/
 				qseq2->len = end - start2;
+				eq2 = eQual(seq + start2, qseq2->len, minQ, prob - phredScale);
 				
 				/* print */
-				if(qseq->len > minlen && qseq2->len > minlen) {
+				if(qseq->len > minlen && qseq2->len > minlen && minQ <= eq1 && minQ <= eq2) {
 					qseq->seq += start;
 					qseq2->seq += start2;
 					printFsa_pair_ptr(header, qseq, header2, qseq2, compressor, out);
 					qseq->seq -= start;
 					qseq2->seq -= start2;
 					++count;
-				} else if(qseq->len > minlen) {
+				} else if(qseq->len > minlen && minQ <= eq1) {
 					qseq->seq += start;
 					printFsa_ptr(header, qseq, compressor, out);
 					qseq->seq -= start;
 					++count;
-				} else if(qseq2->len > minlen) {
+				} else if(qseq2->len > minlen && minQ <= eq2) {
 					qseq2->seq += start2;
 					printFsa_ptr(header2, qseq2, compressor, out);
 					qseq2->seq -= start2;


=====================================
runinput.h
=====================================
@@ -23,9 +23,9 @@
 /* pointers determining how to deliver the input */
 extern void (*printFsa_ptr)(Qseqs*, Qseqs*, CompDNA*, FILE*);
 extern void (*printFsa_pair_ptr)(Qseqs*, Qseqs*, Qseqs*, Qseqs*, CompDNA*, FILE*);
-long unsigned run_input(char **inputfiles, int fileCount, int minPhred, int fiveClip, int threeClip, int minlen, char *trans, FILE *out);
-long unsigned run_input_PE(char **inputfiles, int fileCount, int minPhred, int fiveClip, int threeClip, int minlen, char *trans, FILE *out);
-long unsigned run_input_INT(char **inputfiles, int fileCount, int minPhred, int fiveClip, int threeClip, int minlen, char *trans, FILE *out);
+long unsigned run_input(char **inputfiles, int fileCount, int minPhred, int minQ, int fiveClip, int threeClip, int minlen, char *trans, const double *prob, FILE *out);
+long unsigned run_input_PE(char **inputfiles, int fileCount, int minPhred, int minQ, int fiveClip, int threeClip, int minlen, char *trans, const double *prob, FILE *out);
+long unsigned run_input_INT(char **inputfiles, int fileCount, int minPhred, int minQ, int fiveClip, int threeClip, int minlen, char *trans, const double *prob, FILE *out);
 void bootFsa(Qseqs *header, Qseqs *qseq, CompDNA *compressor, FILE *out);
 void printFsa(Qseqs *header, Qseqs *qseq, CompDNA *compressor, FILE *out);
 void printFsa_pair(Qseqs *header, Qseqs *qseq, Qseqs *header_r, Qseqs *qseq_r, CompDNA *compressor, FILE *out);


=====================================
sparse.c
=====================================
@@ -226,9 +226,9 @@ void save_kmers_sparse(const HashMapKMA *templates, HashMap_kmers *foundKmers, C
 	}
 }
 
-void run_input_sparse(const HashMapKMA *templates, char **inputfiles, int fileCount, int minPhred, int fiveClip, int threeClip, int kmersize, char *trans, FILE *out) {
+void run_input_sparse(const HashMapKMA *templates, char **inputfiles, int fileCount, int minPhred, int minQ, int fiveClip, int threeClip, int kmersize, char *trans, const double *prob, FILE *out) {
 	
-	int FASTQ, fileCounter, phredCut, start, end;
+	int FASTQ, fileCounter, phredScale, phredCut, start, end;
 	char *filename;
 	unsigned char *seq;
 	Qseqs *qseq, *qual;
@@ -254,9 +254,9 @@ void run_input_sparse(const HashMapKMA *templates, char **inputfiles, int fileCo
 		Kmers->n = 0;
 		if(FASTQ & 1) {
 			/* get phred scale */
-			phredCut = getPhredFileBuff(inputfile);
-			fprintf(stderr, "# Phred scale:\t%d\n", phredCut);
-			phredCut += minPhred;
+			phredScale = getPhredFileBuff(inputfile);
+			fprintf(stderr, "# Phred scale:\t%d\n", phredScale);
+			phredCut = phredScale + minPhred;
 			
 			/* parse reads */
 			while(FileBuffgetFqSeq(inputfile, qseq, qual, trans)) {
@@ -275,7 +275,7 @@ void run_input_sparse(const HashMapKMA *templates, char **inputfiles, int fileCo
 				qseq->len = end - start;
 				
 				/* print */
-				if(qseq->len > kmersize) {
+				if(qseq->len > kmersize && minQ <= eQual(seq + start, qseq->len, minQ, prob - phredScale)) {
 					/* translate to kmers */
 					Kmers->n = translateToKmersAndDump(Kmers->kmers, Kmers->n, Kmers->size, qseq->seq + start, qseq->len, kmersize, templates->mask, templates->prefix, templates->prefix_len, out);
 				}


=====================================
sparse.h
=====================================
@@ -24,5 +24,5 @@
 int translateToKmersAndDump(long unsigned *Kmers, int n, int max, unsigned char *qseq, int seqlen, int kmersize, long unsigned mask, long unsigned prefix, int prefix_len, FILE *out);
 char ** load_DBs_Sparse(char *templatefilename, unsigned **template_lengths, unsigned **template_ulengths, unsigned shm);
 void save_kmers_sparse(const HashMapKMA *templates, HashMap_kmers *foundKmers, CompKmers *compressor);
-void run_input_sparse(const HashMapKMA *templates, char **inputfiles, int fileCount, int minPhred, int fiveClip, int threeClip, int kmersize, char *trans, FILE *out);
+void run_input_sparse(const HashMapKMA *templates, char **inputfiles, int fileCount, int minPhred, int minQ, int fiveClip, int threeClip, int kmersize, char *trans, const double *prob, FILE *out);
 int save_kmers_sparse_batch(char *templatefilename, char *outputfilename, char *exePrev, int ID_t, double evalue, char ss, unsigned shm);


=====================================
stdstat.c
=====================================
@@ -210,3 +210,68 @@ unsigned minimum(unsigned *src, unsigned n) {
 	
 	return min;
 }
+
+/*
+double eQual(unsigned char *qual, int len, int phredScale, int minQ) {
+	
+	//E(Q) = -10 * log_10(sum(10^(-Q/10)) / |Q|) 
+	unsigned i;
+	double sum;
+	
+	if(!len || !minQ) {
+		return 0;
+	}
+	
+	// sum quality scores
+	i = len;
+	sum = pow(10, (phredScale - *qual) / 10.0);
+	while(--i) {
+		sum += pow(10, (phredScale - *++qual) / 10.0);
+	}
+	
+	// return average
+	return -10 * log10(((double)(sum)) / len);
+}
+*/
+
+double eQual(unsigned char *qual, const int len, const int minQ, const double *prob) {
+	
+	/*
+	static const double prob[128] = {
+		1.0000000000000000, 0.7943282347242815, 0.6309573444801932, 0.5011872336272722, 0.3981071705534972, 0.3162277660168379, 0.2511886431509580, 0.1995262314968880,
+		0.1584893192461113, 0.1258925411794167, 0.1000000000000000, 0.0794328234724281, 0.0630957344480193, 0.0501187233627272, 0.0398107170553497, 0.0316227766016838,
+		0.0251188643150958, 0.0199526231496888, 0.0158489319246111, 0.0125892541179417, 0.0100000000000000, 0.0079432823472428, 0.0063095734448019, 0.0050118723362727,
+		0.0039810717055350, 0.0031622776601684, 0.0025118864315096, 0.0019952623149689, 0.0015848931924611, 0.0012589254117942, 0.0010000000000000, 0.0007943282347243,
+		0.0006309573444802, 0.0005011872336273, 0.0003981071705535, 0.0003162277660168, 0.0002511886431510, 0.0001995262314969, 0.0001584893192461, 0.0001258925411794,
+		0.0001000000000000, 0.0000794328234724, 0.0000630957344480, 0.0000501187233627, 0.0000398107170553, 0.0000316227766017, 0.0000251188643151, 0.0000199526231497,
+		0.0000158489319246, 0.0000125892541179, 0.0000100000000000, 0.0000079432823472, 0.0000063095734448, 0.0000050118723363, 0.0000039810717055, 0.0000031622776602,
+		0.0000025118864315, 0.0000019952623150, 0.0000015848931925, 0.0000012589254118, 0.0000010000000000, 0.0000007943282347, 0.0000006309573445, 0.0000005011872336,
+		0.0000003981071706, 0.0000003162277660, 0.0000002511886432, 0.0000001995262315, 0.0000001584893192, 0.0000001258925412, 0.0000001000000000, 0.0000000794328235,
+		0.0000000630957344, 0.0000000501187234, 0.0000000398107171, 0.0000000316227766, 0.0000000251188643, 0.0000000199526231, 0.0000000158489319, 0.0000000125892541,
+		0.0000000100000000, 0.0000000079432823, 0.0000000063095734, 0.0000000050118723, 0.0000000039810717, 0.0000000031622777, 0.0000000025118864, 0.0000000019952623,
+		0.0000000015848932, 0.0000000012589254, 0.0000000010000000, 0.0000000007943282, 0.0000000006309573, 0.0000000005011872, 0.0000000003981072, 0.0000000003162278,
+		0.0000000002511886, 0.0000000001995262, 0.0000000001584893, 0.0000000001258925, 0.0000000001000000, 0.0000000000794328, 0.0000000000630957, 0.0000000000501187,
+		0.0000000000398107, 0.0000000000316228, 0.0000000000251189, 0.0000000000199526, 0.0000000000158489, 0.0000000000125893, 0.0000000000100000, 0.0000000000079433,
+		0.0000000000063096, 0.0000000000050119, 0.0000000000039811, 0.0000000000031623, 0.0000000000025119, 0.0000000000019953, 0.0000000000015849, 0.0000000000012589,
+		0.0000000000010000, 0.0000000000007943, 0.0000000000006310, 0.0000000000005012, 0.0000000000003981, 0.0000000000003162, 0.0000000000002512, 0.0000000000001995};
+	*/
+	/*
+	E(Q) = -10 * log_10(sum(10^(-Q/10)) / |Q|) 
+	*/
+	unsigned i;
+	double sum;
+	
+	if(!len || !minQ) {
+		return 0;
+	}
+	
+	/* sum quality scores */
+	i = len;
+	sum = prob[*qual];
+	while(--i) {
+		sum += prob[*++qual];
+	}
+	
+	/* return average */
+	return -10 * log10(sum / len);
+}


=====================================
stdstat.h
=====================================
@@ -28,3 +28,4 @@ double p_chisqr(long double q);
 double power(double x, unsigned n);
 double binP(int n, int k, double p);
 unsigned minimum(unsigned *src, unsigned n);
+double eQual(unsigned char *qual, const int len, const int minQ, const double *prob);


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



View it on GitLab: https://salsa.debian.org/med-team/kma/-/compare/a3facd248fedfc706c034337f7a1082c164f5c6b...ae65bf4d61b9d349d2bdbd6797e5e7efd35e0b24

-- 
View it on GitLab: https://salsa.debian.org/med-team/kma/-/compare/a3facd248fedfc706c034337f7a1082c164f5c6b...ae65bf4d61b9d349d2bdbd6797e5e7efd35e0b24
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/20201204/15f2e6a7/attachment-0001.html>


More information about the debian-med-commit mailing list