NOT MERGE 478 qc plot on omega vs dndscv values comparison - #479
NOT MERGE 478 qc plot on omega vs dndscv values comparison#479FerriolCalvet wants to merge 23 commits into
Conversation
…step was enabled in the pipeline
…omega-dndscv filtered table
|
@FerriolCalvet I fixed all errors, tests seeem to work fine 🥳 Should I add someone as reviewer before proceeding with the PR? |
|
new related tasks:
|
There was a problem hiding this comment.
Pull request overview
This PR extends the DeepCSA QC plotting workflow to add new omega comparison plots (omega vs dNdScv and omega vs omegaglobal) and wires dNdScv results into the plotting subworkflow, with corresponding output publishing updates.
Changes:
- Plumb dNdScv combined results (
all_dNdScv.cv.tsv) intoPLOTTING_QCand add an omega-vs-dNdScv QC plotting step (conditional onparams.dnds). - Add an omega-vs-omegaglobal QC plotting step and publish both new plot outputs under
qc/omegaqc/.... - Extend omega annotation QC outputs to emit a “flagged synonymous” debug TSV used for filtering/annotation in the new plots.
Reviewed changes
Copilot reviewed 6 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| workflows/deepcsa.nf | Adds a dndscv_table channel and passes it into the QC plotting subworkflow when dNdScv runs. |
| subworkflows/local/plotting_qc/main.nf | Adds module includes and wiring for omega-vs-dNdScv and omega-vs-omegaglobal QC plots. |
| modules/local/plot/qc/omega_vs_omegaglobal/main.nf | New Nextflow process wrapper for running omega_vs_omegaglobal_qc.py. |
| modules/local/plot/qc/omega_vs_dndscv/main.nf | New Nextflow process wrapper for running omega_vs_dndscv_qc.py. |
| modules/local/plot/qc/annotate_omega/main.nf | Updates emitted debug outputs from omega QC annotation to expose flagged synonymous genes. |
| conf/results_outputs.config | Publishes new QC plot outputs to dedicated qc/omegaqc/... directories; updates omega flagged publish path. |
| bin/plot_explore_variability.py | Adds a comment (no functional change). |
| bin/omega_vs_omegaglobal_qc.py | New plotting script for omega vs omegaglobal comparison and correlation plots. |
| bin/omega_vs_dndscv_qc.py | New plotting script for omega vs dNdScv comparison and correlation plots. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
m-huertasp
left a comment
There was a problem hiding this comment.
Hola!!
I think it is a very nice job, Bet! I know it is fun when you start understanding a bit more how everything is connected.
I've added some comments, they have some questions in them just to understand what you want exactly. I've also tested the problem Copilot indicated and it is true. In fact, it might be the most important thing to tackle. But it should be quite simple.
If you need some help with something, tell me!
| sample_groups = flagged_genes_df['cohort'].unique().tolist() | ||
|
|
There was a problem hiding this comment.
I understand that the idea of this line is to get the name of the sample groups that you'll use later to generate the plot, right? Is the idea to plot only groups in which there is at least one flagged gene or you want to plot them all? Because by getting the groups from the flagged_genes_df you are getting only those with at least one flagged gene.
If you want to plot all, maybe you can get the groups from the omega_df or the dndscv_df??
There was a problem hiding this comment.
I understand that the idea of this line is to get the name of the sample groups that you'll use later to generate the plot, right?
yes!
Is the idea to plot only groups in which there is at least one flagged gene or you want to plot them all?
Clarification here: the ideas is to discard those genes that are flagged per group to only plot those not flagged
There was a problem hiding this comment.
I see.. What I was trying to say is that with the current strategy, from what I understand, you are only going to plot sample_groups in which there's at least one flagged gene. Because you are getting the sample_groups from the flagged_genes_df.
Groups in which there's not a flagged gene are not going to appear in the plot.
Maybe it is clearer with an exampe, imagine you have this table:
| group | gene | omega | flagged |
|---|---|---|---|
| A | TP53 | 2 | No |
| B | KRAS | 1 | Yes |
| B | TERT | 2.5 | No |
In this case, you would want to plot TP53 for group A and TERT for group B. But, you are using flagged_genes_df to extract the sample group names that you are going to plot, which includes only:
| group | gene | omega | flagged |
|---|---|---|---|
| B | KRAS | 1 | Yes |
Then, the only group that you are going to get is B. Therefore, you are going to plot only TERT for group B,
Is this clearer?
There was a problem hiding this comment.
Exactly, now I see your point, it's totally true that if any group is not flagged (like A in the example) with this strategy we will miss that group for plotting. Since we are doing the 'all_samples' comparison the gene comparison will be done for that gene, but you're right that we would miss the group comparison for that particular gene. The solution would be to extract the group information from a predefined variable for groups in deepCSA (not sure if it exists) or from the features table, but not sure which is the best way tbh...
Make this plot conditional (similar to the dNdScv plot) and emit an empty channel when not applicable. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Removed legend from scatter plot for clarity
deleted comment
| sample_groups = flagged_genes_df['cohort'].unique().tolist() | ||
|
|
There was a problem hiding this comment.
I understand that the idea of this line is to get the name of the sample groups that you'll use later to generate the plot, right?
yes!
Is the idea to plot only groups in which there is at least one flagged gene or you want to plot them all?
Clarification here: the ideas is to discard those genes that are flagged per group to only plot those not flagged
|
@m-huertasp in principle it is ready to review but very few changes added, not sure if this copilot revision was applied |
|
Hi! Nice to see that you could find some time to do this jeje @efigb The copilot comment is not implemented. It is simple though! You just need to add the tsv to the I've clarified a comment I did about the sample groups to be plot. Just to make sure. |
added code to stub block to ensure non optional tsv files are generated in stub mode
Thanks for the explanation! Now I've added the line in the stub block (just in case we run in stub mode at some point), hope it is now correct! |
|
Hi! sorry for joining to this PR a bit late, I think all looks good, but the two python scripts are intended to do a very similar thing and some pieces of code are even the same (I think) |
- groups.json file provided to the module calls
…s with omegaglobal and dndscv when available
No description provided.