-
Notifications
You must be signed in to change notification settings - Fork 1.1k
12801 bug in gsea module related with multiple gene sets processing #12821
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -45,26 +45,32 @@ process GSEA_GSEA { | |||||||||||||
| def prefix = task.ext.prefix ?: "${meta.id}" | ||||||||||||||
| def rpt_label = prefix.replaceAll('\\.$', '') // Remove any trailing dots from prefix when passed as report label, so GSEA doesn't produce double-dotted top-level outputs | ||||||||||||||
| def chip_command = chip ? "-chip $chip -collapse true" : '' | ||||||||||||||
| // gsea-cli crashes if given more than one -gmx file; callers must invoke this process once per gene set file. | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should probably quote the file in the
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment's wrong once |
||||||||||||||
| def gmx = gene_sets instanceof List ? gene_sets[0] : gene_sets | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think silently selecting the first gene set is the right workaround, I think that's worse than erroring when someone supplied the wrong input shape. We should either explicitly error when a list is supplied, or just remove this and let the fail continue (since any error is at the workflow level)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree, I will drop the
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, I think maybe we just need to make a comma-separated version?
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, in this case, gsea-cli will generate an analysis name by appending the list of collection names. I think it should be fixed at the pipeline-level
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. gsea-cli doesn't crash on multiple files — it silently keeps only the first and drops the rest (confirmed with a real run). It does support multiple files via one comma-joined value (confirmed against
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, so here is the question then, do you want one GSEA_GSEA call per contrast with multiple slurm jobs or a multi-collection call per contrast so gsea-cli will handle it? If you want the second option, then I guess
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure there's a good reason to separate them into multiple jobs? But in any case, it's a slightly orthogonal question. From the module's point of view as a component it should be able to deal with the multiple-input method, since the GSEA CLI can. |
||||||||||||||
|
|
||||||||||||||
| """ | ||||||||||||||
| # Run GSEA | ||||||||||||||
|
|
||||||||||||||
| gsea-cli GSEA \\ | ||||||||||||||
| -res $gct \\ | ||||||||||||||
| -cls ${cls}#${target}_versus_${reference} \\ | ||||||||||||||
| -gmx $gene_sets \\ | ||||||||||||||
| -res "$gct" \\ | ||||||||||||||
| -cls "${cls}#${target}_versus_${reference}" \\ | ||||||||||||||
| -gmx "$gmx" \\ | ||||||||||||||
| $chip_command \\ | ||||||||||||||
| -out . \\ | ||||||||||||||
| --rpt_label $rpt_label \\ | ||||||||||||||
| --rpt_label "$rpt_label" \\ | ||||||||||||||
| $args | ||||||||||||||
|
|
||||||||||||||
| # Un-timestamp the outputs for path consistency | ||||||||||||||
| mv ${rpt_label}.Gsea.*/* . | ||||||||||||||
| # Only rmdir actual directories: the .rpt file's name also matches "*.Gsea.*". | ||||||||||||||
| mv *.Gsea.*/* . | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it necessary to have made this glob broader?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah.. I will revert it back |
||||||||||||||
| for gsea_dir in *.Gsea.*/; do | ||||||||||||||
| [ -d "\$gsea_dir" ] && rmdir "\$gsea_dir" | ||||||||||||||
| done | ||||||||||||||
|
Comment on lines
+64
to
+68
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tried to reproduce this naming problem — a real comma-joined
Suggested change
|
||||||||||||||
| timestamp=\$(cat *.rpt | grep producer_timestamp | awk '{print \$2}') | ||||||||||||||
|
|
||||||||||||||
| for pattern in _\${timestamp} .\${timestamp}; do | ||||||||||||||
| find . -name "*\${pattern}*" | sed "s|^\\./||" | while read -r f; do | ||||||||||||||
| mv \$f \${f//\$pattern/} | ||||||||||||||
| mv "\$f" "\${f//\$pattern/}" | ||||||||||||||
| done | ||||||||||||||
| done | ||||||||||||||
| sed -i.bak "s/[_\\.]\$timestamp//g" *.rpt *.html && rm *.bak | ||||||||||||||
|
|
||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since everything else is getting quoted: