Skip to content

Commit

Permalink
optional liftover_root and its handling
Browse files Browse the repository at this point in the history
  • Loading branch information
kriese committed Jun 3, 2022
1 parent 3ff99f8 commit f0d63c3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ region_file: # str (path to a conflict file)
alternative_haplotype_vcf: # str (path to a vcf file with known SVs, e.g.
from the HGSVC)

# path to liftover directory (explained below)
liftover_root: # default to 'resources/references/liftover'

# Settings for the pairwise alignment
pw_alignment:
match: # positive integer
Expand Down Expand Up @@ -52,6 +55,7 @@ references/
t2t_v1.0_to_t2t_v1.1.chain
liftover_config.json
```

where `liftover_config.json` looks like:
```json
{
Expand Down
10 changes: 7 additions & 3 deletions workflow/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@ from pathlib import Path
import sys
sys.path.append("./workflow/scripts")

regionfile = config['region_file']
regionfile = config["region_file"]
ref_dict = config["ref_dict"]
references = list(ref_dict.keys())
ref_files = list(ref_dict.values())
main_reference = config["main_ref_name"]
liftover_config = Path(config["liftover_root"]) / "liftover_config.json"
try:
liftover_root = config["liftover_root"]
except:
liftover_root = "resources/references/liftover/"
liftover_config = Path(liftover_root) / "liftover_config.json"


from conflict_positions import Region
Expand Down Expand Up @@ -127,7 +131,7 @@ rule create_igv_batch:
"results/{sample}/{region}/igv_batch_{ref}.txt"
params:
region = lambda wc: f"{Region(wc.get('region')):}",
ref_file = lambda wc: ref_dict[wc.get('ref')],
ref_file = lambda wc: ref_dict[wc.get("ref")],
path_to_resources = Path(".").absolute()
shell:
"""
Expand Down

0 comments on commit f0d63c3

Please sign in to comment.