]> git.donarmstrong.com Git - samtools.git/commitdiff
* samtools-0.1.6-17 (r484)
authorHeng Li <lh3@live.co.uk>
Mon, 19 Oct 2009 18:31:32 +0000 (18:31 +0000)
committerHeng Li <lh3@live.co.uk>
Mon, 19 Oct 2009 18:31:32 +0000 (18:31 +0000)
 * fixed a memory leak in rmdupse
 * fixed a bug in parsing @RG header lines
 * test rmdup in examples/

bam_import.c
bam_rmdupse.c
bamtk.c
examples/Makefile

index 1dc906eb49f36428460be547b1582ab52432f651..eaa9452080e2624bc38a131265171bd2b53d4d11 100644 (file)
@@ -211,7 +211,6 @@ int sam_header_parse_rg(bam_header_t *h)
                        break;
                }
                if (r < p) r = p;
-               s = r + 3;
        }
        if (rgid->l && rglib->l) {
                bam_strmap_put(h->rg2lib, rgid->s, rglib->s);
index 149d844c976dbe3b0561b61656e29a0fa7dd5255..edc73a4c720e3481127e4868114911c0158dc586 100644 (file)
@@ -53,7 +53,8 @@ static inline elem_t *push_queue(queue_t *queue, const bam1_t *b, int endpos, in
        elem_t *p = kl_pushp(q, queue);
        p->discarded = 0;
        p->endpos = endpos; p->score = score;
-       p->b = bam_dup1(b);
+       if (p->b == 0) p->b = bam_init1();
+       bam_copy1(p->b, b);
        return p;
 }
 
diff --git a/bamtk.c b/bamtk.c
index abb9015ab366a6d8dd6d7e256715f25bebd15869..3715308e3e649585d79e063cc72f4e9e98891f4e 100644 (file)
--- a/bamtk.c
+++ b/bamtk.c
@@ -9,7 +9,7 @@
 #endif
 
 #ifndef PACKAGE_VERSION
-#define PACKAGE_VERSION "0.1.6-16 (r483)"
+#define PACKAGE_VERSION "0.1.6-17 (r484)"
 #endif
 
 int bam_taf2baf(int argc, char *argv[]);
index 3fe3e5a63a8643c49e8bf75447d4a55fac847add..8f0386fcaa48730dc24a276546cbe377ffffc756 100644 (file)
@@ -1,4 +1,4 @@
-all:../libbam.a ../samtools ex1.glf ex1.pileup.gz ex1.bam.bai ex1.glfview.gz calDepth
+all:../libbam.a ../samtools ex1.glf ex1.pileup.gz ex1.bam.bai ex1f-rmduppe.bam ex1f-rmdupse.bam ex1.glfview.gz calDepth
                @echo; echo \# You can now launch the viewer with: \'samtools tview ex1.bam ex1.fa\'; echo;
 
 ex1.fa.fai:ex1.fa
@@ -13,6 +13,18 @@ ex1.glf:ex1.bam ex1.fa
                ../samtools pileup -gf ex1.fa ex1.bam > ex1.glf
 ex1.glfview.gz:ex1.glf
                ../samtools glfview ex1.glf | gzip > ex1.glfview.gz
+ex1a.bam:ex1.bam
+               ../samtools view -h ex1.bam | awk 'BEGIN{FS=OFS="\t"}{if(/^@/)print;else{$$1=$$1"a";print}}' | ../samtools view -bS - > $@
+ex1b.bam:ex1.bam
+               ../samtools view -h ex1.bam | awk 'BEGIN{FS=OFS="\t"}{if(/^@/)print;else{$$1=$$1"b";print}}' | ../samtools view -bS - > $@
+ex1f.rg:
+               (echo "@RG      ID:ex1  LB:ex1"; echo "@RG      ID:ex1a LB:ex1"; echo "@RG      ID:ex1b LB:ex1b") > $@
+ex1f.bam:ex1.bam ex1a.bam ex1b.bam ex1f.rg
+               ../samtools merge -rh ex1f.rg $@ ex1.bam ex1a.bam ex1b.bam
+ex1f-rmduppe.bam:ex1f.bam
+               ../samtools rmdup ex1f.bam $@
+ex1f-rmdupse.bam:ex1f.bam
+               ../samtools rmdup -S ex1f.bam $@
 
 ../samtools:
                (cd ..; make samtools)
@@ -24,4 +36,4 @@ calDepth:../libbam.a calDepth.c
                gcc -g -Wall -O2 -I.. calDepth.c -o $@ -lm -lz -L.. -lbam
 
 clean:
-               rm -fr *.bam *.bai *.glf* *.fai *.pileup* *~ calDepth *.dSYM
\ No newline at end of file
+               rm -fr *.bam *.bai *.glf* *.fai *.pileup* *~ calDepth *.dSYM ex1*.rg
\ No newline at end of file