Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing duplicate inputs bug #514

Merged
merged 4 commits into from
Feb 15, 2024
Merged

Fixing duplicate inputs bug #514

merged 4 commits into from
Feb 15, 2024

Conversation

jpramosbarroso
Copy link
Collaborator

With the changed that were made in the previous PR re. nested inputs, the resulting WDL led to duplicates in the Terra workflow setup UI (see attached screenshot). This preserves stylistic edits made while insuring inputs only appear once in the Terra UI. I could not find a workaround that did not involve passing in all of the inputs after call create_vis.
![Screenshot 2024-02-15 at 2 45 56 PM] (https://github.com/broadinstitute/viral-pipelines/assets/78126657/c294b272-5c98-487c-9f4c-4d161db44e67)

Copy link
Member

@dpark01 dpark01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah so the way you want to do this is actually just delete your entire input block from the workflow itself.

@dpark01
Copy link
Member

dpark01 commented Feb 15, 2024

So basically (and I can't suggest edits to lines that weren't changed by your PR, so here's another approach) you want the workflow WDL to look like this:

version 1.0

workflow CreateEntericsQCViz {

    meta {
        allowNestedInputs: true
    }

    call create_viz

    output {
        File    visualization_html     =   create_viz.html
    }
}

task create_viz {
    input {
        Array[String]   sample_ids
        String          workspace_name
        String          workspace_project
        String          input_table_name

        String           grouping_column_name            =   "gambit_predicted_taxon"
        String           output_filename                 =   "QC_visualizations.html"

        String?         custom_est_coverage_thresholds
        String?         custom_contig_thresholds
        String?         custom_assembly_thresholds
        String?         custom_mean_q_thresholds

        String          docker                          =   "us-central1-docker.pkg.dev/pgs-automation/enterics-visualizations/create_visualization_html:v1"       
    }

    parameter_meta {
        sample_ids: {description: "selected rows of data from data table which will be used for plotting"}
        input_table_name: {description: "name of the Terra data table - root entity type - from where input data is selected"}
        workspace_name: {description: "name of Terra workspace where data lives"}
        workspace_project: {description: "name of Terra project associated with Terra workspace"}
        grouping_column_name: {description: "name of column to be used for grouping/coloring - ex. gambit_predicted_taxon (organism)"}
        output_filename: {description: "name of output file containing visualizations"}
        custom_est_coverage_thresholds: {description: "json string with custom estimated coverage threshlds"}
        custom_contig_thresholds: {description: "json string with custom number contig thresholds"}
        custom_assembly_thresholds: {description: "json string with custom assembly length thresholds"}
        custom_mean_q_thresholds: {description: "json string with custom mean q thresholds"}
    }

    command {
        python3 /scripts/create_enterics_visualizations_html.py -s ~{sep=' ' sample_ids} \
                                                                -dt ~{input_table_name} \
                                                                -w ~{workspace_name} \
                                                                -bp ~{workspace_project} \
                                                                ~{"-g" + grouping_column_name} \
                                                                ~{"-o" + output_filename} \
                                                                ~{"-ect" + custom_est_coverage_thresholds} \
                                                                ~{"-cnt" + custom_contig_thresholds} \
                                                                ~{"-at" + custom_assembly_thresholds} \
                                                                ~{"-mqt" + custom_mean_q_thresholds} \
    }

    runtime {
        docker: docker
    }

    output {
        File html = output_filename
    }
}

@jpramosbarroso
Copy link
Collaborator Author

@dpark01 I've incorporated your feedback — thank you for taking the time to look this over!

@dpark01 dpark01 enabled auto-merge February 15, 2024 20:34
@dpark01 dpark01 added this pull request to the merge queue Feb 15, 2024
Merged via the queue into master with commit e932624 Feb 15, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants