Andreas Tille pushed to branch master at Debian Med / vt
Commits: 4df59f7e by Antoni Villalonga at 2020-11-09T07:47:35+01:00 patch 0001: Get rid of commented code - - - - - c9a3a2be by Andreas Tille at 2020-11-09T08:02:03+00:00 Merge branch 'patch-0001-amend' into 'master' patch 0001: Get rid of commented code See merge request med-team/vt!1 - - - - - 1 changed file: - debian/patches/0001-updated-faidx_fetch_uc_seq.patch Changes: ===================================== debian/patches/0001-updated-faidx_fetch_uc_seq.patch ===================================== @@ -3,11 +3,9 @@ From: Adrian Tan <[email protected]> Date: Fri, 13 Jul 2018 17:20:56 -0400 Subject: updated faidx_fetch_uc_seq -diff --git a/hts_utils.cpp b/hts_utils.cpp -index 6644f0e..30bf37a 100644 --- a/hts_utils.cpp +++ b/hts_utils.cpp -@@ -40,37 +40,53 @@ typedef khash_t(vdict) vdict_t; +@@ -40,36 +40,14 @@ */ char *faidx_fetch_uc_seq(const faidx_t *fai, const char *c_name, int p_beg_i, int p_end_i, int *len) { @@ -30,65 +28,23 @@ index 6644f0e..30bf37a 100644 - // Now retrieve the sequence - int ret = bgzf_useek(fai->bgzf, val.offset + p_beg_i / val.line_blen * val.line_len + p_beg_i % val.line_blen, SEEK_SET); - if ( ret<0 ) -- { ++ char* seq = faidx_fetch_seq(fai, c_name, p_beg_i, p_end_i, len); ++ ++ ++ for (int32_t i=0; i<*len; ++i) + { - *len = -1; - fprintf(stderr, "[fai_fetch_seq] Error: fai_fetch failed. (Seeking in a compressed, .gzi unindexed, file?)\n"); - return NULL; -- } ++ if (isgraph(seq[i])) seq[i] = toupper(seq[i]); + } - l = 0; - seq = (char*)malloc(p_end_i - p_beg_i + 2); - while ( (c=bgzf_getc(fai->bgzf))>=0 && l < p_end_i - p_beg_i + 1) - if (isgraph(c)) seq[l++] = toupper(c); - seq[l] = '\0'; - *len = l; -+ char* seq = faidx_fetch_seq(fai, c_name, p_beg_i, p_end_i, len); -+ -+ -+ // while ( (c=bgzf_getc(fai->bgzf))>=0 && l < p_end_i - p_beg_i + 1) -+// if (isgraph(c)) seq[l++] = toupper(c); -+// seq[l] = '\0'; -+// *len = l; -+ -+ for (int32_t i=0; i<*len; ++i) -+ { -+ if (isgraph(seq[i])) seq[i] = toupper(seq[i]); -+ } + return seq; -+ -+ -+// int l; -+// char c; -+// khiter_t iter; -+// faidx1_t val; -+// char *seq=NULL; -+// -+// // Adjust position -+// iter = kh_get(s, fai->hash, c_name); -+// if(iter == kh_end(fai->hash)) return 0; -+// val = kh_value(fai->hash, iter); -+// if(p_end_i < p_beg_i) p_beg_i = p_end_i; -+// if(p_beg_i < 0) p_beg_i = 0; -+// else if(val.len <= p_beg_i) p_beg_i = val.len - 1; -+// if(p_end_i < 0) p_end_i = 0; -+// else if(val.len <= p_end_i) p_end_i = val.len - 1; -+// -+// // Now retrieve the sequence -+// int ret = bgzf_useek(fai->bgzf, val.offset + p_beg_i / val.line_blen * val.line_len + p_beg_i % val.line_blen, SEEK_SET); -+// if ( ret<0 ) -+// { -+// *len = -1; -+// fprintf(stderr, "[fai_fetch_seq] Error: fai_fetch failed. (Seeking in a compressed, .gzi unindexed, file?)\n"); -+// return NULL; -+// } -+// l = 0; -+// seq = (char*)malloc(p_end_i - p_beg_i + 2); -+// while ( (c=bgzf_getc(fai->bgzf))>=0 && l < p_end_i - p_beg_i + 1) -+// if (isgraph(c)) seq[l++] = toupper(c); -+// seq[l] = '\0'; -+// *len = l; -+// return seq; } - /********** - View it on GitLab: https://salsa.debian.org/med-team/vt/-/compare/73a50b1d13545bdf058829a7159ae720c8131407...c9a3a2be69f779509142f49346a01d16dea93f75 -- View it on GitLab: https://salsa.debian.org/med-team/vt/-/compare/73a50b1d13545bdf058829a7159ae720c8131407...c9a3a2be69f779509142f49346a01d16dea93f75 You're receiving this email because of your account on salsa.debian.org.
_______________________________________________ debian-med-commit mailing list [email protected] https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/debian-med-commit
