[med-svn] [Git][med-team/kma][upstream] New upstream version 1.3.15
Nilesh Patra
gitlab at salsa.debian.org
Sat May 1 17:54:48 BST 2021
Nilesh Patra pushed to branch upstream at Debian Med / kma
Commits:
205feb04 by Nilesh Patra at 2021-05-01T22:19:55+05:30
New upstream version 1.3.15
- - - - -
7 changed files:
- dist.c
- kma.c
- matrix.c
- runkma.c
- stdstat.c
- stdstat.h
- version.h
Changes:
=====================================
dist.c
=====================================
@@ -150,7 +150,7 @@ HashMapKMA * loadValues(const char *filename) {
fclose(file);
return 0;
}
- dest->exist_l = (long unsigned *)(dest->value_index);
+ dest->exist_l = (long unsigned *)(dest->exist);
fclose(file);
return dest;
=====================================
kma.c
=====================================
@@ -157,6 +157,7 @@ static void helpMessage(int exeStatus) {
fprintf(helpOut, "#\t-bcd\t\tMinimum depth at base\t\t1\n");
fprintf(helpOut, "#\t-bcg\t\tMaintain insignificant gaps\n");
fprintf(helpOut, "#\t-and\t\tBoth mrs and p_value thresholds\n#\t\t\thas to reached to in order to\n#\t\t\treport a template hit.\t\tor\n");
+ fprintf(helpOut, "#\t-oa\t\tOutput all, disregard mrs and p-value\n#\t\t\twhen reporting a template hit\tFalse\n");
fprintf(helpOut, "#\t-mq\t\tMinimum mapping quality\t\t0\n");
fprintf(helpOut, "#\t-mrs\t\tMinimum alignment score,\n#\t\t\tnormalized to alignment length\t0.50\n");
fprintf(helpOut, "#\t-mrc\t\tMinimum read coverage\t\t0.10\n");
@@ -815,6 +816,9 @@ int kma_main(int argc, char *argv[]) {
}
} else if(strcmp(argv[args], "-and") == 0) {
cmp = &cmp_and;
+ } else if(strcmp(argv[args], "-oa") == 0) {
+ cmp = &cmp_true;
+ ID_t = 0.0;
} else if(strcmp(argv[args], "-boot") == 0) {
printFsa_ptr = &bootFsa;
} else if(strcmp(argv[args], "-Mt1") == 0) {
=====================================
matrix.c
=====================================
@@ -30,13 +30,17 @@
Matrix * matrix_init(unsigned size) {
int i, **ptr, *src;
+ long unsigned Size;
Matrix *dest;
dest = smalloc(sizeof(Matrix));
dest->n = 0;
dest->size = size;
dest->mat = smalloc(size * sizeof(int *));
- *(dest->mat) = smalloc(size * size * sizeof(int));
+ Size = size;
+ Size *= size;
+ Size *= sizeof(int);
+ *(dest->mat) = smalloc(Size);
/* set matrix rows */
ptr = dest->mat;
@@ -54,13 +58,17 @@ Matrix * matrix_init(unsigned size) {
Matrix * ltdMatrix_init(unsigned size) {
int i, **ptr, *src;
+ long unsigned Size;
Matrix *dest;
dest = smalloc(sizeof(Matrix));
dest->n = 0;
dest->size = size;
dest->mat = smalloc(size * sizeof(int *));
- *(dest->mat) = calloc(size * (size - 1) / 2, sizeof(int));
+ Size = size;
+ Size *= (size - 1);
+ Size *= (sizeof(int) / 2);
+ *(dest->mat) = calloc(Size, 1);
if(!*(dest->mat)) {
ERROR();
}
@@ -120,8 +128,12 @@ Matrix * ltdMatrix_minit(long unsigned size) {
void ltdMatrix_realloc(Matrix *src, unsigned size) {
int i, **ptr, *mat;
+ long unsigned Size;
- *(src->mat) = realloc(*(src->mat), size * (size - 1) * sizeof(int) / 2);
+ Size = size;
+ Size *= (size - 1);
+ Size *= (sizeof(int) / 2);
+ *(src->mat) = realloc(*(src->mat), Size);
src->mat = realloc(src->mat, size * sizeof(int *));
if(!src->mat || !*(src->mat)) {
ERROR();
@@ -150,7 +162,9 @@ void Matrix_mdestroy(Matrix *src) {
long unsigned size;
- size = src->size * (src->size - 1) * sizeof(int) / 2;
+ size = src->size;
+ size *= (src->size - 1);
+ size *= sizeof(int) / 2;
msync(*(src->mat), size, MS_SYNC);
munmap(*(src->mat), size);
free(src->mat);
=====================================
runkma.c
=====================================
@@ -805,7 +805,7 @@ int runKMA(char *templatefilename, char *outputfilename, char *exePrev, int ConC
t_len = template_lengths[template];
//expected = (Nhits - read_score) * (1.0 * t_len) / (template_tot_ulen - t_len + etta);
expected = t_len;
- expected /= (template_tot_ulen - t_len);
+ expected /= MAX(1,(template_tot_ulen - t_len));
expected *= (Nhits - read_score);
//q_value = pow(read_score - expected, 2) / (expected + read_score + etta);
q_value = read_score - expected;
@@ -1202,7 +1202,7 @@ int runKMA(char *templatefilename, char *outputfilename, char *exePrev, int ConC
read_score = w_scores[template];
t_len = template_lengths[template];
expected = t_len;
- expected /= (template_tot_ulen - t_len);
+ expected /= MAX(1, (template_tot_ulen - t_len));
expected *= (Nhits - read_score);
if(0 < expected) {
q_value = read_score - expected;
@@ -1896,7 +1896,7 @@ int runKMA_MEM(char *templatefilename, char *outputfilename, char *exePrev, int
t_len = template_lengths[template];
//expected = (Nhits - read_score) * (t_len / (template_tot_ulen - t_len + etta));
expected = t_len;
- expected /= (template_tot_ulen - t_len);
+ expected /= MAX(1, (template_tot_ulen - t_len));
expected *= (Nhits - read_score);
//q_value = pow(read_score - expected, 2) / (expected + read_score + etta);
q_value = read_score - expected;
@@ -2357,7 +2357,7 @@ int runKMA_MEM(char *templatefilename, char *outputfilename, char *exePrev, int
read_score = w_scores[template];
t_len = template_lengths[template];
expected = t_len;
- expected /= (template_tot_ulen - t_len);
+ expected /= MAX(1, (template_tot_ulen - t_len));
expected *= (Nhits - read_score);
if(0 < expected) {
q_value = read_score - expected;
=====================================
stdstat.c
=====================================
@@ -30,6 +30,10 @@ int cmp_and(int t, int q) {
return (t && q);
}
+int cmp_true(int t, int q) {
+ return 1;
+}
+
double fastp(long double q) {
/* P-value from quantile in a chi-square distribution */
double p = 1.0;
=====================================
stdstat.h
=====================================
@@ -23,6 +23,7 @@
extern int (*cmp)(int, int);
int cmp_or(int t, int q);
int cmp_and(int t, int q);
+int cmp_true(int t, int q);
double fastp(long double q);
double p_chisqr(long double q);
double power(double x, unsigned n);
=====================================
version.h
=====================================
@@ -17,4 +17,4 @@
* limitations under the License.
*/
-#define KMA_VERSION "1.3.14"
+#define KMA_VERSION "1.3.15"
View it on GitLab: https://salsa.debian.org/med-team/kma/-/commit/205feb040a5e0d52a1b5f5cf688663ced546f0dc
--
View it on GitLab: https://salsa.debian.org/med-team/kma/-/commit/205feb040a5e0d52a1b5f5cf688663ced546f0dc
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/20210501/e37f1bbf/attachment-0001.htm>
More information about the debian-med-commit
mailing list