Skip to content

Commit

Permalink
fix low depth error, add version (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiao-chen-xc authored May 1, 2023
1 parent 52a7f52 commit 6d015ac
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion paraphase/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.2.1"
__version__ = "2.2.2"
11 changes: 11 additions & 0 deletions paraphase/paraphase.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ def __init__(self):
self.samtools = None
self.minimap2 = None

@staticmethod
def get_version():
with open(os.path.join(os.path.dirname(__file__), "__init__.py")) as f:
for line in f:
if "version" in line:
return line.split('"')[1]
return None

def parse_configs(self, region_config=None):
"""
Parse config files
Expand Down Expand Up @@ -365,6 +373,9 @@ def load_parameters(self):
help="Optional path to minimap2",
required=False,
)
parser.add_argument(
"-v", "--version", action="version", version=f"{self.get_version()}"
)
return parser

def run(self):
Expand Down
2 changes: 0 additions & 2 deletions paraphase/prepare_bam_and_vcf.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,6 @@ def set_parameter(self, config, tmpdir=None):
self.bam = os.path.join(
tmpdir, self.sample_id + f"_{self.gene}_realigned_tagged.bam"
)
if os.path.exists(self.bam) is False:
raise Exception(f"{self.bam} does not exist. VCFs are not generated...")
self.vcf_dir = os.path.join(self.outdir, f"{self.sample_id}_vcfs")
if os.path.exists(self.vcf_dir) is False:
os.makedirs(self.vcf_dir)
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from setuptools import setup
import paraphase


def readme():
Expand All @@ -8,7 +9,7 @@ def readme():

setup(
name="paraphase",
version="2.2.1",
version=paraphase.__version__,
description="paraphase: HiFi-based caller for highly homologous genes",
long_description=readme(),
url="https://github.com/PacificBiosciences/paraphase",
Expand Down

0 comments on commit 6d015ac

Please sign in to comment.