-
Notifications
You must be signed in to change notification settings - Fork 18
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
improve_07_annotation #994
base: main
Are you sure you want to change the base?
Conversation
Hi @maud-p, just wanted to give you a heads-up for time frame! I anticipate getting to review this next Tuesday 1/21, since we are out of the office Monday 1/20 for a holiday and I don't think I'll have a chance to get to this today. Have a good weekend in the meantime! :) |
Hi @sjspielman , |
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.
Generally speaking, these annotation changes you are proposing seem reasonable to me. I have a few initial thoughts about some of the way this is implemented. Once you make these changes, I will do a second round of more thorough code review. Let me know if I can clarify anything here!
- Most importantly, the score threshold (0.85 being changed to 0.75) was not only used in this notebook. It was also used in several exploratory steps (we don't need to worry about those at this point), but more importantly it was used for inferCNV inference. We would like to keep this parameter consistent whenever it is used to create the annotations, which is during inferCNV inference and in this notebook. Therefore, to change the threshold, you'll want to take a step back here to apply the changes more broadly and make use of the arguments and parameters we have already established. I recommend that you:
- Define a variable at the top of this script
00_run_workflow.sh
with the chosen threshold you'd like to use, 0.75 - Pass this variable into both the inferCNV step on line 150, and this notebook on the following line
- Then, re-run these steps to regenerate both the inferCNV results and this notebook; you'll want to make sure those new inferCNV results are also updated in your researcher results S3 bucket for me to see them as part of review.
- I recommend leaving all defaults at 0.85 for now.
- Define a variable at the top of this script
- The choice of
+2
indeed seems sort of arbitrary, which isn't necessarily a problem. But, since it is not a rigorously tested value, I recommend making it a notebook parameter in case this changes in the future after additional investigation.
...yses/cell-type-wilms-tumor-06/notebook/07_combined_annotation_across_samples_exploration.Rmd
Outdated
Show resolved
Hide resolved
...yses/cell-type-wilms-tumor-06/notebook/07_combined_annotation_across_samples_exploration.Rmd
Outdated
Show resolved
Hide resolved
...yses/cell-type-wilms-tumor-06/notebook/07_combined_annotation_across_samples_exploration.Rmd
Outdated
Show resolved
Hide resolved
…ion_across_samples_exploration.Rmd Co-authored-by: Stephanie Spielman <[email protected]>
…ion_across_samples_exploration.Rmd Co-authored-by: Stephanie Spielman <[email protected]>
…ion_across_samples_exploration.Rmd Co-authored-by: Stephanie Spielman <[email protected]>
…old default to 0.85
Hi @sjspielman , thank you for the review 😄 I followed your advice to keep the Thank you! |
To clarify, what I meant by this is to keep the defaults in the R code as 0.85 (e.g., the inferCNV script argument and the notebook parameter), but you can assign 0.75 in the shell script
For this, you'd need to define two separate parameters rather than using
|
Dear @sjspielman , |
Co-authored-by: Stephanie Spielman <[email protected]>
Dear @sjspielman , I just wanted to let you know that there will be 2 ~major changes to come tha will impact this PR:
I made all these changes locally and re-ran the workflow. I am now exploring the results to make sure it is worth going into it. I would then suggest to postpone this PR and open another one to first change the Then maybe once this is fixed we can re-open the PR#994 and finalize the remaining changes? Thank you in advance! |
🥳🥳🥳 great catch!!
That's fine with me! I was thinking that it might be fine to keep this PR open and come back to it later after merging in those other changes you describe, but the results might be different enough that a new PR is easier for you. So in any case - do what is easier for you :) |
Purpose/implementation Section
Please link to the GitHub issue that this pull request addresses.
This PR is linked to the issue 856.
What is the goal of this pull request?
I aim here to improve the workflow of the annotations performed in
07_combined_annotation_across_samples_exploration.Rmd
.The suggested changes aim to overcome some misclassification that have been spotted in the first version of the annotation while working on the integration of the data.
cnv-threshold
. See the expression of PTPRC = CD45 below:We requested immune and endothelial cells to have no infered cnv to be labeled as normal. I think that the few CNV that were infered for immune cells are cell type specific expression of some genes that colocalized on one chromosome. Thus I decided to allow a bit of flexibility in regards to CNV for immune and endothelial cells and only based the annotation of immune and endothelial cells on the
predicted.cell-type
and associatedprediction.score
.Similar to the immune cells, there is a high probability that we also infer false positive CNV in normal epithelial/stroma cells. I am not sure that it will be possible to differentiate between normal cells with false positive CNV from cancer cells. For that reason, I decided to label as
normal
cells with acnv-score <= cnv-threshold
and ascancer
cells with acnv-score > cnv-threshold + 2
.The choice of
+2
is a bit arbitrary, but based on the approximate number of CNV that can be detected inendothelial
andimmune
cells.There is the possibility of cancer cell without any CNV. It would be extremly difficult in that case to differentiate them from normal cells. The strategy I decided to go with to reduce the risk of misclassification is to use the prediction score of label transfer. Indeed, we expect normal cells to resemble the cells from the fetal kidney reference and thus have a high
prediction.score
.While working on the integration (see umap reduction here colored by
cnv_score
), I realized that samples -177, -180, -181, -190, -197 have strikingly very lowcnv_score
. Thecnv_score
is simply the number of chromosome presenting a CNV for each patient. Of note, these 5 samples are the ones with no immune and/or endothelial cells for which we couldn’t runinfercnv
properly. We raninfercnv
without any reference. In that case, the mean over all cellular expression profiles is taken as a reference. If the sample is mostly composed of cancer cell, the cancer-associated CNV are taken as the normal reference...I am afraid not to have a solution for this, but I am quite sure that the cells for these 5 patients are mis-classified. This will affect the downstream differential expression analysis cancer versus normal and the potential finding of Wilms tumor histology specific markers. This is why I would strongly recommand forcing the annotations for these patients to
unknown
.do_Feature_mean
. Initially, thefeature
ploted withdo_Feature_mean
wasprop_cnv_chr[i]
, the proportion of the chromosome i affected by a CNV. The functiondo_Feature_mean
took then the mean over all cells in a group. This can be misleading are it is then impossible to interpret the mean value. Example with a mean of 0.5, we could say:For that reason, I changed the
feature
tohas_cnv_chr[i]
, which is a binary information of the presence/absence of CNV in the chromosome i for the given cell. While taking the mean over all cells in a group, we then have the information of the percentage of cells within the group having any kind of CNV in this chromosome.If known, do you anticipate filing additional pull requests to complete this analysis module?
-[ ] one for the integration of the samples
-[ ] one for differential expression analysis, looking for Wilms tumor, histology specific markers
Results
The annotation file is generated automatically while running the script and will be saved in the
results
folder.The notebook is saved in the
notebook
folder.Provide directions for reviewers
What are the software and computational requirements needed to be able to run the code in this PR?
Are there particularly areas you'd like reviewers to have a close look at?
Is there anything that you want to discuss further?
Author checklists
Analysis module and review
README.md
has been updated to reflect code changes in this pull request.Reproducibility checklist
Dockerfile
.environment.yml
file.renv.lock
file.