Debian Codegraph @

tests/pysam_data/Makefile

raw symbols ◀ ▶
Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
1 SAM=$(wildcard *.sam)
2 BAM=$(SAM:%.sam=%.bam)
3 BAI=$(BAM:%.bam=%.bam.bai)
4 CRAM=ex1.cram ex2.cram ex3.cram
5 CRAI=$(CRAM:%.cram=%.cram.crai)
6 NO_PG:=$(findstring --no-PG,$(shell samtools view '-?'))
7
8 # ex2.bam - bam file without index
9
10 all: all.stamp
11
12 all.stamp: ex1.pileup.gz \
13 ex1.sam ex1.bam \
14 ex2.sam.gz ex2.sam ex2.bam ex2.bam.bai \
15 with_md.sam.gz with_md.bam with_md.bam.bai \
16 uncompressed.bam \
17 $(BAM) $(BAI) \
18 $(CRAM) $(CRAI) \
19 example_bai.bam \
20 rg_with_tab.bam \
21 ex2_truncated.bam \
22 ex2_corrupt.bam \
23 empty.bam empty.bam.bai \
24 explicit_index.bam explicit_index.cram \
25 faidx_empty_seq.fq.gz \
26 ex1.fa.gz ex1.fa.gz.fai ex1.fa.gz.gzi \
27 ex1_csi.bam \
28 example_reverse_complement.bam \
29 example_dash_in_chr.bam
30 touch $@
31
32 # ex2.sam - as ex1.sam, but with header
33 ex2.sam.gz: ex1.bam ex1.bam.bai
34 samtools view $(NO_PG) -h ex1.bam | gzip > ex2.sam.gz
35
36 with_md.sam.gz: ex2.bam ex1.fa
37 samtools calmd $(NO_PG) --output-fmt BAM $^ > $@
38
39 #%.bam: %.sam ex1.fa.fai
40 # samtools view $(NO_PG) -bo $@ -t ex1.fa.fai $<
41
42 uncompressed.bam: ex2.sam
43 samtools view $(NO_PG) -bu -o $@ $<
44
45 %.bam: %.sam
46 samtools view $(NO_PG) -bo $@ $<
47
48 %.cram: %.sam
49 samtools view $(NO_PG) -Co $@ -T ex1.fa $<
50
51 %.cram.crai: %.cram
52 samtools index $<
53
54 %.sam: %.sam.gz
55 gunzip < $< > $@
56
57 %.fa.fai: %.fa
58 samtools faidx $<
59
60 %.fa.gz.fai %.fa.gz.gzi: %.fa.gz
61 samtools faidx $<
62
63 ex1.bam:ex1.sam.gz ex1.fa.fai
64 samtools view $(NO_PG) -bo ex1.bam -t ex1.fa.fai ex1.sam.gz
65
66 %.bam.bai:%.bam
67 samtools index $<
68
69 ex1.pileup.gz:ex1.bam ex1.fa
70 samtools mpileup -f ex1.fa ex1.bam | gzip > ex1.pileup.gz
71
72 ex2_truncated.bam: ex2.bam
73 dd if=ex2.bam of=ex2_truncated.bam bs=$$((`wc -c < ex2.bam`-512)) count=1
74
75 # Append a corrupt read with block_size < sizeof(bam_core_t fields)
76 ex2_corrupt.bam: ex2.bam
77 (bgzip -d < $<; printf '\37\0\0\0\1\0\0\0') | bgzip > $@
78
79 ex1_csi.bam: ex1.bam
80 cp ex1.bam ex1_csi.bam
81 samtools index -c ex1_csi.bam
82
83 empty.bam: ex2.sam
84 grep "^@" $< | samtools view $(NO_PG) -bo $@ -
85
86 example_unmapped_reads_no_sq.bam: example_unmapped_reads_no_sq.sam
87 touch tmp.list
88 samtools view $(NO_PG) -bo $@ -t tmp.list $<
89 rm -f tmp.list
90
91 example_bai.bam: ex1.bam
92 cp ex1.bam $@
93 samtools index $@
94 mv [email protected] example_bai.bai
95
96 explicit_index.bam: ex1.bam
97 cp ex1.bam $@
98
99 explicit_index.cram: ex1.cram
100 cp ex1.cram $@
101
102 clean:
103 rm -fr [A-Za-z]*.bam *.bai *.csi *.fai *.gzi *.pileup* [A-Za-z]*.cram *.crai \
104 all.lock all.stamp *~ calDepth *.dSYM pysam_*.sam \
105 ex2.sam ex2.sam.gz ex1.sam ex1.fa.gz \
106 with_md.sam.gz \
107 *.fq.gz
108
109 %.fq.gz: %.fq
110 gzip < $< > $@
111
112 %.fa.gz: %.fa
113 bgzip < $< > $@