partis-bcr 1.0.5__py3-none-any.whl → 1.0.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- bin/partis-test.py +4 -1
- packages/ham/bcrham +0 -0
- {partis_bcr-1.0.5.data → partis_bcr-1.0.7.data}/scripts/partis-test.py +4 -1
- {partis_bcr-1.0.5.dist-info → partis_bcr-1.0.7.dist-info}/METADATA +2 -1
- {partis_bcr-1.0.5.dist-info → partis_bcr-1.0.7.dist-info}/RECORD +98 -139
- python/utils.py +1 -1
- test/new-results/test/parameters/simu/hmm/all-mean-mute-freqs.csv +3 -3
- test/new-results/test/parameters/simu/hmm/all-mean-n-muted.csv +11 -11
- test/new-results/test/parameters/simu/hmm/all-probs.csv +3 -13
- test/new-results/test/parameters/simu/hmm/cluster_size.csv +1 -1
- test/new-results/test/parameters/simu/hmm/d-mean-mute-freqs.csv +6 -6
- test/new-results/test/parameters/simu/hmm/d-mean-n-muted.csv +3 -3
- test/new-results/test/parameters/simu/hmm/d_gene-d_3p_del-probs.csv +1 -6
- test/new-results/test/parameters/simu/hmm/d_gene-d_5p_del-probs.csv +2 -9
- test/new-results/test/parameters/simu/hmm/d_gene-probs.csv +1 -5
- test/new-results/test/parameters/simu/hmm/d_gene-vd_insertion-probs.csv +2 -10
- test/new-results/test/parameters/simu/hmm/dj_insertion_content.csv +4 -4
- test/new-results/test/parameters/simu/hmm/fv_insertion-probs.csv +2 -3
- test/new-results/test/parameters/simu/hmm/germline-sets/igh/extras.csv +0 -6
- test/new-results/test/parameters/simu/hmm/germline-sets/igh/ighd.fasta +0 -8
- test/new-results/test/parameters/simu/hmm/germline-sets/igh/ighj.fasta +0 -2
- test/new-results/test/parameters/simu/hmm/germline-sets/igh/ighv.fasta +0 -10
- test/new-results/test/parameters/simu/hmm/hmms/IGHD6-13_star_01.yaml +268 -267
- test/new-results/test/parameters/simu/hmm/hmms/IGHJ4_star_02.yaml +306 -306
- test/new-results/test/parameters/simu/hmm/hmms/IGHJ6_star_02.yaml +284 -284
- test/new-results/test/parameters/simu/hmm/hmms/IGHV3-66_star_02.yaml +1191 -1191
- test/new-results/test/parameters/simu/hmm/hmms/IGHV3-7_star_05.yaml +2 -2
- test/new-results/test/parameters/simu/hmm/j-mean-mute-freqs.csv +5 -5
- test/new-results/test/parameters/simu/hmm/j-mean-n-muted.csv +4 -4
- test/new-results/test/parameters/simu/hmm/j_gene-dj_insertion-probs.csv +2 -9
- test/new-results/test/parameters/simu/hmm/j_gene-j_3p_del-probs.csv +1 -2
- test/new-results/test/parameters/simu/hmm/j_gene-j_5p_del-probs.csv +2 -7
- test/new-results/test/parameters/simu/hmm/j_gene-probs.csv +1 -2
- test/new-results/test/parameters/simu/hmm/jf_insertion-probs.csv +1 -1
- test/new-results/test/parameters/simu/hmm/mute-freqs/IGHD6-13_star_01.csv +13 -16
- test/new-results/test/parameters/simu/hmm/mute-freqs/IGHJ4_star_02.csv +40 -44
- test/new-results/test/parameters/simu/hmm/mute-freqs/IGHJ6_star_02.csv +0 -2
- test/new-results/test/parameters/simu/hmm/mute-freqs/IGHV3-66_star_02.csv +291 -293
- test/new-results/test/parameters/simu/hmm/seq_content.csv +4 -4
- test/new-results/test/parameters/simu/hmm/v-mean-mute-freqs.csv +3 -3
- test/new-results/test/parameters/simu/hmm/v-mean-n-muted.csv +7 -7
- test/new-results/test/parameters/simu/hmm/v_gene-probs.csv +1 -6
- test/new-results/test/parameters/simu/hmm/v_gene-v_3p_del-probs.csv +1 -7
- test/new-results/test/parameters/simu/hmm/v_gene-v_5p_del-probs.csv +1 -6
- test/new-results/test/parameters/simu/hmm/vd_insertion_content.csv +4 -4
- test/new-results/test/parameters/simu/sw/all-mean-mute-freqs.csv +3 -3
- test/new-results/test/parameters/simu/sw/all-mean-n-muted.csv +8 -8
- test/new-results/test/parameters/simu/sw/all-probs.csv +1 -9
- test/new-results/test/parameters/simu/sw/cluster_size.csv +1 -1
- test/new-results/test/parameters/simu/sw/d-mean-mute-freqs.csv +5 -5
- test/new-results/test/parameters/simu/sw/d-mean-n-muted.csv +3 -3
- test/new-results/test/parameters/simu/sw/d_gene-d_3p_del-probs.csv +1 -7
- test/new-results/test/parameters/simu/sw/d_gene-d_5p_del-probs.csv +1 -7
- test/new-results/test/parameters/simu/sw/d_gene-probs.csv +1 -5
- test/new-results/test/parameters/simu/sw/d_gene-vd_insertion-probs.csv +1 -8
- test/new-results/test/parameters/simu/sw/dj_insertion_content.csv +4 -4
- test/new-results/test/parameters/simu/sw/fv_insertion-probs.csv +1 -1
- test/new-results/test/parameters/simu/sw/germline-sets/igh/extras.csv +0 -6
- test/new-results/test/parameters/simu/sw/germline-sets/igh/ighd.fasta +0 -8
- test/new-results/test/parameters/simu/sw/germline-sets/igh/ighj.fasta +0 -2
- test/new-results/test/parameters/simu/sw/germline-sets/igh/ighv.fasta +0 -10
- test/new-results/test/parameters/simu/sw/hmms/IGHD6-13_star_01.yaml +268 -267
- test/new-results/test/parameters/simu/sw/hmms/IGHJ4_star_02.yaml +306 -306
- test/new-results/test/parameters/simu/sw/hmms/IGHJ6_star_02.yaml +22 -22
- test/new-results/test/parameters/simu/sw/hmms/IGHV3-66_star_02.yaml +1191 -1191
- test/new-results/test/parameters/simu/sw/hmms/IGHV3-7_star_05.yaml +2 -2
- test/new-results/test/parameters/simu/sw/j-mean-mute-freqs.csv +4 -4
- test/new-results/test/parameters/simu/sw/j-mean-n-muted.csv +3 -3
- test/new-results/test/parameters/simu/sw/j_gene-dj_insertion-probs.csv +1 -7
- test/new-results/test/parameters/simu/sw/j_gene-j_3p_del-probs.csv +1 -2
- test/new-results/test/parameters/simu/sw/j_gene-j_5p_del-probs.csv +1 -7
- test/new-results/test/parameters/simu/sw/j_gene-probs.csv +1 -2
- test/new-results/test/parameters/simu/sw/jf_insertion-probs.csv +1 -1
- test/new-results/test/parameters/simu/sw/mute-freqs/IGHD6-13_star_01.csv +13 -16
- test/new-results/test/parameters/simu/sw/mute-freqs/IGHJ4_star_02.csv +40 -48
- test/new-results/test/parameters/simu/sw/mute-freqs/IGHV3-66_star_02.csv +291 -293
- test/new-results/test/parameters/simu/sw/seq_content.csv +4 -4
- test/new-results/test/parameters/simu/sw/v-mean-mute-freqs.csv +3 -3
- test/new-results/test/parameters/simu/sw/v-mean-n-muted.csv +7 -7
- test/new-results/test/parameters/simu/sw/v_gene-probs.csv +1 -6
- test/new-results/test/parameters/simu/sw/v_gene-v_3p_del-probs.csv +1 -7
- test/new-results/test/parameters/simu/sw/v_gene-v_5p_del-probs.csv +1 -6
- test/new-results/test/parameters/simu/sw/vd_insertion_content.csv +4 -4
- test/new-results/test/parameters/simu/sw-cache.yaml +1 -1
- test/new-results/test.log +24 -258
- test/test.py +4 -1
- bin/partis-pip +0 -116
- test/new-results/test/parameters/simu/hmm/hmms/IGHD1-20_star_01.yaml +0 -449
- test/new-results/test/parameters/simu/hmm/hmms/IGHD3-16_star_02.yaml +0 -870
- test/new-results/test/parameters/simu/hmm/hmms/IGHD3-22_star_01.yaml +0 -744
- test/new-results/test/parameters/simu/hmm/hmms/IGHD6-19_star_01.yaml +0 -534
- test/new-results/test/parameters/simu/hmm/hmms/IGHJ1_star_01.yaml +0 -986
- test/new-results/test/parameters/simu/hmm/hmms/IGHV1-18_star_01.yaml +0 -4484
- test/new-results/test/parameters/simu/hmm/hmms/IGHV3-23_star_01.yaml +0 -4484
- test/new-results/test/parameters/simu/hmm/hmms/IGHV4-4_star_09.yaml +0 -4438
- test/new-results/test/parameters/simu/hmm/hmms/IGHV4-61_star_01.yaml +0 -4529
- test/new-results/test/parameters/simu/hmm/hmms/IGHV5-51_star_01.yaml +0 -4484
- test/new-results/test/parameters/simu/hmm/mute-freqs/IGHD1-20_star_01.csv +0 -9
- test/new-results/test/parameters/simu/hmm/mute-freqs/IGHD3-16_star_02.csv +0 -30
- test/new-results/test/parameters/simu/hmm/mute-freqs/IGHD3-22_star_01.csv +0 -32
- test/new-results/test/parameters/simu/hmm/mute-freqs/IGHD6-19_star_01.csv +0 -22
- test/new-results/test/parameters/simu/hmm/mute-freqs/IGHJ1_star_01.csv +0 -50
- test/new-results/test/parameters/simu/hmm/mute-freqs/IGHV1-18_star_01.csv +0 -297
- test/new-results/test/parameters/simu/hmm/mute-freqs/IGHV3-23_star_01.csv +0 -297
- test/new-results/test/parameters/simu/hmm/mute-freqs/IGHV4-4_star_09.csv +0 -291
- test/new-results/test/parameters/simu/hmm/mute-freqs/IGHV4-61_star_01.csv +0 -300
- test/new-results/test/parameters/simu/hmm/mute-freqs/IGHV5-51_star_01.csv +0 -296
- test/new-results/test/parameters/simu/sw/hmms/IGHD1-20_star_01.yaml +0 -449
- test/new-results/test/parameters/simu/sw/hmms/IGHD3-16_star_02.yaml +0 -870
- test/new-results/test/parameters/simu/sw/hmms/IGHD3-22_star_01.yaml +0 -744
- test/new-results/test/parameters/simu/sw/hmms/IGHD6-19_star_01.yaml +0 -534
- test/new-results/test/parameters/simu/sw/hmms/IGHJ1_star_01.yaml +0 -986
- test/new-results/test/parameters/simu/sw/hmms/IGHV1-18_star_01.yaml +0 -4484
- test/new-results/test/parameters/simu/sw/hmms/IGHV3-23_star_01.yaml +0 -4484
- test/new-results/test/parameters/simu/sw/hmms/IGHV4-4_star_09.yaml +0 -4438
- test/new-results/test/parameters/simu/sw/hmms/IGHV4-61_star_01.yaml +0 -4529
- test/new-results/test/parameters/simu/sw/hmms/IGHV5-51_star_01.yaml +0 -4484
- test/new-results/test/parameters/simu/sw/mute-freqs/IGHD1-20_star_01.csv +0 -9
- test/new-results/test/parameters/simu/sw/mute-freqs/IGHD3-16_star_02.csv +0 -30
- test/new-results/test/parameters/simu/sw/mute-freqs/IGHD3-22_star_01.csv +0 -32
- test/new-results/test/parameters/simu/sw/mute-freqs/IGHD6-19_star_01.csv +0 -20
- test/new-results/test/parameters/simu/sw/mute-freqs/IGHJ1_star_01.csv +0 -50
- test/new-results/test/parameters/simu/sw/mute-freqs/IGHV1-18_star_01.csv +0 -297
- test/new-results/test/parameters/simu/sw/mute-freqs/IGHV3-23_star_01.csv +0 -297
- test/new-results/test/parameters/simu/sw/mute-freqs/IGHV4-4_star_09.csv +0 -291
- test/new-results/test/parameters/simu/sw/mute-freqs/IGHV4-61_star_01.csv +0 -300
- test/new-results/test/parameters/simu/sw/mute-freqs/IGHV5-51_star_01.csv +0 -296
- {partis_bcr-1.0.5.data → partis_bcr-1.0.7.data}/scripts/cf-alleles.py +0 -0
- {partis_bcr-1.0.5.data → partis_bcr-1.0.7.data}/scripts/cf-germlines.py +0 -0
- {partis_bcr-1.0.5.data → partis_bcr-1.0.7.data}/scripts/compare-plotdirs.py +0 -0
- {partis_bcr-1.0.5.data → partis_bcr-1.0.7.data}/scripts/extract-pairing-info.py +0 -0
- {partis_bcr-1.0.5.data → partis_bcr-1.0.7.data}/scripts/gctree-run.py +0 -0
- {partis_bcr-1.0.5.data → partis_bcr-1.0.7.data}/scripts/get-naive-probabilities.py +0 -0
- {partis_bcr-1.0.5.data → partis_bcr-1.0.7.data}/scripts/parse-output.py +0 -0
- {partis_bcr-1.0.5.data → partis_bcr-1.0.7.data}/scripts/split-loci.py +0 -0
- {partis_bcr-1.0.5.dist-info → partis_bcr-1.0.7.dist-info}/WHEEL +0 -0
- {partis_bcr-1.0.5.dist-info → partis_bcr-1.0.7.dist-info}/entry_points.txt +0 -0
- {partis_bcr-1.0.5.dist-info → partis_bcr-1.0.7.dist-info}/licenses/COPYING +0 -0
- {partis_bcr-1.0.5.dist-info → partis_bcr-1.0.7.dist-info}/top_level.txt +0 -0
test/new-results/test.log
CHANGED
@@ -1,265 +1,31 @@
|
|
1
|
-
[92mcache-parameters-simu[0m
|
1
|
+
[92mcache-parameters-quick-new-simu[0m partis cache-parameters --dont-write-git-info --infname test/ref-results/test/simu.yaml --parameter-dir test/new-results/test/parameters/simu --sw-cachefname test/new-results/test/parameters/simu/sw-cache.yaml --n-max-queries 10 --random-seed 1 --n-procs 10
|
2
|
+
--n-max-queries: stopped after reading 10 queries from input file
|
2
3
|
caching parameters
|
3
|
-
vsearch:
|
4
|
-
keeping
|
5
|
-
[91mmissing[0m 8 simulation genes (counts): [95mh[0m[91mv[0m[95m1[0m[95m-2[0m[93m02[0m 0 [95mh[0m[91mv[0m[95m2[0m[95m-5[0m[93m02[0m 0 [95mh[0m[91mv[0m[95m2[0m[95m-70D[0m[93m04[0m 0 [95mh[0m[91mv[0m[95m3[0m[95m-11[0m[93m04[0m 0 [95mh[0m[91mv[0m[95m3[0m[95m-69-1[0m[93m02[0m 0 [95mh[0m[91mv[0m[95m3[0m[95m-9[0m[93m02[0m 0 [95mh[0m[91mv[0m[95m4[0m[95m-34[0m[93m01[0m 0 [95mh[0m[91mv[0m[95m4[0m[95m-39[0m[93m09[0m 0
|
4
|
+
vsearch: 10 / 10 v annotations (0 failed) with 2 v genes in 0.0 sec
|
5
|
+
keeping 2 / 198 v genes
|
6
6
|
smith-waterman (new-allele fitting)
|
7
|
-
vsearch:
|
7
|
+
vsearch: 10 / 10 v annotations (0 failed) with 2 v genes in 0.0 sec
|
8
8
|
removing old sw cache test/new-results/test/parameters/simu/sw-cache.yaml
|
9
|
-
running 10 procs for
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
water time: 0.1 (ig-sw 0.0 processing 0.0)
|
9
|
+
running 10 procs for 10 seqs
|
10
|
+
info for 10 / 10 = 1.000 (removed: 0 failed)
|
11
|
+
kept 10 (1.000) unproductive
|
12
|
+
water time: 0.0 (ig-sw 0.0 processing 0.0)
|
14
13
|
smith-waterman (writing parameters)
|
15
|
-
vsearch:
|
16
|
-
running 10 procs for
|
17
|
-
|
18
|
-
|
19
|
-
kept 18 (0.500) unproductive
|
14
|
+
vsearch: 10 / 10 v annotations (0 failed) with 2 v genes in 0.0 sec
|
15
|
+
running 10 procs for 10 seqs
|
16
|
+
info for 10 / 10 = 1.000 (removed: 0 failed)
|
17
|
+
kept 10 (1.000) unproductive
|
20
18
|
writing sw results to test/new-results/test/parameters/simu/sw-cache.yaml
|
21
|
-
writing parameters to test/new-results/test/parameters/simu/sw (0.
|
22
|
-
water time:
|
23
|
-
writing hmms removed
|
24
|
-
(0.
|
19
|
+
writing parameters to test/new-results/test/parameters/simu/sw (0.4 sec)
|
20
|
+
water time: 0.5 (ig-sw 0.5 processing 0.0)
|
21
|
+
writing hmms removed 35 genes from glfo (leaving v 2 d 1 j 2)
|
22
|
+
(0.1 sec)
|
25
23
|
hmm
|
26
24
|
reading output
|
27
|
-
read
|
28
|
-
writing parameters to test/new-results/test/parameters/simu/hmm (0.
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
total time: 3.4
|
35
|
-
[92mannotate-new-simu[0m partis annotate --dont-write-git-info --infname test/ref-results/test/simu.yaml --parameter-dir test/new-results/test/parameters/simu --sw-cachefname test/new-results/test/parameters/simu/sw-cache.yaml --plot-annotation-performance --is-simu --plotdir test/new-results/annotate-new-simu-annotation-performance --only-csv-plots --random-seed 1 --n-procs 10 --outfname test/new-results/annotate-new-simu.yaml
|
36
|
-
annotating (with test/new-results/test/parameters/simu/hmm)
|
37
|
-
smith-waterman
|
38
|
-
vsearch: 36 / 36 v annotations (0 failed) with 7 v genes in 0.0 sec
|
39
|
-
reading sw results from test/new-results/test/parameters/simu/sw-cache.yaml
|
40
|
-
info for 36 / 36 = 1.000 (removed: 0 failed, 0 duplicates [removed when cache file was written])
|
41
|
-
kept 18 (0.500) unproductive
|
42
|
-
plotting performance
|
43
|
-
[93mwarning[0m skipped annotation performance evaluation on 1 queries with different true and inferred net shm indel lengths: d8761c689a
|
44
|
-
(0.0 sec)
|
45
|
-
water time: 0.3
|
46
|
-
hmm
|
47
|
-
reading output
|
48
|
-
read 36 hmm output lines with 36 sequences in 36 events (0 failures)
|
49
|
-
plotting performance
|
50
|
-
[93mwarning[0m skipped annotation performance evaluation on 1 queries with different true and inferred net shm indel lengths: d8761c689a
|
51
|
-
(0.0 sec)
|
52
|
-
hmm step time: 0.4
|
53
|
-
total time: 0.7
|
54
|
-
[92mmulti-annotate-new-simu[0m partis annotate --dont-write-git-info --infname test/ref-results/test/simu.yaml --parameter-dir test/new-results/test/parameters/simu --sw-cachefname test/new-results/test/parameters/simu/sw-cache.yaml --plot-annotation-performance --simultaneous-true-clonal-seqs --is-simu --plotdir test/new-results/multi-annotate-new-simu-annotation-performance --only-csv-plots --random-seed 1 --n-procs 10 --outfname test/new-results/multi-annotate-new-simu.yaml
|
55
|
-
annotating (with test/new-results/test/parameters/simu/hmm)
|
56
|
-
smith-waterman
|
57
|
-
vsearch: 36 / 36 v annotations (0 failed) with 7 v genes in 0.0 sec
|
58
|
-
note: not running msa indel stuff for --simultaneous-true-clonal-seqs, so any families with shm indels within cdr3 will be split up before running the hmm. To fix this you'll either need to run set_msa_info() (which is fine and easy, but slow, and requires deciding whether to make sure to run parameter caching with the arg, or else rerun smith waterman with the msa indels
|
59
|
-
reading sw results from test/new-results/test/parameters/simu/sw-cache.yaml
|
60
|
-
info for 36 / 36 = 1.000 (removed: 0 failed, 0 duplicates [removed when cache file was written])
|
61
|
-
kept 18 (0.500) unproductive
|
62
|
-
plotting performance
|
63
|
-
[93mwarning[0m skipped annotation performance evaluation on 1 queries with different true and inferred net shm indel lengths: d8761c689a
|
64
|
-
(0.0 sec)
|
65
|
-
water time: 0.3
|
66
|
-
hmm
|
67
|
-
--simultaneous-true-clonal-seqs: grouping seqs according to true partition
|
68
|
-
[93mwarning[0m split apart 1 cluster that contained multiple cdr3 lengths (total clusters: 10 --> 11)
|
69
|
-
cluster splits: 8 --> 7 1
|
70
|
-
subcluster annotating 11 clusters with steps: (0.2s) (0.1s) plotting performance
|
71
|
-
[93mwarning[0m skipped annotation performance evaluation on 1 queries with different true and inferred net shm indel lengths: d8761c689a
|
72
|
-
(0.0 sec)
|
73
|
-
|
74
|
-
subcluster annotation time 0.3
|
75
|
-
total time: 0.7
|
76
|
-
[92mpartition-new-simu[0m partis partition --dont-write-git-info --infname test/ref-results/test/simu.yaml --parameter-dir test/new-results/test/parameters/simu --sw-cachefname test/new-results/test/parameters/simu/sw-cache.yaml --plot-annotation-performance --max-ccf-fail-frac 0.10 --is-simu --persistent-cachefname test/new-results/cache-new-partition.csv --plotdir test/new-results/partition-new-simu-annotation-performance --only-csv-plots --no-partition-plots --random-seed 1 --n-procs 10 --outfname test/new-results/partition-new-simu.yaml
|
77
|
-
partitioning (with test/new-results/test/parameters/simu/hmm)
|
78
|
-
smith-waterman
|
79
|
-
vsearch: 36 / 36 v annotations (0 failed) with 7 v genes in 0.0 sec
|
80
|
-
reading sw results from test/new-results/test/parameters/simu/sw-cache.yaml
|
81
|
-
info for 36 / 36 = 1.000 (removed: 0 failed, 0 duplicates [removed when cache file was written])
|
82
|
-
kept 18 (0.500) unproductive
|
83
|
-
plotting performance
|
84
|
-
[93mwarning[0m skipped annotation performance evaluation on 1 queries with different true and inferred net shm indel lengths: d8761c689a
|
85
|
-
(0.0 sec)
|
86
|
-
water time: 0.3
|
87
|
-
hmm
|
88
|
-
--persistent-cachefname: using existing hmm cache file test/new-results/cache-new-partition.csv
|
89
|
-
caching all 36 naive sequences (0.4s)
|
90
|
-
collapsed 36 queries into 12 clusters with identical naive seqs (0.0 sec)
|
91
|
-
12 clusters with 10 procs (0.1s)
|
92
|
-
12 clusters with 7 procs (0.0s)
|
93
|
-
12 clusters with 5 procs (0.0s)
|
94
|
-
12 clusters with 3 procs (0.0s)
|
95
|
-
12 clusters with 2 procs (0.1s)
|
96
|
-
11 clusters with 1 proc (0.4s)
|
97
|
-
partition loop time: 0.7
|
98
|
-
getting annotations for final partition
|
99
|
-
subcluster annotating 10 clusters with steps: (0.2s) (0.1s) (0.1s) plotting performance
|
100
|
-
[93mwarning[0m skipped annotation performance evaluation on 1 queries with different true and inferred net shm indel lengths: d8761c689a
|
101
|
-
(0.0 sec)
|
102
|
-
|
103
|
-
subcluster annotation time 0.4
|
104
|
-
total time: 1.7
|
105
|
-
[92mseed-partition-new-simu[0m partis partition --dont-write-git-info --infname test/ref-results/test/simu.yaml --parameter-dir test/new-results/test/parameters/simu --sw-cachefname test/new-results/test/parameters/simu/sw-cache.yaml --max-ccf-fail-frac 0.10 --is-simu --persistent-cachefname test/new-results/cache-new-partition.csv --seed-unique-id 8024ed1a22 --random-seed 1 --n-procs 10 --outfname test/new-results/seed-partition-new-simu.yaml
|
106
|
-
partitioning (with test/new-results/test/parameters/simu/hmm)
|
107
|
-
smith-waterman
|
108
|
-
vsearch: 36 / 36 v annotations (0 failed) with 7 v genes in 0.0 sec
|
109
|
-
reading sw results from test/new-results/test/parameters/simu/sw-cache.yaml
|
110
|
-
info for 36 / 36 = 1.000 (removed: 0 failed, 0 duplicates [removed when cache file was written])
|
111
|
-
kept 18 (0.500) unproductive
|
112
|
-
removed 25 / 36 = 0.69 sequences with cdr3 length different from seed sequence (leaving 11)
|
113
|
-
water time: 0.0
|
114
|
-
hmm
|
115
|
-
--persistent-cachefname: using existing hmm cache file test/new-results/cache-new-partition.csv
|
116
|
-
collapsed 11 queries into 2 clusters with identical naive seqs (0.0 sec)
|
117
|
-
reducing n procs to number of clusters: 10 --> 2
|
118
|
-
2 clusters with 2 procs (0.0s)
|
119
|
-
removed 0 sequences in unseeded clusters, split 2 seeded clusters into 11 singletons, and merged these into 2 clusters with identical naive seqs (0.0 sec)
|
120
|
-
new n_procs 1 (initial seqs/proc: 5.50 new seqs/proc: 2.00
|
121
|
-
2 clusters with 1 proc (0.1s)
|
122
|
-
partition loop time: 0.1
|
123
|
-
getting annotations for final partition
|
124
|
-
subcluster annotating 1 cluster with steps: (0.1s) (0.1s) (0.1s)
|
125
|
-
subcluster annotation time 0.2
|
126
|
-
seed cluster size in best partition: 11, excluding seed seq: 10
|
127
|
-
total time: 0.4
|
128
|
-
[92mvsearch-partition-new-simu[0m partis partition --dont-write-git-info --infname test/ref-results/test/simu.yaml --parameter-dir test/new-results/test/parameters/simu --sw-cachefname test/new-results/test/parameters/simu/sw-cache.yaml --naive-vsearch --is-simu --persistent-cachefname test/new-results/cache-new-partition.csv --random-seed 1 --n-procs 10 --outfname test/new-results/vsearch-partition-new-simu.yaml
|
129
|
-
partitioning (with test/new-results/test/parameters/simu/hmm)
|
130
|
-
smith-waterman
|
131
|
-
vsearch: 36 / 36 v annotations (0 failed) with 7 v genes in 0.0 sec
|
132
|
-
reading sw results from test/new-results/test/parameters/simu/sw-cache.yaml
|
133
|
-
info for 36 / 36 = 1.000 (removed: 0 failed, 0 duplicates [removed when cache file was written])
|
134
|
-
kept 18 (0.500) unproductive
|
135
|
-
water time: 0.0
|
136
|
-
hmm
|
137
|
-
--persistent-cachefname: using existing hmm cache file test/new-results/cache-new-partition.csv
|
138
|
-
collapsed 36 sequences (36 initial naive seqs/clusters) into 12 unique naive sequences over 9 cdr3 lengths (0.0 sec)
|
139
|
-
using hfrac bound for vsearch 0.013
|
140
|
-
running vsearch 9 times (once for each cdr3 length class): . . . . . . . . .
|
141
|
-
vsearch time: 0.1
|
142
|
-
getting annotations for final partition
|
143
|
-
calculating hmm annotations even though --fast/--naive-vsearch was set (you can set --use-sw-annotations to get faster (but substantially less accurate) annotations, or set --dont-calculate-annotations if you only need the partition)
|
144
|
-
subcluster annotating 10 clusters with steps: (0.2s) (0.1s) (0.1s)
|
145
|
-
subcluster annotation time 0.4
|
146
|
-
total time: 0.5
|
147
|
-
[92mget-selection-metrics-new-simu[0m partis get-selection-metrics --dont-write-git-info --existing-output-run-cfg paired --min-selection-metric-cluster-size 3 --min-paired-cluster-size-to-read 3 --random-seed 1 --n-procs 10 --outfname test/new-results/partition-new-simu.yaml --selection-metric-fname test/new-results/get-selection-metrics-new-simu.yaml
|
148
|
-
note: --parameter-dir not set, so using default: x-dummy-x
|
149
|
-
note: By default we print/operate on *all* annotations in the output file, which in general can include annotations from non-best partititons and non-seed clusters (e.g. if --n-final-clusters was set).
|
150
|
-
If you want to restrict to particular annotations, use one of --only-print-best-partition, --only-print-seed-clusters, or --only-print-queries-to-include-clusters (or, if set during partitioning, --n-final-clusters or --min-largest-cluster-size).
|
151
|
-
getting selection metrics (lbi lbr aa-lbi aa-lbr cons-dist-aa) with inferred lines: 4 clusters with sizes 11 7 7 3
|
152
|
-
skipped 6 smaller than 3 (controlled by --min-selection-metric-cluster-size)
|
153
|
-
getting trees for 3 clusters with sizes: 11 7 7
|
154
|
-
all fasttree outputs exist, not rerunning (e.g. /home/dralph/work/partis/test/new-results/partition-new-simu/fasttree/iclust-0/fasttree.out)
|
155
|
-
tree origins: 3 ran fasttree
|
156
|
-
skipped 1/4 clusters smaller than 4
|
157
|
-
setting default tau to 1 / 352 = 0.0028
|
158
|
-
calculating normalized lb index and lb ratio and lb fraction with tau 0.0028
|
159
|
-
[93mwarning[0m get_aa_tree() (AA inf tree, iclust 0): skipped 13/18 edges for which we didn't have sequences for both nodes (i.e. left the original branch length unmodified). Missing nodes: amz bev bnw bop dkn ikm
|
160
|
-
setting default tau to 1 / 352 = 0.0028
|
161
|
-
calculating normalized lb index and lb ratio and lb fraction on aa tree with tau 0.0028
|
162
|
-
[94miclust 1: [0m[93mwarning [0mtree depth and mfreq differ by more than 25% for 2/7 nodes (note that this is expected if these are single chain sequences being compared to a paired h+l tree)
|
163
|
-
mean values: tree depth 0.001 mfreq 0.001 diff 0.000 abs(frac diff) 25% ratio 1.3
|
164
|
-
10 with highest abs(diff):
|
165
|
-
tree depth mfreq ratio diff
|
166
|
-
0.0034 0.0027 1.3 0.0007 20a0129b57
|
167
|
-
0.0034 0.0027 1.3 0.0007 97366cf0d8
|
168
|
-
10 with highest+lowest ratios:
|
169
|
-
0.0034 0.0027 1.3 0.0007 20a0129b57
|
170
|
-
0.0034 0.0027 1.3 0.0007 97366cf0d8
|
171
|
-
0.0034 0.0027 1.3 0.0007 20a0129b57
|
172
|
-
0.0034 0.0027 1.3 0.0007 97366cf0d8
|
173
|
-
[93mwarning[0m get_aa_tree() (AA inf tree, iclust 1): skipped 3/9 edges for which we didn't have sequences for both nodes (i.e. left the original branch length unmodified). Missing nodes: eov
|
174
|
-
[93mwarning[0m get_aa_tree() (AA inf tree, iclust 2): skipped 11/13 edges for which we didn't have sequences for both nodes (i.e. left the original branch length unmodified). Missing nodes: apr dhq fnv nox uvx
|
175
|
-
skipped 1/4 clusters that had no uids in common with tree
|
176
|
-
writing selection metrics to test/new-results/get-selection-metrics-new-simu.yaml
|
177
|
-
total time: 0.1
|
178
|
-
[92mcache-parameters-data[0m partis cache-parameters --dont-write-git-info --infname test/mishmash.fa --parameter-dir test/new-results/test/parameters/data --sw-cachefname test/new-results/test/parameters/data/sw-cache.yaml --n-max-queries 50 --input-metafnames test/input-meta.yaml --random-seed 1 --n-procs 10
|
179
|
-
stopped after reading 50 sequences from test/mishmash.fa
|
180
|
-
--n-max-queries: stopped after reading 50 queries from input file
|
181
|
-
--input-metafnames: added meta info for 4 sequences from test/input-meta.yaml: multiplicities
|
182
|
-
caching parameters
|
183
|
-
vsearch: 44 / 50 v annotations (6 failed) with 54 v genes in 0.0 sec
|
184
|
-
keeping 24 / 198 v genes
|
185
|
-
smith-waterman (new-allele fitting)
|
186
|
-
vsearch: 45 / 50 v annotations (5 failed) with 23 v genes in 0.0 sec
|
187
|
-
removing old sw cache test/new-results/test/parameters/data/sw-cache.yaml
|
188
|
-
running 10 procs for 50 seqs
|
189
|
-
running 12 procs for 5 seqs
|
190
|
-
info for 46 / 50 = 0.920 (removed: 4 failed)
|
191
|
-
kept 16 (0.320) unproductive
|
192
|
-
water time: 0.1 (ig-sw 0.0 processing 0.0)
|
193
|
-
smith-waterman (writing parameters)
|
194
|
-
vsearch: 45 / 50 v annotations (5 failed) with 23 v genes in 0.0 sec
|
195
|
-
running 10 procs for 46 seqs
|
196
|
-
running 11 procs for 1 seq
|
197
|
-
info for 46 / 50 = 0.920 (removed: 4 failed)
|
198
|
-
kept 16 (0.320) unproductive
|
199
|
-
writing sw results to test/new-results/test/parameters/data/sw-cache.yaml
|
200
|
-
writing parameters to test/new-results/test/parameters/data/sw (1.0 sec)
|
201
|
-
water time: 1.2 (ig-sw 1.1 processing 0.0)
|
202
|
-
writing hmms removed 15 genes from glfo (leaving v 18 d 22 j 7)
|
203
|
-
(0.4 sec)
|
204
|
-
hmm
|
205
|
-
reading output
|
206
|
-
read 46 hmm output lines with 46 sequences in 46 events (0 failures)
|
207
|
-
writing parameters to test/new-results/test/parameters/data/hmm (0.8 sec)
|
208
|
-
infra time: 0.9
|
209
|
-
hmm step time: 1.8
|
210
|
-
writing hmms removed 6 genes from glfo (leaving v 15 d 19 j 7)
|
211
|
-
(0.4 sec)
|
212
|
-
total time: 4.1
|
213
|
-
[92msimulate[0m partis simulate --dont-write-git-info --parameter-dir test/new-results/test/parameters/data --n-sim-events 10 --n-trees 10 --n-leaf-distribution geometric --n-leaves 5 --random-seed 1 --n-procs 10 --outfname test/new-results/test/simu.yaml --indel-frequency 0.2
|
214
|
-
simulating
|
215
|
-
Traceback (most recent call last):
|
216
|
-
File [96m"/home/dralph/.local/pipx/venvs/partis-bcr/lib/python3.10/site-packages/bin/partis"[39;49;00m, line [94m1874[39;49;00m, in <module>[90m[39;49;00m
|
217
|
-
[90m [39;49;00margs.func(args)[90m[39;49;00m
|
218
|
-
File [96m"/home/dralph/.local/pipx/venvs/partis-bcr/lib/python3.10/site-packages/bin/partis"[39;49;00m, line [94m195[39;49;00m, in run_simulation[90m[39;49;00m
|
219
|
-
[90m [39;49;00mcmdfos = run_sub_cmds(working_gldir)[90m[39;49;00m
|
220
|
-
File [96m"/home/dralph/.local/pipx/venvs/partis-bcr/lib/python3.10/site-packages/bin/partis"[39;49;00m, line [94m120[39;49;00m, in run_sub_cmds[90m[39;49;00m
|
221
|
-
[90m [39;49;00mutils.run_cmds(cmdfos, batch_system=args.batch_system, batch_options=args.batch_options, batch_config_fname=args.batch_config_fname, debug=[33m'[39;49;00m[33mprint[39;49;00m[33m'[39;49;00m)[90m[39;49;00m
|
222
|
-
File [96m"/home/dralph/.local/pipx/venvs/partis-bcr/lib/python3.10/site-packages/python/utils.py"[39;49;00m, line [94m5510[39;49;00m, in run_cmds[90m[39;49;00m
|
223
|
-
[90m [39;49;00mstatus, dbgstrs[iproc] = finish_process(iproc, procs, n_tries_list[iproc], cmdfos[iproc], n_max_tries, dbgfo=cmdfos[iproc].get([33m'[39;49;00m[33mdbgfo[39;49;00m[33m'[39;49;00m), batch_system=batch_system, debug=debug, ignore_stderr=ignore_stderr, clean_on_success=clean_on_success, allow_failure=allow_failure)[90m[39;49;00m
|
224
|
-
File [96m"/home/dralph/.local/pipx/venvs/partis-bcr/lib/python3.10/site-packages/python/utils.py"[39;49;00m, line [94m5630[39;49;00m, in finish_process[90m[39;49;00m
|
225
|
-
[90m [39;49;00m[94mraise[39;49;00m [96mException[39;49;00m(failstr)[90m[39;49;00m
|
226
|
-
[91mException[39;49;00m: exceeded max number of tries (1 >= 1) for subprocess with command:[90m[39;49;00m
|
227
|
-
partis simulate --dont-write-git-info --parameter-dir test/new-results/test/parameters/data --n-sim-events 1 --n-trees 10 --n-leaf-distribution geometric --n-leaves 5 --random-seed 1 --n-procs 1 --outfname /tmp/dralph/hmms/852975/sub-0/simu.yaml --indel-frequency 0.2 --im-a-subproc --workdir /tmp/dralph/hmms/852975/sub-0
|
228
|
-
[91mstdout:[0m /tmp/dralph/hmms/852975/log-0/out
|
229
|
-
reco params: test/new-results/test/parameters/data/hmm shm params: test/new-results/test/parameters/data/hmm
|
230
|
-
|
231
|
-
[91mstderr:[0m /tmp/dralph/hmms/852975/log-0/err
|
232
|
-
Traceback (most recent call last):
|
233
|
-
File [96m"/home/dralph/.local/pipx/venvs/partis-bcr/lib/python3.10/site-packages/python/utils.py"[39;49;00m, line [94m5228[39;49;00m, in check_cmd[90m[39;49;00m
|
234
|
-
[90m [39;49;00msubprocess.check_call([cmd] + options, stdout=[96mopen[39;49;00m([33m'[39;49;00m[33m/dev/null[39;49;00m[33m'[39;49;00m))[90m[39;49;00m
|
235
|
-
File [96m"/usr/lib/python3.10/subprocess.py"[39;49;00m, line [94m364[39;49;00m, in check_call[90m[39;49;00m
|
236
|
-
[90m [39;49;00mretcode = call(*popenargs, **kwargs)[90m[39;49;00m
|
237
|
-
File [96m"/usr/lib/python3.10/subprocess.py"[39;49;00m, line [94m345[39;49;00m, in call[90m[39;49;00m
|
238
|
-
[90m [39;49;00m[94mwith[39;49;00m Popen(*popenargs, **kwargs) [94mas[39;49;00m p:[90m[39;49;00m
|
239
|
-
File [96m"/usr/lib/python3.10/subprocess.py"[39;49;00m, line [94m971[39;49;00m, in __init__[90m[39;49;00m
|
240
|
-
[90m [39;49;00m[96mself[39;49;00m._execute_child(args, executable, preexec_fn, close_fds,[90m[39;49;00m
|
241
|
-
File [96m"/usr/lib/python3.10/subprocess.py"[39;49;00m, line [94m1863[39;49;00m, in _execute_child[90m[39;49;00m
|
242
|
-
[90m [39;49;00m[94mraise[39;49;00m child_exception_type(errno_num, err_msg, err_filename)[90m[39;49;00m
|
243
|
-
[91mFileNotFoundError[39;49;00m: [Errno 2] No such file or directory: 'R'[90m[39;49;00m
|
244
|
-
[90m[39;49;00m
|
245
|
-
During handling of the above exception, another exception occurred:
|
246
|
-
|
247
|
-
Traceback (most recent call last):
|
248
|
-
File [96m"/home/dralph/.local/pipx/venvs/partis-bcr/lib/python3.10/site-packages/bin/partis"[39;49;00m, line [94m1874[39;49;00m, in <module>[90m[39;49;00m
|
249
|
-
[90m [39;49;00margs.func(args)[90m[39;49;00m
|
250
|
-
File [96m"/home/dralph/.local/pipx/venvs/partis-bcr/lib/python3.10/site-packages/bin/partis"[39;49;00m, line [94m193[39;49;00m, in run_simulation[90m[39;49;00m
|
251
|
-
[90m [39;49;00mmake_events(args.n_sim_events, args.workdir, args.outfname, [random.randint([94m0[39;49;00m, numpy.iinfo(numpy.int32).max) [94mfor[39;49;00m _ [95min[39;49;00m [96mrange[39;49;00m(args.n_sim_events)], heavy_chain_events=heavy_chain_events)[90m[39;49;00m
|
252
|
-
File [96m"/home/dralph/.local/pipx/venvs/partis-bcr/lib/python3.10/site-packages/bin/partis"[39;49;00m, line [94m177[39;49;00m, in make_events[90m[39;49;00m
|
253
|
-
[90m [39;49;00mreco = Recombinator(args, glfo, seed=args.random_seed, workdir=workdir, heavy_chain_events=heavy_chain_events)[90m[39;49;00m
|
254
|
-
File [96m"/home/dralph/.local/pipx/venvs/partis-bcr/lib/python3.10/site-packages/python/recombinator.py"[39;49;00m, line [94m78[39;49;00m, in __init__[90m[39;49;00m
|
255
|
-
[90m [39;49;00mtreegen.generate_trees(seed, [96mself[39;49;00m.treefname, [96mself[39;49;00m.workdir)[90m[39;49;00m
|
256
|
-
File [96m"/home/dralph/.local/pipx/venvs/partis-bcr/lib/python3.10/site-packages/python/treegenerator.py"[39;49;00m, line [94m257[39;49;00m, in generate_trees[90m[39;49;00m
|
257
|
-
[90m [39;49;00mages, treestrs = [96mself[39;49;00m.run_treesim(seed, outfname, workdir)[90m[39;49;00m
|
258
|
-
File [96m"/home/dralph/.local/pipx/venvs/partis-bcr/lib/python3.10/site-packages/python/treegenerator.py"[39;49;00m, line [94m205[39;49;00m, in run_treesim[90m[39;49;00m
|
259
|
-
[90m [39;49;00mutils.run_r(cmd_lines, workdir, print_time=[33m'[39;49;00m[33mtree generation[39;49;00m[33m'[39;49;00m [94mif[39;49;00m [96mself[39;49;00m.args.debug [94melse[39;49;00m [94mNone[39;49;00m, remove_cmdfile=[94mTrue[39;49;00m)[90m[39;49;00m
|
260
|
-
File [96m"/home/dralph/.local/pipx/venvs/partis-bcr/lib/python3.10/site-packages/python/utils.py"[39;49;00m, line [94m5248[39;49;00m, in run_r[90m[39;49;00m
|
261
|
-
[90m [39;49;00mcheck_cmd([33m'[39;49;00m[33mR[39;49;00m[33m'[39;49;00m, options=[[33m'[39;49;00m[33m--slave[39;49;00m[33m'[39;49;00m, [33m'[39;49;00m[33m--version[39;49;00m[33m'[39;49;00m])[90m[39;49;00m
|
262
|
-
File [96m"/home/dralph/.local/pipx/venvs/partis-bcr/lib/python3.10/site-packages/python/utils.py"[39;49;00m, line [94m5235[39;49;00m, in check_cmd[90m[39;49;00m
|
263
|
-
[90m [39;49;00m[94mraise[39;49;00m [96mException[39;49;00m([33m'[39;49;00m[33mcommand [39;49;00m[33m\'[39;49;00m[33m%s[39;49;00m[33m\'[39;49;00m[33m not found in path (maybe not installed?)[39;49;00m[33m'[39;49;00m % cmd)[90m[39;49;00m
|
264
|
-
[91mException[39;49;00m: command 'R' not found in path (maybe not installed?)[90m[39;49;00m
|
265
|
-
|
25
|
+
read 10 hmm output lines with 10 sequences in 10 events (0 failures)
|
26
|
+
writing parameters to test/new-results/test/parameters/simu/hmm (0.2 sec)
|
27
|
+
infra time: 0.2
|
28
|
+
hmm step time: 0.3
|
29
|
+
writing hmms removed 0 genes from glfo (leaving v 2 d 1 j 2)
|
30
|
+
(0.1 sec)
|
31
|
+
total time: 1.2
|
test/test.py
CHANGED
@@ -33,7 +33,10 @@ class Tester(object):
|
|
33
33
|
# ----------------------------------------------------------------------------------------
|
34
34
|
def dirs(self, tstr, force_paired=False):
|
35
35
|
assert tstr in ['ref', 'new']
|
36
|
-
|
36
|
+
bdir = 'test%s' % ('/paired' if (args.paired or force_paired) else '')
|
37
|
+
if not os.path.exists(bdir):
|
38
|
+
bdir = '%s/%s' % (utils.get_partis_dir(), bdir)
|
39
|
+
return '%s/%s-results%s' % (bdir, tstr, '-slow' if args.slow else '')
|
37
40
|
# ----------------------------------------------------------------------------------------
|
38
41
|
def nqr(self, act):
|
39
42
|
if act == 'quick': # bears no relation to the others, so makes sense to handle it differently
|
bin/partis-pip
DELETED
@@ -1,116 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python3
|
2
|
-
from __future__ import absolute_import, division, unicode_literals
|
3
|
-
from __future__ import print_function
|
4
|
-
import argparse
|
5
|
-
import copy
|
6
|
-
import time
|
7
|
-
import random
|
8
|
-
import sys
|
9
|
-
import subprocess
|
10
|
-
# import multiprocessing
|
11
|
-
import numpy
|
12
|
-
import scipy
|
13
|
-
import math
|
14
|
-
import itertools
|
15
|
-
import collections
|
16
|
-
import traceback
|
17
|
-
from io import open
|
18
|
-
import colored_traceback.always
|
19
|
-
import os
|
20
|
-
import json
|
21
|
-
import csv
|
22
|
-
import operator
|
23
|
-
import glob
|
24
|
-
from collections import defaultdict
|
25
|
-
|
26
|
-
# Auto-detect installation type and set up imports accordingly
|
27
|
-
def setup_partis_environment():
|
28
|
-
# Check if we're in a pip installation or source installation
|
29
|
-
current_dir = os.path.dirname(os.path.realpath(__file__))
|
30
|
-
|
31
|
-
# Try to detect pip installation structure
|
32
|
-
if current_dir.endswith('/site-packages/bin'):
|
33
|
-
# We're in a pip installation: /site-packages/bin/partis
|
34
|
-
site_packages_dir = os.path.dirname(current_dir) # /site-packages
|
35
|
-
partis_dir = site_packages_dir
|
36
|
-
|
37
|
-
# Set up environment for pip installation
|
38
|
-
os.environ['PARTIS_DIR'] = partis_dir
|
39
|
-
sys.path.insert(1, site_packages_dir)
|
40
|
-
|
41
|
-
# Import using pip package structure
|
42
|
-
import partis.utils as utils
|
43
|
-
import partis.glutils as glutils
|
44
|
-
import partis.treeutils as treeutils
|
45
|
-
import partis.processargs as processargs
|
46
|
-
import partis.seqfileopener as seqfileopener
|
47
|
-
from partis.partitiondriver import PartitionDriver
|
48
|
-
from partis.clusterpath import ClusterPath
|
49
|
-
import partis.paircluster as paircluster
|
50
|
-
from partis.parametercounter import ParameterCounter
|
51
|
-
from partis.corrcounter import CorrCounter
|
52
|
-
from partis.waterer import Waterer
|
53
|
-
|
54
|
-
return utils, glutils, treeutils, processargs, seqfileopener, PartitionDriver, ClusterPath, paircluster, ParameterCounter, CorrCounter, Waterer, partis_dir
|
55
|
-
|
56
|
-
else:
|
57
|
-
# We're in a source installation: assume standard partis directory structure
|
58
|
-
partis_dir = os.path.dirname(os.path.realpath(__file__)).replace('/bin', '')
|
59
|
-
if not os.path.exists(partis_dir):
|
60
|
-
print('%s partis dir %s doesn\'t exist, so python path may not be correctly set' % (os.path.dirname(os.path.realpath(__file__)), partis_dir))
|
61
|
-
sys.path.insert(1, partis_dir)
|
62
|
-
|
63
|
-
# Set up environment for source installation
|
64
|
-
os.environ['PARTIS_DIR'] = partis_dir
|
65
|
-
|
66
|
-
# Import using source structure
|
67
|
-
import python.utils as utils
|
68
|
-
import python.glutils as glutils
|
69
|
-
import python.treeutils as treeutils
|
70
|
-
import python.processargs as processargs
|
71
|
-
import python.seqfileopener as seqfileopener
|
72
|
-
from python.partitiondriver import PartitionDriver
|
73
|
-
from python.clusterpath import ClusterPath
|
74
|
-
import python.paircluster as paircluster
|
75
|
-
from python.parametercounter import ParameterCounter
|
76
|
-
from python.corrcounter import CorrCounter
|
77
|
-
from python.waterer import Waterer
|
78
|
-
|
79
|
-
return utils, glutils, treeutils, processargs, seqfileopener, PartitionDriver, ClusterPath, paircluster, ParameterCounter, CorrCounter, Waterer, partis_dir
|
80
|
-
|
81
|
-
# Initialize environment and imports
|
82
|
-
utils, glutils, treeutils, processargs, seqfileopener, PartitionDriver, ClusterPath, paircluster, ParameterCounter, CorrCounter, Waterer, partis_dir = setup_partis_environment()
|
83
|
-
|
84
|
-
# ----------------------------------------------------------------------------------------
|
85
|
-
def run_simulation(args):
|
86
|
-
# ----------------------------------------------------------------------------------------
|
87
|
-
def run_sub_cmds(working_gldir):
|
88
|
-
# ----------------------------------------------------------------------------------------
|
89
|
-
def get_sub_events(iproc):
|
90
|
-
n_sub_events = args.n_sim_events // args.n_procs
|
91
|
-
if iproc == args.n_procs - 1 and args.n_sim_events % args.n_procs > 0: # do any extra ones in the last proc (has to match sub file writer below)
|
92
|
-
n_sub_events += args.n_sim_events % args.n_procs
|
93
|
-
n_per_proc_list.append(n_sub_events)
|
94
|
-
return n_sub_events
|
95
|
-
# ----------------------------------------------------------------------------------------
|
96
|
-
def get_workdir(iproc):
|
97
|
-
return utils.choose_random_subdir('/tmp') + '/partis-simu-' + str(random.randint(0, 999999))
|
98
|
-
# ----------------------------------------------------------------------------------------
|
99
|
-
if args.n_procs == 1:
|
100
|
-
sub_cmds = [get_simulation_cmd(working_gldir, n_events=args.n_sim_events, random_seed=random.randint(0, 999999), outfname=args.outfname, workdir=None)]
|
101
|
-
else:
|
102
|
-
n_per_proc_list = []
|
103
|
-
sub_cmds = []
|
104
|
-
for iproc in range(args.n_procs):
|
105
|
-
workdir = get_workdir(iproc)
|
106
|
-
outfname = workdir + '/simu-' + str(iproc) + '.yaml'
|
107
|
-
sub_cmds.append(get_simulation_cmd(working_gldir, n_events=get_sub_events(iproc), random_seed=random.randint(0, 999999), outfname=outfname, workdir=workdir))
|
108
|
-
|
109
|
-
utils.run_cmds(sub_cmds, shell=True, n_max_procs=args.n_procs, sleep=False, debug=args.debug, proc_limit_str=' %d / %d ' % (len(sub_cmds), len(sub_cmds)))
|
110
|
-
|
111
|
-
if args.n_procs > 1:
|
112
|
-
merge_simulation_outputs(sub_cmds)
|
113
|
-
|
114
|
-
# ... rest of the simulation code would continue here, but for brevity I'll skip to the main parts
|
115
|
-
|
116
|
-
# Copy the rest of the original bin/partis file content here, but I'll jump to the main execution part
|