Skip to content

Commit

Permalink
get_converter receives args. get_lifter receives source and dest asse…
Browse files Browse the repository at this point in the history
…mblies.
  • Loading branch information
rkimoakbioinformatics committed Dec 8, 2023
1 parent 9b13197 commit f20cda6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions oakvar/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,13 @@ def get_mapper(module_name, input_file=None):
return module


def get_converter(module_name):
def get_converter(module_name, *args, **kwargs):
module = None
ModuleClass = get_module(module_name, module_type="converter")
if ModuleClass:
module = ModuleClass()
module.name = module_name
module.setup()
module.setup(*args, **kwargs)
return module


Expand Down
2 changes: 1 addition & 1 deletion oakvar/lib/base/master_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ def collect_input_file_handles(self):
encoding = self.get_file_object_for_input_path(input_path)
self.input_file_handles[input_path] = encoding

def setup(self):
def setup(self, *args, **kwargs):
self.collect_converter_paths()
self.collect_input_file_handles()
self.collect_converter_name_by_input()
Expand Down
6 changes: 4 additions & 2 deletions oakvar/lib/util/seq.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ def reverse_complement(bases):
return "".join([complementary_base[base] for base in bases[::-1]])


def get_lifter(source_assembly: str) -> Optional[ChainFile]:
def get_lifter(source_assembly: str, to_assembly: str="") -> Optional[ChainFile]:
"""get_lifter.
Args:
Expand All @@ -401,7 +401,9 @@ def get_lifter(source_assembly: str) -> Optional[ChainFile]:
return None
if not liftover_dir.exists():
makedirs(liftover_dir, exist_ok=True)
chain_file_basename = f"{source_assembly.lower()}To{SYSTEM_GENOME_ASSEMBLY.capitalize()}.over.chain.gz"
if not to_assembly:
to_assembly = SYSTEM_GENOME_ASSEMBLY
chain_file_basename = f"{source_assembly.lower()}To{to_assembly.capitalize()}.over.chain.gz"
chain_file_path: Path = liftover_dir / chain_file_basename
if not chain_file_path.exists():
url = f"https://hgdownload.cse.ucsc.edu/goldenPath/{source_assembly.lower()}/liftOver/{chain_file_basename}"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def walk_and_add(d, pkg_files):
walk_and_add("cravat", cravat_files)
setup(
name="oakvar",
version="2.9.75",
version="2.9.76",
description="A genomic variant analysis platform",
long_description=long_description,
long_description_content_type="text/x-rst",
Expand Down

0 comments on commit f20cda6

Please sign in to comment.