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

add_to_seurat empty output #374

Open
igordot opened this issue Oct 29, 2021 · 9 comments
Open

add_to_seurat empty output #374

igordot opened this issue Oct 29, 2021 · 9 comments

Comments

@igordot
Copy link

igordot commented Oct 29, 2021

I ran infercnv::add_to_seurat on multiple objects. Based on all the plots, there are clear CNVs. I did not provide a Seurat object, so map_metadata_from_infercnv.txt was generated. The table has the expected number of rows and the correct row names, so it seems to be reading the data. However, all of the values in map_metadata_from_infercnv.txt are 0s. What does this mean?

@GeorgescuC
Copy link
Collaborator

Hi @igordot ,

Which version of infercnv are you using?
Have you checked that the CNVs are still predicted after filtering by the Bayesian Network? If those results are present, they are used over the "raw" HMM output, so if the Bayesian filtering threshold is too stringent, you may not have any CNVs left. On which figure do you see the CNV signal?

Regards,
Christophe.

@igordot
Copy link
Author

igordot commented Nov 29, 2021

I am using the latest Bioconductor version 1.8.1 (although it looks like it recently got upgraded to 1.10.1).

Where do I check that "the CNVs are still predicted after filtering by the Bayesian Network"?

I see the CNV signal in all the plots, specifically steps 17 and 20, as well as the final. I am including them here.
infercnv 17_HMM_predHMMi3 leiden hmm_mode-subclusters
infercnv 20_HMM_predHMMi3 leiden hmm_mode-subclusters Pnorm_0 5 repr_intensities
infercnv

@GeorgescuC
Copy link
Collaborator

Hi @igordot ,

Sorry for missing your later post. Step 18 is running the Bayesian Network, and step 19 is applying the filter based on the BayesMaxPNormal threshold. So if those 2 steps have run, then results from steps 19 and 20 will be filtered results.
Step 20 alone will still be run when only the HMM is run and no filtering is applied.

Regards,
Christophe.

@igordot
Copy link
Author

igordot commented Jun 30, 2022

Thank you for clarifying. I am not sure if this answers my initial question. All of the values in map_metadata_from_infercnv.txt are 0s. That still does not make sense to me since it does not seem to agree with the plots.

@GeorgescuC
Copy link
Collaborator

Hi @igordot ,

Could you privately share the outputs of your run so I can inspect them and try to debug?

Regards,
Christophe.

@GeorgescuC GeorgescuC reopened this Jun 30, 2022
@antara-biswas
Copy link

Hi, I am running into same issue-infercnv ran great, got good cnv heatmap but all values in map_metadata_from_infercnv.txt are 0s. Can you please help troubleshoot this. Thanks

@igordot
Copy link
Author

igordot commented Jul 1, 2022

Here is the output, including the final inferCNV object:
https://www.dropbox.com/s/wj83nj2yqi3c4a8/infercnv.zip?dl=0
This may not be the output from the same exact run, but it's the same sample and I can't see the differences by eye.

Thank you for taking a look.

@GeorgescuC
Copy link
Collaborator

Hi @igordot , @antara-biswas

Thank you for sharing your files. I got around to debugging your issue, and it is actually something that has already been fixed for new runs in 01f60de , but it appears you run was done before that. A workaround so you don't have to rerun this dataset is to rename the run.final.infercnv_obj to run.final.infercnv_obj.original, then run this small piece of R code from the output folder:

library(infercnv)

infercnv_obj = readRDS("run.final.infercnv_obj.original")

for (i in names(infercnv_obj@tumor_subclusters$subclusters)) {
    for (j in names(infercnv_obj@tumor_subclusters$subclusters[[i]])) {
        names(infercnv_obj@tumor_subclusters$subclusters[[i]][[j]]) = colnames([email protected][, infercnv_obj@tumor_subclusters$subclusters[[i]][[j]], drop=FALSE])
    }
}

saveRDS(infercnv_obj, "run.final.infercnv_obj")

add_to_seurat(infercnv_output_path = "./")

Regards,
Christophe.

@antara-biswas
Copy link

Thank you so much for the code, it worked!

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

3 participants