Commit d53f7a09 authored by Pradat Yoann's avatar Pradat Yoann
Browse files

fix path to tools

parent 90638a8a
[run]
omit = */__init__.py, *tests*
......@@ -28,17 +28,6 @@ def set_wd_to_repo():
os.chdir("..")
return current_wd
def get_path_to_repo() -> str:
current_wd = os.getcwd()
if REPO_FOLDER not in os.getcwd():
raise ValueError("Please set the working directory to a location in the repository %s" % REPO_FOLDER)
else:
while not os.getcwd().endswith(REPO_FOLDER):
os.chdir("..")
repo_path = os.getcwd()
os.chdir(current_wd)
return repo_path
def load_vcf(filepath: str, no_header: bool=False) -> DataFrame:
"""
......@@ -80,6 +69,7 @@ def load_vcf(filepath: str, no_header: bool=False) -> DataFrame:
return df_vcf
def write_vcf(filepath_orig: str, filepath_dest: str, df_vcf: DataFrame) -> None:
headersymbol = "##"
headerrows = []
......
......@@ -11,7 +11,6 @@ Python wrapper around vcf2maf perl script.
"""
import os
from ._util import get_path_to_repo
def run_vcf2maf_annotator(vep_data: str, vep_n_fork: int, vcf_path: str, out_path: str, tmp_folder: str, tumor_id: str, normal_id: str, fasta: str, overwrite: bool=False):
"""
......@@ -37,9 +36,8 @@ def run_vcf2maf_annotator(vep_data: str, vep_n_fork: int, vcf_path: str, out_pat
overwrite: bool
if the output file already exists (from previous run), should it be overwritten?
"""
repo_path = get_path_to_repo()
vcf2maf_path = os.path.join(repo_path, "tools/vcf2maf/vcf2maf.pl")
vep_path = os.path.join(repo_path, "tools/ensembl-vep")
vcf2maf_path = os.path.normpath(os.path.join(__file__, "../../tools/vcf2maf/vcf2maf.pl"))
vep_path = os.path.normpath(os.path.join(__file__, "../../tools/ensembl-vep"))
need_run = True
vcf_file = out_path.split("/")[-1]
......
......@@ -11,7 +11,6 @@ Python wrapper around VEP command.
import os
from typing import Union
from ._util import get_path_to_repo
def run_vep_annotator(vep_data: str, vcf_path: str, out_path: str, fasta: str, vep_custom: Union[str,list]=None, overwrite: bool=False, vep_n_fork: int=4):
"""
......@@ -36,8 +35,7 @@ def run_vep_annotator(vep_data: str, vcf_path: str, out_path: str, fasta: str, v
number of forks to be used when running VEP.
"""
repo_path = get_path_to_repo()
vep_path = os.path.join(repo_path, "tools/ensembl-vep/vep")
vep_path = os.path.normpath(os.path.join(__file__, "../../tools/ensembl-vep/vep"))
need_run = True
if os.path.exists(out_path) and not overwrite:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment