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

Associate annotation information - bg_ids NULL #57

Open
Macdot3 opened this issue Jan 25, 2024 · 2 comments
Open

Associate annotation information - bg_ids NULL #57

Macdot3 opened this issue Jan 25, 2024 · 2 comments

Comments

@Macdot3
Copy link

Macdot3 commented Jan 25, 2024

Hi Federico, thanks for your app which can really make my work a lot easier!
For the first time I am approaching RNAseq data analysis and I am adapting my data to the documentation workflow. Once I get to the re_enrich part, when I create bg_ids it returns me a NULL value. How can I solve this problem?
I tried adding the annotation to the dds object but I get no results. I'll write to you below my code.

colData <- read.table('DATI_GeneTonic/samples_table.txt', sep='\t', row.names = 1,header = T)
files <- file.path('DATI_GeneTonic', colData$seqname_quant, "quant.sf")
names(files) <- rownames(colData)
tx2gene <- readRDS("DATI_GeneTonic/tx2gene.gencode.v38.annotation.RDS")
head(tx2gene)

txi <- tximport(files, type="salmon", tx2gene=tx2gene)
ddsTxi <- DESeqDataSetFromTximport(txi,
colData = colData,
design = ~kit+condition)
dds <- ddsTxi
dds$symbol <- mapIds(org.Hs.eg.db,
keys=gene_ids,
column="SYMBOL",
keytype="ENSEMBL")
rownames(dds) <- substr(rownames(dds), 1, 15)
keep <- rowSums(counts(dds)) > 0
dds <- dds[keep,]
dds <- DESeq(dds)
res_control_mutant <- results(dds, contrast = c("condition", "control", "mutant"), lfcThreshold = 1, alpha = 0.05)
res_control_mutant$symbol <- mapIds(org.Hs.eg.db,
keys=ens.str,
column="SYMBOL",
keytype="ENSEMBL",
multiVals="first")
de_symbols_control_mutant <- deseqresult2df(res_control_mutant, FDR = 0.05)$symbol

bg_ids <- rowData(dds)$symbol[rowSums(counts(dds)) > 0]
NULL

Thanks
Marco

@federicomarini
Copy link
Owner

Hi Marco,
this is a bit odd.
Can you check a bit more the content of your dds object?
For example, what is the printout of

dds
rowData(dds)

The important part is to select the background properly, and you are on the right way to do so.
Feel free to reach out via email if you need more support, although this is not strictly related to GeneTonic itself.
Federico

@Macdot3
Copy link
Author

Macdot3 commented Feb 12, 2024

This is my printout:

> dds
class: DESeqDataSet 
dim: 60230 18 
metadata(1): version
assays(2): counts avgTxLength
rownames(60230): ENSG00000000003.15 ENSG00000000005.6 ... ENSG00000288724.1 ENSG00000288725.1
rowData names(0):
colnames(18): FB_bruda_ckt_10x FB_bruda_ckt_1x ... FB_zamac_ckt_1x FB_zamac_nt
colData names(10): seqname name ... subtype seqname_quant
> rowData(dds)
DataFrame with 60230 rows and 0 columns

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

2 participants