mlbi-bitool 0.2.2__tar.gz → 0.2.4__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.
Files changed (27) hide show
  1. {mlbi_bitool-0.2.2 → mlbi_bitool-0.2.4}/PKG-INFO +1 -1
  2. {mlbi_bitool-0.2.2 → mlbi_bitool-0.2.4}/pyproject.toml +1 -1
  3. {mlbi_bitool-0.2.2 → mlbi_bitool-0.2.4}/src/mlbi_bitool/bistack.py +2 -2
  4. {mlbi_bitool-0.2.2 → mlbi_bitool-0.2.4}/src/mlbi_bitool/tasm.py +21 -4
  5. {mlbi_bitool-0.2.2 → mlbi_bitool-0.2.4}/src/mlbi_bitool.egg-info/PKG-INFO +1 -1
  6. {mlbi_bitool-0.2.2 → mlbi_bitool-0.2.4}/LICENSE +0 -0
  7. {mlbi_bitool-0.2.2 → mlbi_bitool-0.2.4}/MANIFEST.in +0 -0
  8. {mlbi_bitool-0.2.2 → mlbi_bitool-0.2.4}/README.md +0 -0
  9. {mlbi_bitool-0.2.2 → mlbi_bitool-0.2.4}/setup.cfg +0 -0
  10. {mlbi_bitool-0.2.2 → mlbi_bitool-0.2.4}/setup.py +0 -0
  11. {mlbi_bitool-0.2.2 → mlbi_bitool-0.2.4}/src/mlbi_bitool/__init__.py +0 -0
  12. {mlbi_bitool-0.2.2 → mlbi_bitool-0.2.4}/src/mlbi_bitool/align.py +0 -0
  13. {mlbi_bitool-0.2.2 → mlbi_bitool-0.2.4}/src/mlbi_bitool/bitools.py +0 -0
  14. {mlbi_bitool-0.2.2 → mlbi_bitool-0.2.4}/src/mlbi_bitool/cnv.py +0 -0
  15. {mlbi_bitool-0.2.2 → mlbi_bitool-0.2.4}/src/mlbi_bitool/decomp.py +0 -0
  16. {mlbi_bitool-0.2.2 → mlbi_bitool-0.2.4}/src/mlbi_bitool/deg.py +0 -0
  17. {mlbi_bitool-0.2.2 → mlbi_bitool-0.2.4}/src/mlbi_bitool/deiso.py +0 -0
  18. {mlbi_bitool-0.2.2 → mlbi_bitool-0.2.4}/src/mlbi_bitool/gatk.py +0 -0
  19. {mlbi_bitool-0.2.2 → mlbi_bitool-0.2.4}/src/mlbi_bitool/geq.py +0 -0
  20. {mlbi_bitool-0.2.2 → mlbi_bitool-0.2.4}/src/mlbi_bitool/load_datasets.py +0 -0
  21. {mlbi_bitool-0.2.2 → mlbi_bitool-0.2.4}/src/mlbi_bitool/mlbi_util.py +0 -0
  22. {mlbi_bitool-0.2.2 → mlbi_bitool-0.2.4}/src/mlbi_bitool/pybam.py +0 -0
  23. {mlbi_bitool-0.2.2 → mlbi_bitool-0.2.4}/src/mlbi_bitool/util.py +0 -0
  24. {mlbi_bitool-0.2.2 → mlbi_bitool-0.2.4}/src/mlbi_bitool.egg-info/SOURCES.txt +0 -0
  25. {mlbi_bitool-0.2.2 → mlbi_bitool-0.2.4}/src/mlbi_bitool.egg-info/dependency_links.txt +0 -0
  26. {mlbi_bitool-0.2.2 → mlbi_bitool-0.2.4}/src/mlbi_bitool.egg-info/requires.txt +0 -0
  27. {mlbi_bitool-0.2.2 → mlbi_bitool-0.2.4}/src/mlbi_bitool.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mlbi-bitool
3
- Version: 0.2.2
3
+ Version: 0.2.4
4
4
  Summary: Python interface to BioInfo tools for use in Google.Colab
5
5
  Author-email: MLBI Lab <syoon@dku.edu>
6
6
  License-Expression: MIT
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
6
6
 
7
7
  [project]
8
8
  name = "mlbi-bitool"
9
- version = "0.2.2"
9
+ version = "0.2.4"
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" }]
@@ -228,7 +228,6 @@ apt_pkgs = {
228
228
  'samtools': ("samtools", "samtools", "samtools", _version_samtools),
229
229
  'featurecounts': ("featureCounts(subread)", "subread","featureCounts", _version_featureCounts),
230
230
  'stringtie': ("stringtie","stringtie","stringtie",_version_stringtie),
231
- 'gffcompare': ("gffcompare", "gffcompare", "gffcompare", _version_gffcompare),
232
231
  'gffread': ("gffread", "gffread", "gffread", _version_gffread),
233
232
  'bcftools': ("bcftools", "bcftools", "bcftools", _version_bcftools),
234
233
  'tabix': ("tabix", "tabix", "tabix", _version_tabix),
@@ -306,6 +305,7 @@ def _version_gatk(): return _probe_version(["gatk", "--version"])
306
305
  conda_pkgs = {
307
306
  'rmats': ('rmats.py', _version_rmats),
308
307
  'rsem': ('rsem-calculate-expression', _version_rsem),
308
+ 'gffcompare': ('gffcompare', _version_gffcompare),
309
309
  'ucsc_gtftogenepred': ('gtfToGenePred', _version_gtfToGenePred, 'ucsc-gtftogenepred'),
310
310
  'ucsc_genepredtobed': ('genePredToBed', _version_genePredToBed, 'ucsc-genepredtobed'),
311
311
  }
@@ -317,7 +317,7 @@ other_pkgs = {
317
317
 
318
318
  BI_TOOL_PRESETS = {
319
319
  "wes": ["bwa", "samtools", "bcftools", "tabix", "bgzip", "gatk", "cnvkit"],
320
- "rnaseq": ["star", "samtools", "rsem", "salmon", "stringtie", "gffread", "rmats"],
320
+ "rnaseq": ["star", "samtools", "rsem", "salmon", "stringtie", "gffcompare", "gffread", "rmats"],
321
321
  "ucsc_tools": ["ucsc_gtftogenepred", "ucsc_genepredtobed"],
322
322
  "pacbio": ["minimap2", "samtools", "stringtie", "gffcompare", "gffread",
323
323
  "ucsc_gtftogenepred", "ucsc_genepredtobed", "rmats"],
@@ -1,7 +1,7 @@
1
1
  import re, copy, collections
2
2
  import numpy as np
3
3
  import pandas as pd
4
- import os, time
4
+ import os, time, glob
5
5
  from subprocess import Popen, PIPE
6
6
  import shlex, shutil, tempfile, sys
7
7
  from typing import Optional, Tuple, Set
@@ -701,11 +701,12 @@ def Stringtie_merge_n_compare( src_dir: str,
701
701
  verbose = True ):
702
702
 
703
703
  cmd_lst = []
704
+ if src_dir[-1] == '/':
705
+ src_dir = src_dir[:-1]
704
706
  flst = os.listdir(src_dir)
705
- flst = [src_dir + f for f in flst if f.split('.')[-1] == 'gff']
707
+ flst = [os.path.join(src_dir, f) for f in flst if f.split('.')[-1] == 'gff']
706
708
  flst.sort()
707
709
 
708
- if src_dir[-1] == '/': src_dir = src_dir[:-1]
709
710
  if out_dir is None:
710
711
  out_dir = src_dir + '_merged_info'
711
712
  if not os.path.isdir(out_dir): os.mkdir(out_dir)
@@ -752,7 +753,23 @@ def Stringtie_merge_n_compare( src_dir: str,
752
753
  if verbose: print('done.')
753
754
 
754
755
  if verbose: print('Applying to merged GFF ... ', end = '')
755
- df_tmap = pd.read_csv( gffcomp_prefix + '.merged.gff.tmap', sep = '\t' )
756
+ tmap_file = gffcomp_prefix + '.merged.gff.tmap'
757
+ if not os.path.isfile(tmap_file):
758
+ tmap_candidates = sorted(glob.glob(gffcomp_prefix + '*.tmap'))
759
+ if len(tmap_candidates) == 1:
760
+ tmap_file = tmap_candidates[0]
761
+ elif len(tmap_candidates) > 1:
762
+ tmap_candidates.sort(key=lambda p: ('.merged.gff.tmap' not in p, len(p), p))
763
+ tmap_file = tmap_candidates[0]
764
+ else:
765
+ existing = sorted(glob.glob(gffcomp_prefix + '*'))
766
+ msg = (
767
+ "gffcompare did not create a .tmap file. "
768
+ f"Expected {gffcomp_prefix}.merged.gff.tmap or {gffcomp_prefix}*.tmap. "
769
+ f"Exit code: {exit_code}. Existing output files: {existing}"
770
+ )
771
+ raise FileNotFoundError(msg)
772
+ df_tmap = pd.read_csv( tmap_file, sep = '\t' )
756
773
  df_gff = reflect_gffcompare_res_to_stringtie_res( df_gtf, df_gff, df_tmap,
757
774
  class_code_to_drop = class_code_to_drop,
758
775
  verbose = False )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mlbi-bitool
3
- Version: 0.2.2
3
+ Version: 0.2.4
4
4
  Summary: Python interface to BioInfo tools for use in Google.Colab
5
5
  Author-email: MLBI Lab <syoon@dku.edu>
6
6
  License-Expression: MIT
File without changes
File without changes
File without changes
File without changes
File without changes