quadbio / VoxHunt

VoxHunt: Resolving human brain organoid heterogeneity through single-cell genomic comparison to spatial brain maps
https://quadbio.github.io/VoxHunt/
MIT License
39 stars 5 forks source link

deconvolute doesn't work with custom_1 markers #9

Closed alievakrash closed 3 years ago

alievakrash commented 3 years ago

Hello,

I am trying deconvolution of bulk RNA-seq data based on brain structure expression patterns on my organoids. It works great when I use structures from custom_2, but when I run it on custom_1 or _3 I get the following message with the deconvolute function:

Error in intI(j, n = x@Dim[2], dn[[2]], give.dn = FALSE) : invalid character indexing

Do you know how to solve this issue?

Cheers, Maria

joschif commented 3 years ago

Hi Maria,

for me the function works as expected. Can you maybe provide me with the full function call and the version of VoxHunt you are running?

Best, Jonas

alievakrash commented 3 years ago

Hi Jonas,

I am using R version 4.0.5 and voxhunt_0.9.2. Indeed I tried it with the example_pseudobulk dataset and it works, but not with mine... I tried to convert it to a sparsematrix but doesn;t work. Here is the code that I use and attached en example of my dataset. The counts are random, just the genes are the ones that I have in my dataset (https://we.tl/t-Jhdza3SN67).

library(voxhunt) library(tidyverse) library(RColorBrewer) library(DESeq2) library(reshape2)

load the test dataset

test<-readRDS("test_dataset.rds")

load_aba_data('

voxhunt_data')

markers <- structure_markers('E11', annotation_level = 'custom_1') %>% filter(gene%in%rownames(test))

involve_regions <- unique(markers$group)

top15 <- markers %>% filter(group%in%involve_regions) %>% group_by(group) %>% top_n(15, auc) %>% {unique(.$gene)}

top50 <- markers %>% filter(group%in%involve_regions) %>% group_by(group) %>% top_n(50, auc) %>% {unique(.$gene)}

prop_df_Age7 <- deconvolute( test[top50, ], top15, involve_regions = involve_regions, pseudo_tpm = T )

I get this error with custom_1 or custom_3

Error in intI(j, n = x@Dim[2], dn[[2]], give.dn = FALSE) : invalid character indexing

Cheers,

Maria

joschif commented 3 years ago

Hi Maria, thanks for the very detailed description and sorry for the late reply. It seems to me like in the above code, involve_region contains the custom_1 annotation, but the default in deconvolute() is custom_2. If you tell deconvolute() to use custom_1 by setting the argument annotation_level it should work. E.g for me the following works:

prop_df_Age7 <- deconvolute(
    test_case[top50, ], top15,
    annotation_level = 'custom_1',
    involve_regions = involve_regions,
    pseudo_tpm = T
)

Alternatively you can also omit the involve_regions argument and all regions will be used per default:

prop_df_Age7 <- deconvolute(
    test_case[top50, ], top15,
    pseudo_tpm = T
)

Hope this works for you, let me know :)

Cheers, Jonas

alievakrash commented 3 years ago

Hey Jonas,

Thanks for checking it. Your solution worked, but only with custom_1, not custom_3... I wasalso wondering: I want to implement this on another dataset. I was wondering how feasable it is. What format should I provide this sRNA seq dataset?

Cheers,

Maria

El mié., 12 may. 2021 17:48, jonas @.***> escribió:

Hi Maria, thanks for the very detailed description and sorry for the late reply. It seems to me like in the above code, involve_region contains the custom_1 annotation, but the default in deconvolute() is custom_2. If you tell deconvolute() to use custom_1 by setting the argument annotation_level it should work. E.g for me the following works:

prop_df_Age7 <- deconvolute( test_case[top50, ], top15, annotation_level = 'custom_1', involve_regions = involve_regions, pseudo_tpm = T )

Alternatively you can also omit the involve_regions argument and all regions will be used per default:

prop_df_Age7 <- deconvolute( test_case[top50, ], top15, pseudo_tpm = T )

Hope this works for you, let me know :)

Cheers, Jonas

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/quadbiolab/VoxHunt/issues/9#issuecomment-839880978, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQN3NZPRGBX3N3GYUF27UF3TNKPLPANCNFSM44CLN52A .

joschif commented 3 years ago

Hi Maria,

for me any annotation level works. Maybe check if you are using the correct regions in involve_regions or just omit the argument entirely so that all regions are considered.

Cheers, Jonas

joschif commented 3 years ago

I wasalso wondering: I want to implement this on another dataset. I was wondering how feasable it is. What format should I provide this sRNA seq dataset?

If you want to use another scRNAseq dataset as the reference, it might be better to directly use a dedicated deconvolution tool like CIBERSORT or EPIC, which the deconvolution in VoxHunt is based on.

alievakrash commented 3 years ago

Thanks!

El dom, 16 may 2021 a las 20:25, jonas @.***>) escribió:

I wasalso wondering: I want to implement this on another dataset. I was wondering how feasable it is. What format should I provide this sRNA seq dataset?

If you want to use another scRNAseq dataset as the reference, it might be better to directly use a dedicated deconvolution tool like CIBERSORT https://cibersortx.stanford.edu/ or EPIC https://github.com/GfellerLab/EPIC, which the deconvolution in VoxHunt is based on.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/quadbiolab/VoxHunt/issues/9#issuecomment-841856439, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQN3NZJQBI4T4DKDBCOIHHDTOAE3FANCNFSM44CLN52A .

--

Maria Alieva, PhD

Senior Postdoctoral researcher, Rios group

Princess Máxima Center for Pediatric Oncology|