bcftools.1 and samtools.1 were merged in upstream release 0.1.17.
[samtools.git] / examples / Makefile
1 all:../libbam.a ../samtools ../bcftools/bcftools \
2         ex1.glf ex1.pileup.gz ex1.bam.bai ex1f-rmduppe.bam ex1f-rmdupse.bam ex1.glfview.gz ex1.bcf calDepth
3                 @echo; echo \# You can now launch the viewer with: \'samtools tview ex1.bam ex1.fa\'; echo;
4
5 ex1.fa.fai:ex1.fa
6                 ../samtools faidx ex1.fa
7 ex1.bam:ex1.sam.gz ex1.fa.fai
8                 ../samtools import ex1.fa.fai ex1.sam.gz ex1.bam
9 ex1.bam.bai:ex1.bam
10                 ../samtools index ex1.bam
11 ex1.pileup.gz:ex1.bam ex1.fa
12                 ../samtools pileup -cf ex1.fa ex1.bam | gzip > ex1.pileup.gz
13 ex1.glf:ex1.bam ex1.fa
14                 ../samtools pileup -gf ex1.fa ex1.bam > ex1.glf
15 ex1.glfview.gz:ex1.glf
16                 ../samtools glfview ex1.glf | gzip > ex1.glfview.gz
17 ex1a.bam:ex1.bam
18                 ../samtools view -h ex1.bam | awk 'BEGIN{FS=OFS="\t"}{if(/^@/)print;else{$$1=$$1"a";print}}' | ../samtools view -bS - > $@
19 ex1b.bam:ex1.bam
20                 ../samtools view -h ex1.bam | awk 'BEGIN{FS=OFS="\t"}{if(/^@/)print;else{$$1=$$1"b";print}}' | ../samtools view -bS - > $@
21 ex1f.rg:
22                 (echo "@RG      ID:ex1  LB:ex1  SM:ex1"; echo "@RG      ID:ex1a LB:ex1  SM:ex1"; echo "@RG      ID:ex1b LB:ex1b SM:ex1b") > $@
23 ex1f.bam:ex1.bam ex1a.bam ex1b.bam ex1f.rg
24                 ../samtools merge -rh ex1f.rg $@ ex1.bam ex1a.bam ex1b.bam
25 ex1f-rmduppe.bam:ex1f.bam
26                 ../samtools rmdup ex1f.bam $@
27 ex1f-rmdupse.bam:ex1f.bam
28                 ../samtools rmdup -S ex1f.bam $@
29
30 ex1.bcf:ex1.bam ex1.fa.fai
31                 ../samtools mpileup -gf ex1.fa ex1.bam > $@
32
33 ../bcftools/bcftools:
34                 (cd ../bcftools; make bcftools)
35
36 ../samtools:
37                 (cd ..; make samtools)
38
39 ../libbam.a:
40                 (cd ..; make libbam.a)
41
42 calDepth:../libbam.a calDepth.c
43                 gcc -g -Wall -O2 -I.. calDepth.c -o $@ -L.. -lbam -lm -lz
44
45 clean:
46                 rm -fr *.bam *.bai *.glf* *.fai *.pileup* *~ calDepth *.dSYM ex1*.rg ex1.bcf
47
48 # ../samtools pileup ex1.bam|perl -ape '$_=$F[4];s/(\d+)(??{".{$1}"})|\^.//g;@_=(tr/A-Z//,tr/a-z//);$_=join("\t",@F[0,1],@_)."\n"'
49
50 # ../samtools pileup -cf ex1.fa ex1.bam|perl -ape '$_=$F[8];s/\^.//g;s/(\d+)(??{".{$1}"})|\^.//g;@_=(tr/A-Za-z//,tr/,.//);$_=join("\t",@F[0,1],@_)."\n"'