Skip to content

Commit

Permalink
Merge pull request #544 from Sage-Bionetworks/gen-1026-output-error
Browse files Browse the repository at this point in the history
[GEN-1026] Output annotation error report
  • Loading branch information
rxu17 authored Jan 11, 2024
2 parents c01f67d + b3d6491 commit 09fd450
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ RUN apt-get update && apt-get install -y --allow-unauthenticated --no-install-re
# texlive-generic-recommended \
texlive-latex-extra \
# genome nexus
openjdk-8-jre \
openjdk-11-jre \
# This is for reticulate
python3.8-venv && \
apt-get clean && \
Expand Down Expand Up @@ -83,6 +83,6 @@ WORKDIR /root/
# Must move this git clone to after the install of Genie,
# because must update cbioportal
RUN git clone https://github.com/cBioPortal/cbioportal.git -b v5.3.19
RUN git clone https://github.com/Sage-Bionetworks/annotation-tools.git -b 0.0.3
RUN git clone https://github.com/Sage-Bionetworks/annotation-tools.git -b 0.0.4

WORKDIR /root/Genie
4 changes: 4 additions & 0 deletions genie/process_mutation.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,14 @@ def process_mutation_workflow(
"syn22053204",
ifcollision="overwrite.local",
downloadLocation=genie_config["genie_annotation_pkg"],
# version=1, # TODO: This should pull from a config file in the future
)
# Genome Nexus Jar file
syn.get(
"syn22084320",
ifcollision="overwrite.local",
downloadLocation=genie_config["genie_annotation_pkg"],
# version=13, # TODO: This should pull from a config file in the future
)

annotated_maf_path = annotate_mutation(
Expand Down Expand Up @@ -248,6 +250,7 @@ def annotate_mutation(
"""
input_files_dir = tempfile.mkdtemp(dir=workdir)
output_files_dir = tempfile.mkdtemp(dir=workdir)
error_dir = os.path.join(output_files_dir, f"{center}_error_reports")

for mutation_file in mutation_files:
move_mutation(mutation_file, input_files_dir)
Expand All @@ -260,6 +263,7 @@ def annotate_mutation(
os.path.join(genie_annotation_pkg, "annotation_suite_wrapper.sh"),
f"-i={input_files_dir}",
f"-o={output_files_dir}",
f"-e={error_dir}",
f"-m={merged_maf_path}",
f"-c={center}",
"-s=WXS",
Expand Down
4 changes: 4 additions & 0 deletions tests/test_process_mutation.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,13 @@ def test_process_mutation_workflow(syn, genie_config):
"syn22053204",
ifcollision="overwrite.local",
downloadLocation=genie_annotation_pkg,
# version=1, # TODO: This should pull from a config file in the future
),
call(
"syn22084320",
ifcollision="overwrite.local",
downloadLocation=genie_annotation_pkg,
# version=13, # TODO: This should pull from a config file in the future
),
]
center = "SAGE"
Expand Down Expand Up @@ -148,6 +150,7 @@ def test_annotate_mutation():
workdir = "working/dir/path"
mktemp_calls = [call(dir=workdir)] * 2
input_dir = "input/dir"
error_dir = "input/dir/SAGE_error_reports"
with patch.object(
tempfile, "mkdtemp", return_value=input_dir
) as patch_mktemp, patch.object(
Expand All @@ -169,6 +172,7 @@ def test_annotate_mutation():
"annotation/pkg/path/annotation_suite_wrapper.sh",
f"-i={input_dir}",
f"-o={input_dir}",
f"-e={error_dir}",
f"-m=input/dir/data_mutations_extended_{center}.txt",
f"-c={center}",
"-s=WXS",
Expand Down

0 comments on commit 09fd450

Please sign in to comment.