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

How to add labels in the Karyo plot? #27

Open
sjasws opened this issue Sep 5, 2024 · 9 comments
Open

How to add labels in the Karyo plot? #27

sjasws opened this issue Sep 5, 2024 · 9 comments

Comments

@sjasws
Copy link

sjasws commented Sep 5, 2024

Thank you for your outstanding tool! It is very useful in inferring CNV and is very accurate for my data.
Now I try to infer epithelial ovarian cancer cells (which are very closely associated with CNV) by epiAneufinder to distinguish normal ovarian epithelial cells. I mix all the cells and use epiAneufinder to infer the CNV, and then see which epithelial cells I have annotated are grouped together with non-epithelial cells, and these epithelial cells are considered normal epithelial cells, and those clustered alone with obvious CNV will be considered as tumor cells. Just as inferCNV done.
To facilitate monitoring, is there any way to add a legend of the cell type I already annotated to the plot_karyo_annotated () function, as the right part of your Figure 4a in Nat Commun 14, 5846 (2023)?
Thank you for your help!
With Best Regards
Lin

@thek71
Copy link
Collaborator

thek71 commented Sep 5, 2024

Hi Lin,

if I understand correctly, you have for each cell/barcode an annotation. What you can do is just load the annotation to R as a table with one column the cells and the second column the annotation, convert it to a data frame and use the plot_karyo_annotated () for creating a new plot, with the annotation of the cells as an extra to the original plot. In the vignette you can see an example and in your case the annot_dt data frame will be the annotation that you have.
I hope I understood correctly what you want to do. If not please correct me.

Best,
Katia

@sjasws
Copy link
Author

sjasws commented Sep 5, 2024

Hi Lin,

if I understand correctly, you have for each cell/barcode an annotation. What you can do is just load the annotation to R as a table with one column the cells and the second column the annotation, convert it to a data frame and use the plot_karyo_annotated () for creating a new plot, with the annotation of the cells as an extra to the original plot. In the vignette you can see an example and in your case the annot_dt data frame will be the annotation that you have. I hope I understood correctly what you want to do. If not please correct me.

Best, Katia

Thank you for your reply.
I don't know if it could add the third column with cell type annotation? I add it but seem doesn't work.

@KatharinaSchmid
Copy link
Contributor

Hi Lin,
I am not sure why you talk about a third column, the annotation data frame should have only two columns? To show the example for Katia's explanation from our vignette, you can use this function:

plot_karyo_annotated(res_table=res_table,
                     plot_path="epiAneufinder_results/karyo_annotated.png",
                     annot_dt=annot_dt)

The result table res_table you get after running the epiAneufinder main function and the annot_dt table is supposed to have two columns named cell and annot, like this:

> head(annot_dt)
                     cell  annot
1 cell-TCAGCTCTCGCGTTCT-1 Clone1
2 cell-TACGCAAAGTCGTGAG-1 Clone2
3 cell-TAACTTCTCCCGGGTA-1 Clone3
4 cell-ACCATCCGTTCTGAAC-1 Clone3
5 cell-CTCAGCTAGAGACTCG-1 Clone3
6 cell-ACAATCGTCTCATCCG-1 Clone4

Be aware that the cell column needs the barcodes exactly as in the epiAneufinder results table, which added a "cell-" prefix to each barcode.

Does this help you? And can you specify what doesn't work? You get an error message or the plot just looks weird?

@sjasws
Copy link
Author

sjasws commented Sep 6, 2024

Dear @thek71 @KatharinaSchmid
Sorry, my English is very poor. I probably didn't express clearly. I draw a picture of what I want to achieve, that is, like the bottom panel, can an karyoplot generate multiple annotations for all cells at once?
subclone

@thek71
Copy link
Collaborator

thek71 commented Sep 6, 2024

Hi Lin,
the function works for one annotation.
But we can/will add this feature in the next release.
We will keep you posted when it's out.

Best regards,
Katia and Katharina

@sjasws
Copy link
Author

sjasws commented Sep 6, 2024

Hi Lin, the function works for one annotation. But we can/will add this feature in the next release. We will keep you posted when it's out.

Best regards, Katia and Katharina

Dear Katia and Katharina,
Thank you for your answers and look forward to the next edition.
In addition, I have another question, in theory, will the CNV assessment of the same cell change with the total number of cells included in the analysis? In other words, will the results change if epiAneufinder analyze all the cells from different samples, versus if analyze each sample individually?
Because as far as I know, inferCNV on scRNA-seq will be different because it needs to set up a reference cell set.
Best Regards,
Lin

@thek71
Copy link
Collaborator

thek71 commented Sep 6, 2024

Hi Lin,

in epiAneufinder each cell is processed independently. There is no information flow from other cells. The CNVs predicted for a cell will be the same no matter how many other cells you process with it. If you use different parameters or different reference genome, that's when you will get different results.

@sjasws
Copy link
Author

sjasws commented Sep 6, 2024

Hi Lin,

in epiAneufinder each cell is processed independently. There is no information flow from other cells. The CNVs predicted for a cell will be the same no matter how many other cells you process with it. If you use different parameters or different reference genome, that's when you will get different results.

Great, no wonder the results are so robust and accurate in my dataset!
All my questions have been answered perfectly. Thank you so much!
With Best Best Best Wishes,
Yours sincerely,
Lin

@Krithika-Bhuvan
Copy link

Krithika-Bhuvan commented Nov 29, 2024

Hello. Wanted to follow up on this. Has the multi-annotation with karyoplot been implemented already, or is that in planning stages for the next version ?

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

No branches or pull requests

4 participants