[med-svn] [Git][med-team/kma][master] 5 commits: New upstream version 1.3.23
Nilesh Patra (@nilesh)
gitlab at salsa.debian.org
Sat Jan 22 11:23:18 GMT 2022
Nilesh Patra pushed to branch master at Debian Med / kma
Commits:
3bccb965 by Nilesh Patra at 2021-07-16T22:39:56+05:30
New upstream version 1.3.23
- - - - -
88a3c59b by Nilesh Patra at 2022-01-22T16:47:40+05:30
d/watch: Pull tar.gz instead of bz2
- - - - -
e82ae7fe by Nilesh Patra at 2022-01-22T16:48:05+05:30
New upstream version 1.3.28
- - - - -
d3ea3623 by Nilesh Patra at 2022-01-22T16:48:06+05:30
Update upstream source from tag 'upstream/1.3.28'
Update to upstream version '1.3.28'
with Debian dir 50286f718de60b41732e9cdd3ddc0c44bba43769
- - - - -
c99e7a70 by Nilesh Patra at 2022-01-22T16:48:40+05:30
Upload to unstable
- - - - -
15 changed files:
- README.md
- alnfrags.c
- debian/changelog
- debian/watch
- frags.c
- index.c
- qualcheck.c
- runkma.c
- seqparse.c
- spltdb.c
- stdstat.c
- stdstat.h
- tmp.c
- updateindex.c
- version.h
Changes:
=====================================
README.md
=====================================
@@ -1,3 +1,4 @@
+[![install with bioconda](https://img.shields.io/badge/install%20with-bioconda-brightgreen.svg?style=flat)](http://bioconda.github.io/recipes/kma/README.html)
# Getting Started #
```
=====================================
alnfrags.c
=====================================
@@ -1140,7 +1140,7 @@ void * alnFrags_threaded(void * arg) {
}
/* dump seq to all */
- if(frag_out_all && unmapped) {
+ if(frag_out_all) {
if((unmapped & 1) == 0) {
updateAllFrag(qseq->seq, qseq->len, *matched_templates, best_read_score, best_start_pos, best_end_pos, bestTemplates, header, frag_out_all);
}
=====================================
debian/changelog
=====================================
@@ -1,9 +1,9 @@
-kma (1.3.23-3) UNRELEASED; urgency=medium
+kma (1.3.28-1) unstable; urgency=medium
- * Team upload
- * d/salsa-ci.yml: disable test on i386
+ * d/watch: Pull tar.gz instead of bz2
+ * New upstream version 1.3.28
- -- Étienne Mollier <emollier at debian.org> Wed, 15 Sep 2021 21:36:45 +0200
+ -- Nilesh Patra <nilesh at debian.org> Sat, 22 Jan 2022 16:48:10 +0530
kma (1.3.23-2) unstable; urgency=medium
=====================================
debian/watch
=====================================
@@ -1,6 +1,6 @@
version=4
-https://bitbucket.org/genomicepidemiology/kma/downloads/?tab=tags .*/@ANY_VERSION@@ARCHIVE_EXT@
+https://bitbucket.org/genomicepidemiology/kma/downloads/?tab=tags .*/@ANY_VERSION@\.tar\.gz
#opts="mode=git,pretty=1.1.7+git%cd.%h" \
# https://bitbucket.org/genomicepidemiology/kma.git HEAD
=====================================
frags.c
=====================================
@@ -69,6 +69,10 @@ void updateAllFrag(unsigned char *qseq, int q_len, int bestHits, int best_read_s
char *update;
const char bases[6] = "ACGTN-";
+ if(!q_len) {
+ return;
+ }
+
lock(lock);
check = q_len;
avail = dest->bytes;
@@ -157,7 +161,13 @@ void updateAllFrag(unsigned char *qseq, int q_len, int bestHits, int best_read_s
update += check;
}
- check = header->len + 1;
+ /* q-bound */
+ if(2 * sizeof(int) + 1 < header->len && header->seq[header->len - 2 * sizeof(int) - 1] == 0) {
+ i = header->len - 2 * sizeof(int) - 1;
+ } else {
+ i = header->len;
+ }
+ check = i + 1;
if(avail < check) {
dest->bytes = avail;
writeGzFileBuff(dest);
@@ -165,9 +175,9 @@ void updateAllFrag(unsigned char *qseq, int q_len, int bestHits, int best_read_s
update = (char *) dest->next;
}
*update++ = '\t';
- header->seq[header->len - 1] = '\n';
- memcpy(update, header->seq, header->len);
- update += header->len;
+ memcpy(update, header->seq, i--);
+ update += i;
+ *update++ = '\n';
dest->bytes = avail - check;
dest->next = (unsigned char *) update;
=====================================
index.c
=====================================
@@ -92,7 +92,8 @@ int index_main(int argc, char *argv[]) {
fprintf(stderr, "# Too few arguments handed.\n");
helpMessage(-1);
} else if(sizeof(long unsigned) != 8) {
- ERROR();
+ fprintf(stderr, "Need a 64-bit system.\n");
+ exit(1);
}
/* set defaults */
=====================================
qualcheck.c
=====================================
@@ -44,6 +44,7 @@ int lengthCheck(HashMap *templates, CompDNA *qseq, int MinKlen, double homQ, dou
if((qseq->seqlen - templates->kmersize + 1) * 2 < MinKlen) {
return 0;
} else {
+ comp_rc(qseq);
return 1;
}
}
=====================================
runkma.c
=====================================
@@ -933,7 +933,7 @@ int runKMA(char *templatefilename, char *outputfilename, char *exePrev, int ConC
}
if(tot == 0) {
- bestTemplate = -1;
+ bestTemplate = 0;
best_read_score = 0;
bestNum = 0;
@@ -1000,38 +1000,14 @@ int runKMA(char *templatefilename, char *outputfilename, char *exePrev, int ConC
bestTemplate = -bestTemplate;
strrc(qseq->seq, qseq->len);
}
- w_scores[bestTemplate] += read_score;
- if(fragmentCounts) {
- fragmentCounts[bestTemplate]++;
- readCounts[bestTemplate]++;
- }
-
- /* dump frag info */
- alignFrag = smalloc(sizeof(Frag));
- alignFrag->buffer[0] = qseq->len;
- alignFrag->buffer[1] = bestHits;
- alignFrag->buffer[2] = (sparse < 0) ? 0 : read_score;
- alignFrag->buffer[3] = start;
- alignFrag->buffer[4] = end;
- alignFrag->buffer[5] = header->len;
- alignFrag->buffer[6] = flag;
- alignFrag->qseq = ustrdup(qseq->seq, qseq->len);
- alignFrag->header = ustrdup(header->seq, header->len);
- alignFrag->next = alignFrags[bestTemplate];
- alignFrags[bestTemplate] = alignFrag;
-
- ++fragCount;
- if(stats[2] < 0) {
- if(extendedFeatures) {
+ if(bestTemplate) {
+ w_scores[bestTemplate] += read_score;
+ if(fragmentCounts) {
+ fragmentCounts[bestTemplate]++;
readCounts[bestTemplate]++;
}
- sfread(stats, sizeof(int), 3, frag_in_raw);
- qseq->len = stats[0];
- header->len = stats[1];
- flag = stats[2];
- sfread(qseq->seq, 1, qseq->len, frag_in_raw);
- sfread(header->seq, 1, header->len, frag_in_raw);
+
/* dump frag info */
alignFrag = smalloc(sizeof(Frag));
alignFrag->buffer[0] = qseq->len;
@@ -1047,6 +1023,36 @@ int runKMA(char *templatefilename, char *outputfilename, char *exePrev, int ConC
alignFrags[bestTemplate] = alignFrag;
++fragCount;
+
+ if(stats[2] < 0) {
+ if(extendedFeatures) {
+ readCounts[bestTemplate]++;
+ }
+ sfread(stats, sizeof(int), 3, frag_in_raw);
+ qseq->len = stats[0];
+ header->len = stats[1];
+ flag = stats[2];
+ sfread(qseq->seq, 1, qseq->len, frag_in_raw);
+ sfread(header->seq, 1, header->len, frag_in_raw);
+ /* dump frag info */
+ alignFrag = smalloc(sizeof(Frag));
+ alignFrag->buffer[0] = qseq->len;
+ alignFrag->buffer[1] = bestHits;
+ alignFrag->buffer[2] = (sparse < 0) ? 0 : read_score;
+ alignFrag->buffer[3] = start;
+ alignFrag->buffer[4] = end;
+ alignFrag->buffer[5] = header->len;
+ alignFrag->buffer[6] = flag;
+ alignFrag->qseq = ustrdup(qseq->seq, qseq->len);
+ alignFrag->header = ustrdup(header->seq, header->len);
+ alignFrag->next = alignFrags[bestTemplate];
+ alignFrags[bestTemplate] = alignFrag;
+
+ ++fragCount;
+ }
+ } else if(stats[2] < 0) {
+ sfread(stats, sizeof(int), 2, frag_in_raw);
+ sfseek(frag_in_raw, stats[0] + stats[1] + sizeof(int), SEEK_CUR);
}
if(fragCount >= maxFrag) {
@@ -2029,7 +2035,7 @@ int runKMA_MEM(char *templatefilename, char *outputfilename, char *exePrev, int
}
if(tot == 0) {
- bestTemplate = -1;
+ bestTemplate = 0;
best_read_score = 0;
bestNum = 0;
@@ -2094,38 +2100,14 @@ int runKMA_MEM(char *templatefilename, char *outputfilename, char *exePrev, int
bestTemplate = -bestTemplate;
strrc(qseq->seq, qseq->len);
}
- w_scores[bestTemplate] += read_score;
- if(fragmentCounts) {
- fragmentCounts[bestTemplate]++;
- readCounts[bestTemplate]++;
- }
-
- /* dump frag info */
- alignFrag = smalloc(sizeof(Frag));
- alignFrag->buffer[0] = qseq->len;
- alignFrag->buffer[1] = bestHits;
- alignFrag->buffer[2] = (sparse < 0) ? 0 : read_score;
- alignFrag->buffer[3] = start;
- alignFrag->buffer[4] = end;
- alignFrag->buffer[5] = header->len;
- alignFrag->buffer[6] = flag;
- alignFrag->qseq = ustrdup(qseq->seq, qseq->len);
- alignFrag->header = ustrdup(header->seq, header->len);
- alignFrag->next = alignFrags[bestTemplate];
- alignFrags[bestTemplate] = alignFrag;
-
- ++fragCount;
- if(stats[2] < 0) {
- if(extendedFeatures) {
+ if(bestTemplate) {
+ w_scores[bestTemplate] += read_score;
+ if(fragmentCounts) {
+ fragmentCounts[bestTemplate]++;
readCounts[bestTemplate]++;
}
- sfread(stats, sizeof(int), 3, frag_in_raw);
- qseq->len = stats[0];
- header->len = stats[1];
- flag = stats[2];
- sfread(qseq->seq, 1, qseq->len, frag_in_raw);
- sfread(header->seq, 1, header->len, frag_in_raw);
+
/* dump frag info */
alignFrag = smalloc(sizeof(Frag));
alignFrag->buffer[0] = qseq->len;
@@ -2141,6 +2123,36 @@ int runKMA_MEM(char *templatefilename, char *outputfilename, char *exePrev, int
alignFrags[bestTemplate] = alignFrag;
++fragCount;
+
+ if(stats[2] < 0) {
+ if(extendedFeatures) {
+ readCounts[bestTemplate]++;
+ }
+ sfread(stats, sizeof(int), 3, frag_in_raw);
+ qseq->len = stats[0];
+ header->len = stats[1];
+ flag = stats[2];
+ sfread(qseq->seq, 1, qseq->len, frag_in_raw);
+ sfread(header->seq, 1, header->len, frag_in_raw);
+ /* dump frag info */
+ alignFrag = smalloc(sizeof(Frag));
+ alignFrag->buffer[0] = qseq->len;
+ alignFrag->buffer[1] = bestHits;
+ alignFrag->buffer[2] = (sparse < 0) ? 0 : read_score;
+ alignFrag->buffer[3] = start;
+ alignFrag->buffer[4] = end;
+ alignFrag->buffer[5] = header->len;
+ alignFrag->buffer[6] = flag;
+ alignFrag->qseq = ustrdup(qseq->seq, qseq->len);
+ alignFrag->header = ustrdup(header->seq, header->len);
+ alignFrag->next = alignFrags[bestTemplate];
+ alignFrags[bestTemplate] = alignFrag;
+
+ ++fragCount;
+ }
+ } else if(stats[2] < 0) {
+ sfread(stats, sizeof(int), 2, frag_in_raw);
+ sfseek(frag_in_raw, stats[0] + stats[1] + sizeof(int), SEEK_CUR);
}
if(fragCount >= maxFrag) {
=====================================
seqparse.c
=====================================
@@ -532,32 +532,34 @@ int FileBuffgetFqSeq(FileBuff *src, Qseqs *qseq, Qseqs *qual, char *trans) {
int getPhredFileBuff(FileBuff *dest) {
- int seek;
+ int seek, avail, scale;
unsigned char *buff;
+ avail = dest->bytes;
+ scale = 33;
buff = dest->next;
- while(*buff != 0) {
+ while(avail) {
seek = 3;
- while(seek && *buff != 0) {
+ while(seek && --avail) {
if(*++buff == '\n') {
--seek;
}
}
- seek = 1;
- while(seek) {
+ seek = avail ? 1 : 0;
+ while(seek && --avail) {
if(*++buff == '\n') {
seek = 0;
} else if(*buff < 33) {
return 0;
} else if(53 < *buff && *buff < 59) {
return 33;
- } else if(*buff > 84) {
- return 64;
+ } else if(94 < *buff) {
+ scale = 64;
}
}
}
- return 0;
+ return scale;
}
=====================================
spltdb.c
=====================================
@@ -1226,7 +1226,7 @@ int runKMA_spltDB(char **templatefilenames, int targetNum, char *outputfilename,
}
if(tot == 0) {
- bestTemplate = -1;
+ bestTemplate = 0;
best_read_score = 0;
bestNum = 0;
@@ -1291,38 +1291,14 @@ int runKMA_spltDB(char **templatefilenames, int targetNum, char *outputfilename,
bestTemplate = -bestTemplate;
strrc(qseq->seq, qseq->len);
}
- w_scores[bestTemplate] += read_score;
- if(fragmentCounts) {
- fragmentCounts[bestTemplate]++;
- readCounts[bestTemplate]++;
- }
-
- /* dump frag info */
- alignFrag = smalloc(sizeof(Frag));
- alignFrag->buffer[0] = qseq->len;
- alignFrag->buffer[1] = bestHits;
- alignFrag->buffer[2] = (sparse < 0) ? 0 : read_score;
- alignFrag->buffer[3] = start;
- alignFrag->buffer[4] = end;
- alignFrag->buffer[5] = header->len;
- alignFrag->buffer[6] = flag;
- alignFrag->qseq = ustrdup(qseq->seq, qseq->len);
- alignFrag->header = ustrdup(header->seq, header->len);
- alignFrag->next = alignFrags[bestTemplate];
- alignFrags[bestTemplate] = alignFrag;
- ++fragCount;
-
- if(stats[2] < 0) {
- if(extendedFeatures) {
+ if(bestTemplate) {
+ w_scores[bestTemplate] += read_score;
+ if(fragmentCounts) {
+ fragmentCounts[bestTemplate]++;
readCounts[bestTemplate]++;
}
- sfread(stats, sizeof(int), 3, frag_in_raw);
- qseq->len = stats[0];
- header->len = stats[1];
- flag = stats[2];
- sfread(qseq->seq, 1, qseq->len, frag_in_raw);
- sfread(header->seq, 1, header->len, frag_in_raw);
+
/* dump frag info */
alignFrag = smalloc(sizeof(Frag));
alignFrag->buffer[0] = qseq->len;
@@ -1338,8 +1314,39 @@ int runKMA_spltDB(char **templatefilenames, int targetNum, char *outputfilename,
alignFrags[bestTemplate] = alignFrag;
++fragCount;
+
+ if(stats[2] < 0) {
+ if(extendedFeatures) {
+ readCounts[bestTemplate]++;
+ }
+ sfread(stats, sizeof(int), 3, frag_in_raw);
+ qseq->len = stats[0];
+ header->len = stats[1];
+ flag = stats[2];
+ sfread(qseq->seq, 1, qseq->len, frag_in_raw);
+ sfread(header->seq, 1, header->len, frag_in_raw);
+ /* dump frag info */
+ alignFrag = smalloc(sizeof(Frag));
+ alignFrag->buffer[0] = qseq->len;
+ alignFrag->buffer[1] = bestHits;
+ alignFrag->buffer[2] = (sparse < 0) ? 0 : read_score;
+ alignFrag->buffer[3] = start;
+ alignFrag->buffer[4] = end;
+ alignFrag->buffer[5] = header->len;
+ alignFrag->buffer[6] = flag;
+ alignFrag->qseq = ustrdup(qseq->seq, qseq->len);
+ alignFrag->header = ustrdup(header->seq, header->len);
+ alignFrag->next = alignFrags[bestTemplate];
+ alignFrags[bestTemplate] = alignFrag;
+
+ ++fragCount;
+ }
+ } else if(stats[2] < 0) {
+ sfread(stats, sizeof(int), 2, frag_in_raw);
+ sfseek(frag_in_raw, stats[0] + stats[1] + sizeof(int), SEEK_CUR);
}
+
if(fragCount >= maxFrag) {
template_fragments[fileCount] = printFrags(alignFrags, DB_size);
++fileCount;
=====================================
stdstat.c
=====================================
@@ -238,7 +238,7 @@ double eQual(unsigned char *qual, int len, int phredScale, int minQ) {
}
*/
-double eQual(unsigned char *qual, const int len, const int minQ, const double *prob) {
+unsigned eQual(unsigned char *qual, const int len, const int minQ, const double *prob) {
/*
static const double prob[128] = {
@@ -277,5 +277,5 @@ double eQual(unsigned char *qual, const int len, const int minQ, const double *p
}
/* return average */
- return -10 * log10(sum / len);
+ return ceil(-10 * log10(sum / len));
}
=====================================
stdstat.h
=====================================
@@ -29,4 +29,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);
+unsigned eQual(unsigned char *qual, const int len, const int minQ, const double *prob);
=====================================
tmp.c
=====================================
@@ -27,7 +27,7 @@
FILE * tmpF(const char *location) {
static int tmpNum = 0;
- static char *tmpname, *dirname = 0, *filename = 0;
+ static char *tmpname = 0, *dirname = 0, *filename = 0;
static volatile int Lock = 0;
volatile int *lock = &Lock;
int fd;
@@ -66,11 +66,22 @@ FILE * tmpF(const char *location) {
strcpy(tmpname, "XXXXXX");
} else if(filename) {
/* open tmpfile on previous location */
- sprintf(tmpname, "%d", tmpNum++);
+ fd = sprintf(tmpname, "%d", tmpNum++);
if((file = fopen(filename, "wb+"))) {
unlink(filename);
}
*tmpname = 0;
+ } else if(!tmpNum) {
+ /* set default according to TMPDIR */
+ if((tmpname = getenv("TMPDIR"))) {
+ dirname = smalloc(strlen(tmpname) + 13);
+ tmpname = dirname + sprintf(dirname, "%s/.kma-", tmpname);
+ strcpy(tmpname, "XXXXXX");
+ }
+ tmpNum = 1;
+ unlock(lock);
+
+ return tmpF(0);
} else {
/* open a "normal" tmp file */
file = tmpfile();
@@ -79,13 +90,3 @@ FILE * tmpF(const char *location) {
return file;
}
-
-
-
-
-
-
-
-
-
-
=====================================
updateindex.c
=====================================
@@ -114,7 +114,7 @@ int updateDBs_sparse(HashMap *templates, CompDNA *qseq, unsigned template, int M
qseq->N[0]--;
}
}
- if(prefix_len == 0) {
+ if(prefix_len == 0 && !prefix) {
comp_rc(qseq);
}
return 1;
=====================================
version.h
=====================================
@@ -17,4 +17,4 @@
* limitations under the License.
*/
-#define KMA_VERSION "1.3.23"
+#define KMA_VERSION "1.3.28"
View it on GitLab: https://salsa.debian.org/med-team/kma/-/compare/695560cbffe008b23c0dfd0ad4862b3b1a4cd750...c99e7a7018cff976be95cd818925fcc350ddc118
--
View it on GitLab: https://salsa.debian.org/med-team/kma/-/compare/695560cbffe008b23c0dfd0ad4862b3b1a4cd750...c99e7a7018cff976be95cd818925fcc350ddc118
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/20220122/fbfe2827/attachment-0001.htm>
More information about the debian-med-commit
mailing list