Skip to content

Commit

Permalink
Merge branch 'master' of github.com:rkimoakbioinformatics/oakvar
Browse files Browse the repository at this point in the history
  • Loading branch information
rkimoakbioinformatics committed Dec 4, 2023
2 parents 3b724f2 + 5f9e655 commit eedf4cc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 44 deletions.
45 changes: 3 additions & 42 deletions oakvar/lib/base/master_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def _log_conversion_error(logger, error_logger, input_path: str, line_no: int, e
err_str = str(e)
if isinstance(e, ExpectedException):
err_str = str(e)
if getattr(e, "traceback", False) is not True:
if getattr(e, "traceback", True) is not True:
err_str = str(e)
else:
err_str = format_exc().rstrip()
Expand Down Expand Up @@ -116,6 +116,7 @@ def perform_liftover_if_needed(variant, do_liftover: bool, do_liftover_chrM: boo
needed = do_liftover
if needed:
prelift_wdict = copy(variant)
orig_chrom = variant["chrom"]
crl_data = prelift_wdict
(
variant["chrom"],
Expand All @@ -131,7 +132,7 @@ def perform_liftover_if_needed(variant, do_liftover: bool, do_liftover_chrM: boo
wgs_reader=wgs_reader,
)
converted_end = liftover_one_pos(
variant["chrom"], variant["pos_end"], lifter=lifter
orig_chrom, variant["pos_end"], lifter=lifter
)
if converted_end is None:
pos_end = ""
Expand Down Expand Up @@ -1036,46 +1037,6 @@ def log_ending(self):
status = "finished Converter"
update_status(status, logger=self.logger, serveradmindb=self.serveradmindb)

def perform_liftover_if_needed(self, variant) -> Optional[Dict[str, Any]]:
from copy import copy
from oakvar.lib.util.seq import liftover_one_pos
from oakvar.lib.util.seq import liftover

assert self.crl_writer is not None
if self.is_chrM(variant):
needed = self.do_liftover_chrM
else:
needed = self.do_liftover
if needed:
prelift_wdict = copy(variant)
#prelift_wdict["uid"] = self.uid
#self.crl_writer.write_data(prelift_wdict)
crl_data = prelift_wdict
(
variant["chrom"],
variant["pos"],
variant["ref_base"],
variant["alt_base"],
) = liftover(
variant["chrom"],
int(variant["pos"]),
variant["ref_base"],
variant["alt_base"],
lifter=self.lifter,
wgs_reader=self.wgs_reader,
)
converted_end = liftover_one_pos(
variant["chrom"], variant["pos_end"], lifter=self.lifter
)
if converted_end is None:
pos_end = ""
else:
pos_end = converted_end[1]
variant["pos_end"] = pos_end
else:
crl_data = None
return crl_data

def is_chrM(self, wdict):
return wdict["chrom"] == "chrM"

Expand Down
1 change: 0 additions & 1 deletion oakvar/lib/util/seq.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,6 @@ def liftover_one_pos(
lifter = get_lifter(source_assembly)
if not lifter:
raise ValueError(f"LiftOver not found for {source_assembly}")
# res = Optional[[(chrom, pos, strand, score)...]]
hits = lifter.convert_coordinate(chrom, pos - 1)
converted = None
if hits:
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.69",
version="2.9.70",
description="A genomic variant analysis platform",
long_description=long_description,
long_description_content_type="text/x-rst",
Expand Down

0 comments on commit eedf4cc

Please sign in to comment.