Fix wrong index in chunk>0 case.
[lightning.git] / example-su92l-1kg.sh
1 #!/bin/bash
2
3 set -ex
4
5 PATH="${GOPATH:-${HOME}/go}/bin:${PATH}"
6 go install
7 lightning build-docker-image
8 arv keep docker lightning-runtime
9
10 priority=501
11 project=su92l-j7d0g-jzei0m9yvgauhjf
12 ref_fa=su92l-4zz18-u77iyyy7cb05xqv/hg38.fa.gz
13 ref37_fa=su92l-4zz18-caw3g2ji89jxix8/human_g1k_v37.fasta.gz
14 gvcf=${HOME}/keep/by_id/su92l-4zz18-bgyq36m6gctk63q
15 info=su92l-4zz18-ykpcoea5nisz74f
16 tagset=su92l-4zz18-92bx4zjg5hgs3yc/tagset.fa.gz
17
18 genome=$(lightning     ref2genome   -project ${project} -priority ${priority} -ref ${ref_fa})                                                          ; echo genome=${genome}
19 fasta=$(lightning      vcf2fasta    -project ${project} -priority ${priority} -ref ${ref_fa} -genome ${genome} -mask=true ${gvcf})                     ; echo fasta=${fasta}
20 # fasta=su92l-4zz18-9nq05jifgz7iult
21
22 ref37_lib=$(lightning  import       -project ${project} -priority ${priority} -tag-library ${tagset} -skip-ooo=true -output-tiles=true -save-incomplete-tiles=true ${ref37_fa}) ; echo ref37_lib=${ref37_lib}
23 # ref37_lib=su92l-4zz18-vnhlv3g6yp1azls/library.gob
24 # 539s
25 # ref37_lib=su92l-4zz18-v0xfm2o1tu3u1w3/library.gob.gz
26 # 2751s @ 4a3899f
27
28 ref38_lib=$(lightning  import       -project ${project} -priority ${priority} -tag-library ${tagset} -skip-ooo=true -output-tiles=true -save-incomplete-tiles=true ${ref_fa}) ; echo ref38_lib=${ref38_lib}
29 # ref38_lib=su92l-4zz18-swebknshfwsvys6/library.gob
30
31 bed37=$(lightning export       -project ${project} -priority ${priority} -i ${ref37_lib} -output-format hgvs -ref /mnt/$ref37_fa -output-bed hg37.bed) ; echo bed37=${bed37}
32 # bed37=su92l-4zz18-gb3hihiiaz0xaz9/export.csv
33 # 463s @ 870319f
34 bed38=$(lightning export       -project ${project} -priority ${priority} -i ${ref38_lib} -output-format hgvs -ref /mnt/$ref_fa -output-bed hg38.bed) ; echo bed38=${bed38}
35
36 unfiltered=$(lightning import       -project ${project} -priority ${priority} -tag-library ${tagset} -skip-ooo=true -output-tiles=true ${fasta})       ; echo unfiltered=${unfiltered}
37 # unfiltered=su92l-4zz18-mz3546bib6oj1gg/library.gob
38 # unfiltered=su92l-4zz18-72ovi5qrderxudv/library.gob
39 # 24674s @ pre-38e6e7c
40 # unfiltered=su92l-4zz18-ywhkc1hgdzxwp5u/library.gob
41 # 18497s @ 64vcpu bf0968a
42 # _____s @ 32vcpu 83983ad
43
44
45 merged=$(lightning     merge        -project ${project} -priority ${priority} ${unfiltered} ${ref37_lib})                                              ; echo merged=${merged}
46 # merged=su92l-4zz18-svw5xqe5g0ct2v1/library.gob
47 # 2400s
48
49 exportvcf=$(lightning  export       -project ${project} -priority ${priority} -i ${merged} -output-format vcf -ref /mnt/su92l-4zz18-caw3g2ji89jxix8/human_g1k_v37.fasta.gz -output-bed export.bed) ; echo exportvcf=${exportvcf}
50 # exportvcf=su92l-4zz18-gz4svr6zyvipueu/export.csv
51 # 5506s
52
53 exporthgvs=$(lightning export       -project ${project} -priority ${priority} -i ${merged38} -output-format hgvs -ref /mnt/su92l-4zz18-u77iyyy7cb05xqv/hg38.fa.gz -output-bed hg38.bed) ; echo exporthgvs=${exporthgvs}
54
55
56
57 stats=$(lightning      stats        -project ${project} -priority ${priority} -i ${merged})                                                            ; echo stats=${stats}
58
59 filtered=$(lightning   filter       -project ${project} -priority ${priority} -i ${merged} -min-coverage "0.9" -max-variants "30")                     ; echo filtered=${filtered}
60
61 annotations=$(lightning annotate    -project ${project} -priority ${priority} -i ${merged})                                                            ; echo annotations=${annotations}
62
63 pca=$(lightning        pca-go       -project ${project} -priority ${priority} -i ${unfiltered} -min-coverage "0.9" -max-variants "30")                 ; echo pca=${pca}
64 # pca=su92l-4zz18-e3xhi2mzp8rqevd/pca.npy
65 # 3987s @ c237c16
66 plot=$(lightning       plot         -project ${project} -priority ${priority} -i ${pca} -labels-csv ${info}/sample_info.csv -sample-fasta-dir ${fasta})
67 echo >&2 "https://workbench2.${plot%%-*}.arvadosapi.com/collections/${plot}"
68 echo ${plot%%/*}
69 # plot=su92l-4zz18-xyei3lnyxmgo7lh/plot.png
70 # 535s @ c237c16
71
72 merged38=$(lightning   merge        -project ${project} -priority ${priority} ${unfiltered} ${ref38_lib})                                              ; echo merged38=${merged38}
73 # merged38=su92l-4zz18-xq17gtaltjxbm3n/library.gob
74 # 1602s
75 # merged38=su92l-4zz18-5kcaci3hqzukjv2/library.gob
76 # 2815s @ 83983ad
77 # merged38=su92l-4zz18-nq8dmtng68ozovu/library.gob.gz
78 # 9803s @ 69b71af
79
80 numpy=$(lightning      export-numpy -project ${project} -priority ${priority} -i ${merged38})                                                          ; echo numpy=${numpy}
81 # numpy=su92l-4zz18-w3dx5k79mtbz6qt/matrix.npy
82 # 6155s
83 # numpy=su92l-4zz18-g1y2eg9qvngvkkq/matrix.npy
84 # 6633s @ 83983ad
85 # numpy=su92l-4zz18-cpw0i3z7wery77o/matrix.npy
86 # 6311s @ 4e6ada0
87 # numpy=su92l-4zz18-hljgbqs6c87wles/matrix.npy
88 # 6824s @ 2e1cb2e
89 # numpy=su92l-4zz18-vw31l0qzenyb44l/matrix.npy
90 # 7403s @ 6785271
91 # pcapy=$(lightning      pca          -project ${project} -priority ${priority} -i ${numpy})                                                             ; echo pcapy=${pcapy}
92 comvar=$(lightning     numpy-comvar -project ${project} -priority ${priority} -i ${numpy} -annotations ${numpy%/matrix.npy}/annotations.tsv)           ; echo comvar=${comvar}
93 # comvar=su92l-4zz18-s1yhngobdvcoc2e/commonvariants.csv