seashell-cli 0.1.1__tar.gz → 0.1.2__tar.gz
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.
- {seashell_cli-0.1.1 → seashell_cli-0.1.2}/PKG-INFO +1 -1
- {seashell_cli-0.1.1 → seashell_cli-0.1.2}/pyproject.toml +1 -1
- seashell_cli-0.1.2/seashell/__init__.py +1 -0
- {seashell_cli-0.1.1 → seashell_cli-0.1.2}/seashell/display.py +44 -4
- {seashell_cli-0.1.1 → seashell_cli-0.1.2}/seashell_cli.egg-info/PKG-INFO +1 -1
- {seashell_cli-0.1.1 → seashell_cli-0.1.2}/setup.cfg +1 -1
- seashell_cli-0.1.1/seashell/__init__.py +0 -1
- {seashell_cli-0.1.1 → seashell_cli-0.1.2}/README.md +0 -0
- {seashell_cli-0.1.1 → seashell_cli-0.1.2}/seashell/__main__.py +0 -0
- {seashell_cli-0.1.1 → seashell_cli-0.1.2}/seashell/cli.py +0 -0
- {seashell_cli-0.1.1 → seashell_cli-0.1.2}/seashell/client.py +0 -0
- {seashell_cli-0.1.1 → seashell_cli-0.1.2}/seashell/config.py +0 -0
- {seashell_cli-0.1.1 → seashell_cli-0.1.2}/seashell/help.py +0 -0
- {seashell_cli-0.1.1 → seashell_cli-0.1.2}/seashell_cli.egg-info/SOURCES.txt +0 -0
- {seashell_cli-0.1.1 → seashell_cli-0.1.2}/seashell_cli.egg-info/dependency_links.txt +0 -0
- {seashell_cli-0.1.1 → seashell_cli-0.1.2}/seashell_cli.egg-info/entry_points.txt +0 -0
- {seashell_cli-0.1.1 → seashell_cli-0.1.2}/seashell_cli.egg-info/requires.txt +0 -0
- {seashell_cli-0.1.1 → seashell_cli-0.1.2}/seashell_cli.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.2"
|
|
@@ -172,13 +172,53 @@ def _print_variants(result, action, latency):
|
|
|
172
172
|
|
|
173
173
|
|
|
174
174
|
def _print_diff(result, latency):
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
175
|
+
a = result.get("patient_a", "?")
|
|
176
|
+
b = result.get("patient_b", "?")
|
|
177
|
+
shared_count = result.get("shared_count", 0)
|
|
178
|
+
unique_a_count = result.get("unique_to_a_count", 0)
|
|
179
|
+
unique_b_count = result.get("unique_to_b_count", 0)
|
|
180
|
+
truncated = result.get("truncated", False)
|
|
181
|
+
|
|
182
|
+
print("\n %s vs %s" % (a, b))
|
|
183
|
+
print(" %s %12s variants" % ("Only in " + a + ":", "{:,}".format(unique_a_count)))
|
|
184
|
+
print(" %s %12s variants" % ("Only in " + b + ":", "{:,}".format(unique_b_count)))
|
|
185
|
+
print(" %s %12s variants" % ("Shared:" + " " * (len(a) + len(b) - 1), "{:,}".format(shared_count)))
|
|
186
|
+
|
|
187
|
+
# Show a sample of shared variants if any
|
|
188
|
+
shared_sample = result.get("shared", [])
|
|
189
|
+
if shared_sample:
|
|
190
|
+
shown = len(shared_sample)
|
|
191
|
+
label = "first %d" % shown if truncated else "all %d" % shown
|
|
192
|
+
print("\n Shared variants (%s):" % label)
|
|
193
|
+
header = " %-8s %12s %-6s %-6s" % ("CHROM", "POS", "REF", "ALT")
|
|
194
|
+
has_gene = any("gene" in r for r in shared_sample)
|
|
195
|
+
if has_gene:
|
|
196
|
+
header += " %-12s" % "GENE"
|
|
197
|
+
print(header)
|
|
198
|
+
print(" %s" % ("-" * (len(header) - 2)))
|
|
199
|
+
for r in shared_sample[:25]: # show at most 25 in table
|
|
200
|
+
line = " %-8s %12s %-6s %-6s" % (
|
|
201
|
+
r.get("chrom", ""), r.get("pos", 0),
|
|
202
|
+
_truncate(r.get("ref", ""), 6),
|
|
203
|
+
_truncate(r.get("alt", ""), 6))
|
|
204
|
+
if has_gene:
|
|
205
|
+
line += " %-12s" % r.get("gene", "")
|
|
206
|
+
print(line)
|
|
207
|
+
if shown > 25:
|
|
208
|
+
print(" ... (%d more not shown)" % (shown - 25))
|
|
209
|
+
|
|
179
210
|
print("\n %s ms" % latency)
|
|
180
211
|
|
|
181
212
|
|
|
213
|
+
def _truncate(s, n):
|
|
214
|
+
"""Truncate a string to n chars with ellipsis."""
|
|
215
|
+
if not isinstance(s, str):
|
|
216
|
+
return str(s)
|
|
217
|
+
if len(s) <= n:
|
|
218
|
+
return s
|
|
219
|
+
return s[:n - 1] + "…"
|
|
220
|
+
|
|
221
|
+
|
|
182
222
|
def _print_pca(result, latency):
|
|
183
223
|
components = result.get("components", [])
|
|
184
224
|
print("\n PCA (%s components, %s patients)\n" % (
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.1.1"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|