partis-bcr 1.0.0__py3-none-any.whl → 1.0.1__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/FastTree +0 -0
- bin/add-chimeras.py +59 -0
- bin/add-seqs-to-outputs.py +81 -0
- bin/bcr-phylo-run.py +799 -0
- bin/build.sh +24 -0
- bin/cf-alleles.py +97 -0
- bin/cf-germlines.py +57 -0
- bin/cf-linearham.py +199 -0
- bin/chimera-plot.py +76 -0
- bin/choose-partially-paired.py +143 -0
- bin/circle-plots.py +30 -0
- bin/compare-plotdirs.py +298 -0
- bin/diff-parameters.py +133 -0
- bin/docker-hub-push.sh +6 -0
- bin/extract-pairing-info.py +55 -0
- bin/gcdyn-simu-run.py +223 -0
- bin/gctree-run.py +244 -0
- bin/get-naive-probabilities.py +126 -0
- bin/iqtree-1.6.12 +0 -0
- bin/lonr.r +1020 -0
- bin/makeHtml +52 -0
- bin/mds-run.py +46 -0
- bin/parse-output.py +277 -0
- bin/partis +1869 -0
- bin/partis-pip +116 -0
- bin/partis.py +1869 -0
- bin/plot-gl-set-trees.py +519 -0
- bin/plot-hmms.py +151 -0
- bin/plot-lb-tree.py +427 -0
- bin/raxml-ng +0 -0
- bin/read-bcr-phylo-trees.py +38 -0
- bin/read-gctree-output.py +166 -0
- bin/run-chimeras.sh +64 -0
- bin/run-dtr-scan.sh +25 -0
- bin/run-paired-loci.sh +100 -0
- bin/run-tree-metrics.sh +88 -0
- bin/smetric-run.py +62 -0
- bin/split-loci.py +317 -0
- bin/swarm-2.1.13-linux-x86_64 +0 -0
- bin/test-germline-inference.py +425 -0
- bin/tree-perf-run.py +194 -0
- bin/vsearch-2.4.3-linux-x86_64 +0 -0
- bin/vsearch-2.4.3-macos-x86_64 +0 -0
- bin/xvfb-run +194 -0
- partis_bcr-1.0.1.data/scripts/cf-alleles.py +97 -0
- partis_bcr-1.0.1.data/scripts/cf-germlines.py +57 -0
- partis_bcr-1.0.1.data/scripts/extract-pairing-info.py +55 -0
- partis_bcr-1.0.1.data/scripts/gctree-run.py +244 -0
- partis_bcr-1.0.1.data/scripts/parse-output.py +277 -0
- partis_bcr-1.0.1.data/scripts/split-loci.py +317 -0
- partis_bcr-1.0.1.data/scripts/test.py +1005 -0
- {partis_bcr-1.0.0.dist-info → partis_bcr-1.0.1.dist-info}/METADATA +1 -1
- {partis_bcr-1.0.0.dist-info → partis_bcr-1.0.1.dist-info}/RECORD +101 -50
- partis_bcr-1.0.1.dist-info/top_level.txt +1 -0
- {partis → python}/glutils.py +1 -1
- python/main.py +30 -0
- {partis → python}/plotting.py +10 -1
- {partis → python}/treeutils.py +18 -16
- {partis → python}/utils.py +14 -7
- partis/main.py +0 -59
- partis_bcr-1.0.0.dist-info/top_level.txt +0 -1
- {partis_bcr-1.0.0.dist-info → partis_bcr-1.0.1.dist-info}/WHEEL +0 -0
- {partis_bcr-1.0.0.dist-info → partis_bcr-1.0.1.dist-info}/entry_points.txt +0 -0
- {partis_bcr-1.0.0.dist-info → partis_bcr-1.0.1.dist-info}/licenses/COPYING +0 -0
- {partis → python}/__init__.py +0 -0
- {partis → python}/alleleclusterer.py +0 -0
- {partis → python}/allelefinder.py +0 -0
- {partis → python}/alleleremover.py +0 -0
- {partis → python}/annotationclustering.py +0 -0
- {partis → python}/baseutils.py +0 -0
- {partis → python}/cache/__init__.py +0 -0
- {partis → python}/cache/cached_uncertainties.py +0 -0
- {partis → python}/clusterpath.py +0 -0
- {partis → python}/coar.py +0 -0
- {partis → python}/corrcounter.py +0 -0
- {partis → python}/datautils.py +0 -0
- {partis → python}/event.py +0 -0
- {partis → python}/fraction_uncertainty.py +0 -0
- {partis → python}/gex.py +0 -0
- {partis → python}/glomerator.py +0 -0
- {partis → python}/hist.py +0 -0
- {partis → python}/hmmwriter.py +0 -0
- {partis → python}/hutils.py +0 -0
- {partis → python}/indelutils.py +0 -0
- {partis → python}/lbplotting.py +0 -0
- {partis → python}/mds.py +0 -0
- {partis → python}/mutefreqer.py +0 -0
- {partis → python}/paircluster.py +0 -0
- {partis → python}/parametercounter.py +0 -0
- {partis → python}/paramutils.py +0 -0
- {partis → python}/partitiondriver.py +0 -0
- {partis → python}/partitionplotter.py +0 -0
- {partis → python}/performanceplotter.py +0 -0
- {partis → python}/plotconfig.py +0 -0
- {partis → python}/processargs.py +0 -0
- {partis → python}/prutils.py +0 -0
- {partis → python}/recombinator.py +0 -0
- {partis → python}/scanplot.py +0 -0
- {partis → python}/seqfileopener.py +0 -0
- {partis → python}/treegenerator.py +0 -0
- {partis → python}/viterbicluster.py +0 -0
- {partis → python}/vrc01.py +0 -0
- {partis → python}/waterer.py +0 -0
bin/partis-pip
ADDED
@@ -0,0 +1,116 @@
|
|
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
|