[med-svn] [fermi-lite] 01/01: Avoid name space conflict with bwa

Andreas Tille tille at debian.org
Thu Feb 2 10:24:27 UTC 2017


This is an automated email from the git hooks/post-receive script.

tille pushed a commit to branch master
in repository fermi-lite.

commit 795bf38f797c34630e71599260b349186b70ffac
Author: Andreas Tille <tille at debian.org>
Date:   Thu Feb 2 10:59:20 2017 +0100

    Avoid name space conflict with bwa
---
 debian/changelog                    |   7 +
 debian/patches/rename_bseq1_t.patch | 260 ++++++++++++++++++++++++++++++++++++
 debian/patches/series               |   1 +
 3 files changed, 268 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 1bf8302..f32cb98 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+fermi-lite (0.1-3) UNRELEASED; urgency=medium
+
+  * Team upload.
+  * Avoid name space conflict with bwa
+
+ -- Andreas Tille <tille at debian.org>  Thu, 02 Feb 2017 10:57:56 +0100
+
 fermi-lite (0.1-2) unstable; urgency=medium
 
   * Autopkgtest: build example outside of upstream source tree.
diff --git a/debian/patches/rename_bseq1_t.patch b/debian/patches/rename_bseq1_t.patch
new file mode 100644
index 0000000..ea403bb
--- /dev/null
+++ b/debian/patches/rename_bseq1_t.patch
@@ -0,0 +1,260 @@
+Description: Avoid name space conflict with bwa
+Bug-Upstream: https://github.com/lh3/fermi-lite/issues/5
+Author: Andreas Tille <tille at debian.org>
+Last-Update: Thu, 02 Feb 2017 10:57:56 +0100
+
+--- a/bfc.c
++++ b/bfc.c
+@@ -60,7 +60,7 @@ typedef struct { // cache to reduce lock
+ typedef struct {
+ 	int k, q;
+ 	int n_seqs;
+-	const bseq1_t *seqs;
++	const fml_seq1_t *seqs;
+ 	bfc_ch_t *ch;
+ 	int *n_buf;
+ 	insbuf_t **buf;
+@@ -97,7 +97,7 @@ static void bfc_kmer_insert(cnt_step_t *
+ static void worker_count(void *_data, long k, int tid)
+ {
+ 	cnt_step_t *cs = (cnt_step_t*)_data;
+-	const bseq1_t *s = &cs->seqs[k];
++	const fml_seq1_t *s = &cs->seqs[k];
+ 	int i, l;
+ 	bfc_kmer_t x = bfc_kmer_null;
+ 	uint64_t qmer = 0, mask = (1ULL<<cs->k) - 1;
+@@ -111,7 +111,7 @@ static void worker_count(void *_data, lo
+ 	}
+ }
+ 
+-struct bfc_ch_s *fml_count(int n, const bseq1_t *seq, int k, int q, int l_pre, int n_threads)
++struct bfc_ch_s *fml_count(int n, const fml_seq1_t *seq, int k, int q, int l_pre, int n_threads)
+ {
+ 	int i;
+ 	cnt_step_t cs;
+@@ -577,10 +577,10 @@ typedef struct {
+ 	bfc_ec1buf_t **e;
+ 	int64_t n_processed;
+ 	int n_seqs, flt_uniq;
+-	bseq1_t *seqs;
++	fml_seq1_t *seqs;
+ } ec_step_t;
+ 
+-static uint64_t max_streak(int k, const bfc_ch_t *ch, const bseq1_t *s)
++static uint64_t max_streak(int k, const bfc_ch_t *ch, const fml_seq1_t *s)
+ {
+ 	int i, l;
+ 	uint64_t max = 0, t = 0;
+@@ -602,7 +602,7 @@ static uint64_t max_streak(int k, const
+ static void worker_ec(void *_data, long k, int tid)
+ {
+ 	ec_step_t *es = (ec_step_t*)_data;
+-	bseq1_t *s = &es->seqs[k];
++	fml_seq1_t *s = &es->seqs[k];
+ 	if (es->flt_uniq) {
+ 		uint64_t max;
+ 		max = max_streak(es->opt->k, es->ch, s);
+@@ -624,7 +624,7 @@ static void worker_ec(void *_data, long
+ 	} else bfc_ec1(es->e[tid], s->seq, s->qual);
+ }
+ 
+-float fml_correct_core(const fml_opt_t *opt, int flt_uniq, int n, bseq1_t *seq)
++float fml_correct_core(const fml_opt_t *opt, int flt_uniq, int n, fml_seq1_t *seq)
+ {
+ 	bfc_ch_t *ch;
+ 	int i, mode;
+@@ -663,12 +663,12 @@ float fml_correct_core(const fml_opt_t *
+ 	return kcov;
+ }
+ 
+-float fml_correct(const fml_opt_t *opt, int n, bseq1_t *seq)
++float fml_correct(const fml_opt_t *opt, int n, fml_seq1_t *seq)
+ {
+ 	return fml_correct_core(opt, 0, n, seq);
+ }
+ 
+-float fml_fltuniq(const fml_opt_t *opt, int n, bseq1_t *seq)
++float fml_fltuniq(const fml_opt_t *opt, int n, fml_seq1_t *seq)
+ {
+ 	return fml_correct_core(opt, 1, n, seq);
+ }
+--- a/bseq.c
++++ b/bseq.c
+@@ -6,10 +6,10 @@
+ #include "kseq.h"
+ KSEQ_INIT(gzFile, gzread)
+ 
+-bseq1_t *bseq_read(const char *fn, int *n_)
++fml_seq1_t *fml_seq_read(const char *fn, int *n_)
+ {
+ 	gzFile fp;
+-	bseq1_t *seqs;
++	fml_seq1_t *seqs;
+ 	kseq_t *ks;
+ 	int m, n;
+ 	uint64_t size = 0;
+@@ -21,10 +21,10 @@ bseq1_t *bseq_read(const char *fn, int *
+ 
+ 	m = n = 0; seqs = 0;
+ 	while (kseq_read(ks) >= 0) {
+-		bseq1_t *s;
++		fml_seq1_t *s;
+ 		if (n >= m) {
+ 			m = m? m<<1 : 256;
+-			seqs = realloc(seqs, m * sizeof(bseq1_t));
++			seqs = realloc(seqs, m * sizeof(fml_seq1_t));
+ 		}
+ 		s = &seqs[n];
+ 		s->seq = strdup(ks->seq.s);
+--- a/misc.c
++++ b/misc.c
+@@ -40,7 +40,7 @@ void fml_opt_init(fml_opt_t *opt)
+ 	opt->mag_opt.flag = MAG_F_NO_SIMPL;
+ }
+ 
+-void fml_opt_adjust(fml_opt_t *opt, int n_seqs, const bseq1_t *seqs)
++void fml_opt_adjust(fml_opt_t *opt, int n_seqs, const fml_seq1_t *seqs)
+ {
+ 	int i, log_len;
+ 	uint64_t tot_len = 0;
+@@ -62,7 +62,7 @@ static inline int is_rev_same(int l, con
+ 	return (i == l>>1);
+ }
+ 
+-struct rld_t *fml_fmi_gen(int n, bseq1_t *seq, int is_mt)
++struct rld_t *fml_fmi_gen(int n, fml_seq1_t *seq, int is_mt)
+ {
+ 	mrope_t *mr;
+ 	kstring_t str = {0,0,0};
+@@ -75,7 +75,7 @@ struct rld_t *fml_fmi_gen(int n, bseq1_t
+ 	mr = mr_init(ROPE_DEF_MAX_NODES, ROPE_DEF_BLOCK_LEN, MR_SO_RCLO);
+ 	for (k = 0; k < n; ++k) {
+ 		int i;
+-		bseq1_t *s = &seq[k];
++		fml_seq1_t *s = &seq[k];
+ 		if (s->l_seq == 0) continue;
+ 		free(s->qual);
+ 		for (i = 0; i < s->l_seq; ++i)
+@@ -116,7 +116,7 @@ struct rld_t *fml_fmi_gen(int n, bseq1_t
+ 	return e;
+ }
+ 
+-struct rld_t *fml_seq2fmi(const fml_opt_t *opt, int n, bseq1_t *seq)
++struct rld_t *fml_seq2fmi(const fml_opt_t *opt, int n, fml_seq1_t *seq)
+ {
+ 	return fml_fmi_gen(n, seq, opt->n_threads > 1? 1 : 0);
+ }
+@@ -251,7 +251,7 @@ void fml_utg_destroy(int n, fml_utg_t *u
+ 
+ #define MAG_MIN_NSR_COEF .1
+ 
+-fml_utg_t *fml_assemble(const fml_opt_t *opt0, int n_seqs, bseq1_t *seqs, int *n_utg)
++fml_utg_t *fml_assemble(const fml_opt_t *opt0, int n_seqs, fml_seq1_t *seqs, int *n_utg)
+ {
+ 	rld_t *e;
+ 	mag_t *g;
+--- a/example.c
++++ b/example.c
+@@ -7,7 +7,7 @@ int main(int argc, char *argv[])
+ {
+ 	fml_opt_t opt;
+ 	int c, n_seqs, n_utg;
+-	bseq1_t *seqs;
++	fml_seq1_t *seqs;
+ 	fml_utg_t *utg;
+ 
+ 	fml_opt_init(&opt);
+@@ -34,7 +34,7 @@ int main(int argc, char *argv[])
+ 		fprintf(stderr, "  -A              discard heterozygotes (apply this to assemble bacterial genomes)\n");
+ 		return 1;
+ 	}
+-	seqs = bseq_read(argv[optind], &n_seqs);
++	seqs = fml_seq_read(argv[optind], &n_seqs);
+ 	utg = fml_assemble(&opt, n_seqs, seqs, &n_utg);
+ 	fml_utg_print(n_utg, utg);
+ 	fml_utg_destroy(n_utg, utg);
+--- a/internal.h
++++ b/internal.h
+@@ -12,7 +12,7 @@ extern "C" {
+ void kt_for(int n_threads, void (*func)(void*,long,int), void *data, long n);
+ void seq_reverse(int l, unsigned char *s);
+ void seq_revcomp6(int l, unsigned char *s);
+-struct bfc_ch_s *fml_count(int n, const bseq1_t *seq, int k, int q, int l_pre, int n_threads);
++struct bfc_ch_s *fml_count(int n, const fml_seq1_t *seq, int k, int q, int l_pre, int n_threads);
+ 
+ #ifdef __cplusplus
+ }
+--- a/fml.h
++++ b/fml.h
+@@ -8,7 +8,7 @@
+ typedef struct {
+ 	int32_t l_seq;
+ 	char *seq, *qual;
+-} bseq1_t;
++} fml_seq1_t;
+ 
+ #define MAG_F_AGGRESSIVE 0x20
+ #define MAG_F_NO_SIMPL   0x80
+@@ -60,7 +60,7 @@ extern "C" {
+  *
+  * @return array of sequences
+  */
+-bseq1_t *bseq_read(const char *fn, int *n);
++fml_seq1_t *fml_seq_read(const char *fn, int *n);
+ 
+ /**
+  * Initialize default parameters
+@@ -79,7 +79,7 @@ void fml_opt_init(fml_opt_t *opt);
+  *
+  * @return array of unitigs
+  */
+-fml_utg_t *fml_assemble(const fml_opt_t *opt, int n_seqs, bseq1_t *seqs, int *n_utg);
++fml_utg_t *fml_assemble(const fml_opt_t *opt, int n_seqs, fml_seq1_t *seqs, int *n_utg);
+ 
+ /**
+  * Free unitigs
+@@ -100,7 +100,7 @@ void fml_utg_destroy(int n_utg, fml_utg_
+  * @param n_seqs    number of sequences
+  * @param seqs      array of sequences
+  */
+-void fml_opt_adjust(fml_opt_t *opt, int n_seqs, const bseq1_t *seqs);
++void fml_opt_adjust(fml_opt_t *opt, int n_seqs, const fml_seq1_t *seqs);
+ 
+ /**
+  * Error correction
+@@ -111,8 +111,8 @@ void fml_opt_adjust(fml_opt_t *opt, int
+  *
+  * @return k-mer coverage
+  */
+-float fml_correct(const fml_opt_t *opt, int n, bseq1_t *seq);
+-float fml_fltuniq(const fml_opt_t *opt, int n, bseq1_t *seq);
++float fml_correct(const fml_opt_t *opt, int n, fml_seq1_t *seq);
++float fml_fltuniq(const fml_opt_t *opt, int n, fml_seq1_t *seq);
+ 
+ /**
+  * Construct FMD-index
+@@ -123,7 +123,7 @@ float fml_fltuniq(const fml_opt_t *opt,
+  *
+  * @return FMD-index
+  */
+-struct rld_t *fml_seq2fmi(const fml_opt_t *opt, int n, bseq1_t *seq);
++struct rld_t *fml_seq2fmi(const fml_opt_t *opt, int n, fml_seq1_t *seq);
+ 
+ /**
+  * Generate initial overlap graph
+--- a/README.md
++++ b/README.md
+@@ -29,11 +29,11 @@ sketch of the example:
+ int main(int argc, char *argv[])
+ {
+ 	int i, n_seqs, n_utgs;
+-	bseq1_t *seqs;                      // array of input sequences
++	fml_seq1_t *seqs;                      // array of input sequences
+ 	fml_utg_t *utgs;                    // array of output unitigs
+ 	fml_opt_t opt;
+ 	if (argc == 1) return 1;            // do nothing if there is no input file
+-	seqs = bseq_read(argv[1], &n_seqs); // or fill the array with callers' functions
++	seqs = fml_seq_read(argv[1], &n_seqs); // or fill the array with callers' functions
+ 	fml_opt_init(&opt);                 // initialize parameters
+ 	utgs = fml_assemble(&opt, n_seqs, seqs, &n_utgs); // assemble!
+ 	for (i = 0; i < n_utgs; ++i)        // output in fasta
diff --git a/debian/patches/series b/debian/patches/series
index 4f6b77a..763f067 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 make_shared_lib
 hardening
+rename_bseq1_t.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/fermi-lite.git



More information about the debian-med-commit mailing list