mlbi-bitool 0.2.0__tar.gz → 0.2.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.
- {mlbi_bitool-0.2.0 → mlbi_bitool-0.2.2}/PKG-INFO +1 -1
- {mlbi_bitool-0.2.0 → mlbi_bitool-0.2.2}/pyproject.toml +1 -1
- {mlbi_bitool-0.2.0 → mlbi_bitool-0.2.2}/src/mlbi_bitool/bistack.py +32 -14
- {mlbi_bitool-0.2.0 → mlbi_bitool-0.2.2}/src/mlbi_bitool/load_datasets.py +20 -28
- {mlbi_bitool-0.2.0 → mlbi_bitool-0.2.2}/src/mlbi_bitool.egg-info/PKG-INFO +1 -1
- {mlbi_bitool-0.2.0 → mlbi_bitool-0.2.2}/LICENSE +0 -0
- {mlbi_bitool-0.2.0 → mlbi_bitool-0.2.2}/MANIFEST.in +0 -0
- {mlbi_bitool-0.2.0 → mlbi_bitool-0.2.2}/README.md +0 -0
- {mlbi_bitool-0.2.0 → mlbi_bitool-0.2.2}/setup.cfg +0 -0
- {mlbi_bitool-0.2.0 → mlbi_bitool-0.2.2}/setup.py +0 -0
- {mlbi_bitool-0.2.0 → mlbi_bitool-0.2.2}/src/mlbi_bitool/__init__.py +0 -0
- {mlbi_bitool-0.2.0 → mlbi_bitool-0.2.2}/src/mlbi_bitool/align.py +0 -0
- {mlbi_bitool-0.2.0 → mlbi_bitool-0.2.2}/src/mlbi_bitool/bitools.py +0 -0
- {mlbi_bitool-0.2.0 → mlbi_bitool-0.2.2}/src/mlbi_bitool/cnv.py +0 -0
- {mlbi_bitool-0.2.0 → mlbi_bitool-0.2.2}/src/mlbi_bitool/decomp.py +0 -0
- {mlbi_bitool-0.2.0 → mlbi_bitool-0.2.2}/src/mlbi_bitool/deg.py +0 -0
- {mlbi_bitool-0.2.0 → mlbi_bitool-0.2.2}/src/mlbi_bitool/deiso.py +0 -0
- {mlbi_bitool-0.2.0 → mlbi_bitool-0.2.2}/src/mlbi_bitool/gatk.py +0 -0
- {mlbi_bitool-0.2.0 → mlbi_bitool-0.2.2}/src/mlbi_bitool/geq.py +0 -0
- {mlbi_bitool-0.2.0 → mlbi_bitool-0.2.2}/src/mlbi_bitool/mlbi_util.py +0 -0
- {mlbi_bitool-0.2.0 → mlbi_bitool-0.2.2}/src/mlbi_bitool/pybam.py +0 -0
- {mlbi_bitool-0.2.0 → mlbi_bitool-0.2.2}/src/mlbi_bitool/tasm.py +0 -0
- {mlbi_bitool-0.2.0 → mlbi_bitool-0.2.2}/src/mlbi_bitool/util.py +0 -0
- {mlbi_bitool-0.2.0 → mlbi_bitool-0.2.2}/src/mlbi_bitool.egg-info/SOURCES.txt +0 -0
- {mlbi_bitool-0.2.0 → mlbi_bitool-0.2.2}/src/mlbi_bitool.egg-info/dependency_links.txt +0 -0
- {mlbi_bitool-0.2.0 → mlbi_bitool-0.2.2}/src/mlbi_bitool.egg-info/requires.txt +0 -0
- {mlbi_bitool-0.2.0 → mlbi_bitool-0.2.2}/src/mlbi_bitool.egg-info/top_level.txt +0 -0
|
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
|
|
|
6
6
|
|
|
7
7
|
[project]
|
|
8
8
|
name = "mlbi-bitool"
|
|
9
|
-
version = "0.2.
|
|
9
|
+
version = "0.2.2"
|
|
10
10
|
description = "Python interface to BioInfo tools for use in Google.Colab"
|
|
11
11
|
readme = "README.md"
|
|
12
12
|
authors = [{ name = "MLBI Lab", email = "syoon@dku.edu" }]
|
|
@@ -140,6 +140,9 @@ def _print_status(name: str, version: Optional[str], installed_now: bool):
|
|
|
140
140
|
vtxt = version or "unknown-version"
|
|
141
141
|
print(f"{name}: {tag} (v{vtxt})")
|
|
142
142
|
|
|
143
|
+
def _print_not_installed(name: str):
|
|
144
|
+
print(f"{name}: not installed")
|
|
145
|
+
|
|
143
146
|
# -------------------- Java 버전 --------------------
|
|
144
147
|
def _parse_java_version(text: str) -> Optional[Tuple[int,int,int,str]]:
|
|
145
148
|
m = re.search(r'version\s+"(\d+)(?:\.(\d+))?(?:\.(\d+))?', text)
|
|
@@ -408,9 +411,13 @@ def _install_cnvkit(install: bool = True, pkg = 'cnvkit'):
|
|
|
408
411
|
|
|
409
412
|
|
|
410
413
|
# -------------------- 메인 엔트리 --------------------
|
|
411
|
-
def install_common_bi_tools(pkgs_to_install: List[str] = None, check_only=False):
|
|
414
|
+
def install_common_bi_tools(pkgs_to_install: List[str] = None, check_only=False, install_local: bool = False):
|
|
412
415
|
"""
|
|
413
416
|
Install/check common bioinformatics command-line tools.
|
|
417
|
+
In Google Colab, missing tools are installed by default.
|
|
418
|
+
In a local environment, installation is skipped by default and only tool
|
|
419
|
+
availability/version is reported. Pass install_local=True to allow local
|
|
420
|
+
installation attempts.
|
|
414
421
|
|
|
415
422
|
Examples
|
|
416
423
|
--------
|
|
@@ -420,13 +427,15 @@ def install_common_bi_tools(pkgs_to_install: List[str] = None, check_only=False)
|
|
|
420
427
|
>>> install_common_bi_tools("pacbio")
|
|
421
428
|
>>> install_common_bi_tools("bi_training")
|
|
422
429
|
>>> install_common_bi_tools(["bwa", "samtools", "gatk"], check_only=True)
|
|
430
|
+
>>> install_common_bi_tools("wes", install_local=True)
|
|
423
431
|
"""
|
|
424
432
|
|
|
425
433
|
java_required_major = 17
|
|
426
434
|
java_prefer = "conda" # "apt" or "conda"
|
|
427
435
|
java_allow_conda_fallback = True
|
|
428
436
|
|
|
429
|
-
|
|
437
|
+
is_colab = _is_colab()
|
|
438
|
+
allow_install = (not check_only) and (is_colab or install_local)
|
|
430
439
|
lst_apt_pkgs = list(apt_pkgs.keys())
|
|
431
440
|
lst_conda_pkgs = list(conda_pkgs.keys())
|
|
432
441
|
lst_other_pkgs = list(other_pkgs.keys())
|
|
@@ -439,12 +448,15 @@ def install_common_bi_tools(pkgs_to_install: List[str] = None, check_only=False)
|
|
|
439
448
|
need_conda = bool(set(pkgs_to_install).intersection(lst_conda_pkgs))
|
|
440
449
|
need_conda = need_conda or (java_prefer == "conda" and "gatk" in pkgs_to_install)
|
|
441
450
|
|
|
442
|
-
if
|
|
443
|
-
|
|
451
|
+
if not is_colab and not install_local:
|
|
452
|
+
print("Local environment detected. Installation is skipped; checking tool availability only.")
|
|
453
|
+
|
|
454
|
+
if need_conda and is_colab:
|
|
455
|
+
ensure_condacolab(run_install=allow_install)
|
|
444
456
|
|
|
445
457
|
apt_cmd = "apt-get"
|
|
446
458
|
need_apt = bool(set(pkgs_to_install).intersection(lst_apt_pkgs))
|
|
447
|
-
if need_apt and _which(apt_cmd) and
|
|
459
|
+
if need_apt and _which(apt_cmd) and is_colab and allow_install:
|
|
448
460
|
_run(_sudo_prefix()+[apt_cmd, "update", "-y", "-qq"])
|
|
449
461
|
elif need_apt and not _which(apt_cmd):
|
|
450
462
|
print("%s not found; skipping APT tools." % apt_cmd)
|
|
@@ -452,15 +464,15 @@ def install_common_bi_tools(pkgs_to_install: List[str] = None, check_only=False)
|
|
|
452
464
|
for pkg in pkgs_to_install:
|
|
453
465
|
|
|
454
466
|
if pkg in lst_apt_pkgs:
|
|
455
|
-
if
|
|
467
|
+
if is_colab or install_local:
|
|
456
468
|
arg = apt_pkgs[pkg]
|
|
457
|
-
_apt_ensure_and_report( arg, install
|
|
469
|
+
_apt_ensure_and_report( arg, install=allow_install, apt_cmd=apt_cmd )
|
|
458
470
|
else:
|
|
459
471
|
name, aptpkg, binname, vfunc = apt_pkgs[pkg]
|
|
460
472
|
if _which(binname):
|
|
461
473
|
_print_status(name, vfunc(), installed_now=False)
|
|
462
474
|
else:
|
|
463
|
-
|
|
475
|
+
_print_not_installed(name)
|
|
464
476
|
|
|
465
477
|
elif pkg in lst_conda_pkgs:
|
|
466
478
|
spec = conda_pkgs[pkg]
|
|
@@ -470,8 +482,10 @@ def install_common_bi_tools(pkgs_to_install: List[str] = None, check_only=False)
|
|
|
470
482
|
if binpath:
|
|
471
483
|
v = vfunc()
|
|
472
484
|
_print_status(pkg, v, installed_now=False)
|
|
473
|
-
elif
|
|
474
|
-
_conda_install(package
|
|
485
|
+
elif allow_install:
|
|
486
|
+
_conda_install(package=conda_pkg, install=True, ensure_channels=True)
|
|
487
|
+
else:
|
|
488
|
+
_print_not_installed(pkg)
|
|
475
489
|
|
|
476
490
|
elif pkg == 'gatk':
|
|
477
491
|
binname, vfunc = other_pkgs[pkg]
|
|
@@ -479,7 +493,7 @@ def install_common_bi_tools(pkgs_to_install: List[str] = None, check_only=False)
|
|
|
479
493
|
if binpath:
|
|
480
494
|
v = vfunc()
|
|
481
495
|
_print_status(pkg, v, installed_now=False)
|
|
482
|
-
elif
|
|
496
|
+
elif allow_install:
|
|
483
497
|
# install Java
|
|
484
498
|
jv = _get_java_version()
|
|
485
499
|
if jv and jv[0] >= java_required_major:
|
|
@@ -488,7 +502,9 @@ def install_common_bi_tools(pkgs_to_install: List[str] = None, check_only=False)
|
|
|
488
502
|
v2 = _ensure_java(java_required_major, prefer=java_prefer, allow_conda_fallback=java_allow_conda_fallback)
|
|
489
503
|
_print_status(f"Java (requires ≥{java_required_major})", v2, installed_now=True)
|
|
490
504
|
|
|
491
|
-
_install_gatk(install
|
|
505
|
+
_install_gatk(install=True)
|
|
506
|
+
else:
|
|
507
|
+
_print_not_installed(pkg)
|
|
492
508
|
|
|
493
509
|
elif pkg == 'cnvkit':
|
|
494
510
|
binname, vfunc = other_pkgs[pkg]
|
|
@@ -496,8 +512,10 @@ def install_common_bi_tools(pkgs_to_install: List[str] = None, check_only=False)
|
|
|
496
512
|
if binpath:
|
|
497
513
|
v = vfunc()
|
|
498
514
|
_print_status(pkg, v, installed_now=False)
|
|
499
|
-
elif
|
|
500
|
-
_install_cnvkit(install
|
|
515
|
+
elif allow_install:
|
|
516
|
+
_install_cnvkit(install=True)
|
|
517
|
+
else:
|
|
518
|
+
_print_not_installed(pkg)
|
|
501
519
|
|
|
502
520
|
else:
|
|
503
521
|
print("%s: not supported" % pkg)
|
|
@@ -385,34 +385,26 @@ def decompress_tar_gz_folder(file_in, remove_org=True):
|
|
|
385
385
|
|
|
386
386
|
|
|
387
387
|
bi_sample_data_fid_dict = {
|
|
388
|
-
'BI_RefGenome_hg38_sel':
|
|
389
|
-
'
|
|
390
|
-
'
|
|
391
|
-
'
|
|
392
|
-
'
|
|
393
|
-
'
|
|
394
|
-
'
|
|
395
|
-
'
|
|
396
|
-
'
|
|
397
|
-
'
|
|
398
|
-
'
|
|
399
|
-
'
|
|
400
|
-
'
|
|
401
|
-
'
|
|
402
|
-
'
|
|
403
|
-
'
|
|
404
|
-
'
|
|
405
|
-
'
|
|
406
|
-
'
|
|
407
|
-
'
|
|
408
|
-
'RNAseq_CRC_chr17_bam': '13FOOKwlMFgKJCg5-5x5gft0--zzHWAUc',
|
|
409
|
-
'RNAseq_CRC_chr17_gexp_results': '1kJLU5AGuX4XmC1AbhX1kkn6F3A3jWtYD',
|
|
410
|
-
'RNAseq_pacbio_chr7': '1vIpKKmwpKz4XyRhCsUQ_CMQZrVOPNigZ',
|
|
411
|
-
# 'RNAseq_pacbio_chr7_bam': '',
|
|
412
|
-
'index_bwa_hg38_sel': '1Ed9aMgOCmoFKYKj6-3WbEmQqepzRKUqJ',
|
|
413
|
-
'index_star_hg38_sel': '1VnU8oqEUPMViNX0QybywbW2jPY0Z1u4a',
|
|
414
|
-
'index_rsem_hg38_sel': '1Sy3DFcacd3sM3Fqi1egJhVfG4ZTWqD9i',
|
|
415
|
-
'index_salmon_hg38_sel': '1Q9yhzWuMdgHcNVUdNQGBjvTG307tzoD9',
|
|
388
|
+
'BI_RefGenome_hg38_sel': '1uIHwlS3N4TsN7sJdD3j5Hf8B_clTQXHl',
|
|
389
|
+
'BI_Files_for_GATK_chr12': '1pbMIMvoqBqGE9yMKUg2E-f2m4P8mmN4Y',
|
|
390
|
+
'BI_Files_for_GATK': '13qwSu1e7d7olhKmpEuZYLSNShNCXfLkH',
|
|
391
|
+
'BI_WES_PDAC_chr12': '1l88p48edaw7oHTSdCFQgXALoUAdYr2nT',
|
|
392
|
+
'BI_WES_PDAC_chr12_bam': '1xCiTuVPqLytx5NTxmaIQcLXoUGPP-XZ7',
|
|
393
|
+
'BI_WES_PDAC_chr12_SNV_CNV_results': '1V1tQQaMinXQvnjYT5y8FkqjDLksRY7-X',
|
|
394
|
+
'BI_WES_NSCLC_chr7': '1OIWarGf6Q9SN9sUjtvH1jqjm4apj5q28',
|
|
395
|
+
'BI_WES_NSCLC_chr7_bam': '1uSJ0l9bKhX3E90WLRs9QRwyHo1Ljtsmp',
|
|
396
|
+
'BI_RNAseq_PDAC_chr12': '1RAVk6NxIyl-lyrwh0qoNu0Vm4R2V5ht9',
|
|
397
|
+
'BI_RNAseq_PDAC_chr12_bam': '1g0kBnw0s-6AuGieuW-O1-4pSsftk0sn9',
|
|
398
|
+
'BI_RNAseq_NSCLC_chr7': '1HF9N5USGkhxpjzsLmChAqtiIP4OuwelM',
|
|
399
|
+
'BI_RNAseq_NSCLC_chr7_bam': '1Ek2gTTGPPcaXqVee4XThcx7BgDgv9_5w',
|
|
400
|
+
'BI_RNAseq_CRC_chr17': '1KbV3o6r4pVPtlQur0xyiniJYS01DsPpM',
|
|
401
|
+
'BI_RNAseq_CRC_chr17_bam': '13FOOKwlMFgKJCg5-5x5gft0--zzHWAUc',
|
|
402
|
+
'BI_RNAseq_CRC_chr17_gexp_results': '1kJLU5AGuX4XmC1AbhX1kkn6F3A3jWtYD',
|
|
403
|
+
'BI_RNAseq_pacbio_chr7': '1vIpKKmwpKz4XyRhCsUQ_CMQZrVOPNigZ',
|
|
404
|
+
'BI_index_bwa_hg38_sel': '1Ed9aMgOCmoFKYKj6-3WbEmQqepzRKUqJ',
|
|
405
|
+
'BI_index_star_hg38_sel': '1VnU8oqEUPMViNX0QybywbW2jPY0Z1u4a',
|
|
406
|
+
'BI_index_rsem_hg38_sel': '1Sy3DFcacd3sM3Fqi1egJhVfG4ZTWqD9i',
|
|
407
|
+
'BI_index_salmon_hg38_sel': '1Q9yhzWuMdgHcNVUdNQGBjvTG307tzoD9',
|
|
416
408
|
'ML_TCGA_BRCA': '1YHJwzdDwQx0KDhmn2fndB9j5leBBx8hH',
|
|
417
409
|
'ML_METABRIC': '1b3cPWwz_CG86s4TGnfCjxCP7KVh2UPHR',
|
|
418
410
|
'ML_CCLE_CTRPv2': '1q2XqSycVSrgFPJ4FUI2qWHxIKqYYTdij',
|
|
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
|
|
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
|