Entering edit mode
Ruichao.Zeng
▴
20
@ruichaozeng-20736
Last seen 5.2 years ago
Hi all, I just wish to construct a subset of TxDb object based on the TxDb.Hsapiens.UCSC.hg38.knownGene and my special genes. Thus, does anyone know how to do it?
Many thanks
What exactly are you trying to do? Can you not subset the output of the TxDb rather than trying to subset the TxDb itself?
For example, I have a target genes list, so I only want to construct a subset of TxDb for those target genes list rather than apply the entire TxDb.Hsapiens.UCSC.hg38.knownGene for the following analysis. Specifically, filtering the target genes corresponding information from TxDb.Hsapiens.UCSC.hg38.knownGene and then generate a new subset of TxDb.
That doesn't tell me anything more than your original post. I understand you want a subset, but not why, or how you plan on using it and why it's not just as easy or easier to extract everything and then subset after the fact.
If I just want a set of genes, it's easy enough to subset a GRanges or GRangesList
Is that not simpler than going through all the work to get a subsetted TxDb?
Apology for my poor description. Specifically, I try to apply annotatePeak function from ChIPseeker package to call peaks. Then, this function requires a TxDb argument that should be exactly TxDb object. Apparently, the TxDb.Hsapiens.UCSC.hg38.knownGene meets this. However, due to I just have a small list of special genes, so I wish to construct a subset of TxDb object based on the TxDb.Hsapiens.UCSC.hg38.knownGene and my target gene, and then run the annotatePeak function, which can save much more time compared to apply the entire TxDb.Hsapiens.UCSC.hg38.knownGene. Hope this can help you understand what I exactly wish to do.
You won't save any time by doing that. It will take way more time to generate the subsetted TxDb package than it would take to simply run
annotatePeak
on the whole thing, even if you have to runannotatePeak
multiple times. Don't try to save pennies by spending dollars.