Hi Mike,
Thank you for your reply. My counts and differential expression are both gene based and yes, indeed the specific transcripts based on biotype etc are not needed in my analysis. I simply want to annotate my dataset and add entrez IDs so I can do GSEA/KEGG which from my understanding, need enterez IDs.
In summary, I've changed my filters and now use the following:
attributeNames <- c("ensembl_gene_id", "entrezgene_id", "external_gene_name", "description", "chromosome_name", "start_position", "end_position", "strand")
ourFilterType <- "ensembl_gene_id"
filterValues <- rownames(Day4_CONvsCRE)
full_mm10_annot_Day4_CONvsCRE <- getBM(attributes = attributeNames,
filters = ourFilterType,
values = filterValues,
mart = ensembl)
I then proceeded to make a spreadsheet for those interested in this dataset, combining the differential expression analysis data and gene annotations etc:
newcolnames <- c("GeneID", "Entrez", "Symbol", "Description", "Chr", "Start", "End", "Strand")
colnames(full_mm10_annot_Day4_CONvsCRE) <- newcolnames
Day4_CONvsCRE_table <- as.data.frame(Day4_CONvsCRE) %>%
rownames_to_column("GeneID") %>%
left_join(full_mm10_annot_Day4_CONvsCRE, "GeneID") %>%
rename(log2FC = log2FoldChange, FDR = padj)
write_tsv(Day4_CONvsCRE_table, "/mnt/data/BMOHAMED/Total_RNAseq/MDM2kd_seq/all_samples/differential_expression/Day4_CONvsCRE_Annotated.txt")
However, at this point, I'm expecting my ensembl_gene_IDs to be completely unique. When I do:
dim(full_mm10_annot_Day4_CONvsCRE)
I get 21323:8. But when I do:
length(unique(full_mm10_annot_Day4_CONvsCRE$GeneID))
I was expecting to get 21323:8, but I actually get 21263:8 suggesting that there are duplicates. I think I'm getting multiple Enterez IDs for the same gene but I'm not entirely sure if that's the case. Whats the best way to filter my results? Should I concatenate multiple enterez IDs or should I just use one enterez ID per gene?