Skip to content

Commit

Permalink
Merge pull request #132 from eastgenomics/v2.3.0-release
Browse files Browse the repository at this point in the history
fix summary sheet ID parsing (#132)
  • Loading branch information
mattgarner authored Jan 5, 2023
2 parents 747130f + cece558 commit 5e51a17
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 17 deletions.
2 changes: 2 additions & 0 deletions resources/home/dnanexus/generate_workbook/utils/excel.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ def basic_summary(self) -> None:
self.summary.cell(1, 2).value = sample

self.summary.column_dimensions['A'].width = 23
self.summary.column_dimensions['B'].width = 13

self.summary.merge_cells(
start_row=1, end_row=1, start_column=2, end_column=4)

Expand Down
40 changes: 23 additions & 17 deletions src/code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,9 @@ set -exo pipefail
_dias_report_setup () {
# function to handle parsing values and reading
# manifest / g2t etc. for Dias sampels
mark-section "Getting values for Dias"

# get job id creating the annotated vcf
vcf=$(awk -F'"' '{print $4}' <<< "${vcfs[0]}")
analysis_id=$(dx describe --json ${vcf} | jq -r '.createdBy.job')

if [ "$analysis_id" != "null" ]; then
workflow_id=$(dx describe --json "${analysis_id}" | jq -r '.parentAnalysis')

if [ "$workflow_id" != "null" ]; then
workflow_name=$(dx describe --json "${workflow_id}" | jq -r '.executableName')
else
# unset from null string if not from workflow
unset workflow_id
fi
fi
mark-section "Getting output name for Dias"

project_id=$DX_PROJECT_CONTEXT_ID
job_id=$DX_JOB_ID

# Tiny chance of race conditions leading to two files with the same name here
version=0
Expand All @@ -41,6 +25,26 @@ _dias_report_setup () {
fi
}

_get_dx_job_ids () {
# gets the dx job IDs of the workflow that generated the annotated VCF
job_id=$DX_JOB_ID

# get job that generated the vcf
vcf=$(awk -F'"' '{print $4}' <<< "${vcfs[0]}")
analysis_id=$(dx describe --json ${vcf} | jq -r '.createdBy.job')

if [ "$analysis_id" != "null" ]; then
workflow_id=$(dx describe --json "${analysis_id}" | jq -r '.parentAnalysis')

if [ "$workflow_id" != "null" ]; then
workflow_name=$(dx describe --json "${workflow_id}" | jq -r '.executableName')
else
# unset from null string if not from workflow
unset workflow_id
fi
fi
}


main() {
echo "Value of vcf(s): ${vcfs[*]}"
Expand All @@ -52,6 +56,8 @@ main() {
dx-download-all-inputs --parallel
find ~/in/vcfs -type f -name "*" -print0 | xargs -0 -I {} mv {} ~/vcfs

_get_dx_job_ids

if [ "$summary" == "dias" ]; then
# do dias specific things
_dias_report_setup
Expand Down

0 comments on commit 5e51a17

Please sign in to comment.