Skip to content

Commit

Permalink
Merge pull request #28 from eastgenomics/DI-915_v1.5.0_get_summary_te…
Browse files Browse the repository at this point in the history
…xt_file_id

v1.5.0 - find summary .txt file id (#28)
  • Loading branch information
jethror1 committed Jun 28, 2024
2 parents 15a0128 + 70c9b08 commit d2a859f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/eggd_artemis.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def find_snv_files(reports):
{
'SNV variant report': 'file-ZX',
'Coverage report': {'$dnanexus_link': 'file-GH'},
'Summary text file': 'file-NM',
'SNV count': 1
}
],
Expand All @@ -50,6 +51,7 @@ def find_snv_files(reports):
{
'SNV variant report': 'file-GH',
'Coverage report': {'$dnanexus_link': 'file-GH'},
'Summary text file': 'file-JK',
'SNV count': 3
}
]
Expand Down Expand Up @@ -98,8 +100,13 @@ def _find(report):
except KeyError:
coverage_report = parent_details["output"]["stage-Fyq5z18433GfYZbp3vX1KqjB.report"]

summary_text = parent_details.get("output", {}).get("stage-rpt_athena.summary_text", {}).get("$dnanexus_link")
if not summary_text:
print(f"No summary .txt file found in output of eggd_athena stage"
f" for SNV reports workflow ({parent_details})")

# Extract the sention job id from the vcf metadata
sention_job_id=dxpy.describe(vcf_file)["createdBy"]["job"]
sention_job_id = dxpy.describe(vcf_file)["createdBy"]["job"]
sentieon_details = dxpy.bindings.dxjob.DXJob(dxid=sention_job_id).describe()

# Get bam & bai job id from sention job metadata
Expand All @@ -117,6 +124,7 @@ def _find(report):
{
"SNV variant report": report['describe']['id'],
"Coverage report": coverage_report,
"Summary text file": summary_text,
"SNV count": str(snv_variant_count)
}
]
Expand Down Expand Up @@ -411,10 +419,10 @@ def get_multiqc_report(path_to_reports, project):
multiqc_file (str): file id of the multiqc file
"""
# Get path to single from reports path
single=f"/output/{path_to_reports.split('/')[2]}"
single = f"/output/{path_to_reports.split('/')[2]}"

# Find MultiQC jobs in the project
multiqc_reports=list(dxpy.bindings.search.find_jobs(
multiqc_reports = list(dxpy.bindings.search.find_jobs(
name_mode='glob',
name="*MultiQC*",
state="done",
Expand Down

0 comments on commit d2a859f

Please sign in to comment.