This is a test version of Biostars. For the public version, visit https://www.biostars.org.
how to exclude set of genes from a txdb

Hi All,

How can I exclude single gene or a list of genes from a txdb object. I have a txdb from hg38 build and I want to exclude single transcript ""uc021wui.2". I can select this transcript using select function from genomic features package. however I do not know how to exclude it from the TxDb object.

library("TxDb.Hsapiens.UCSC.hg38.knownGene") library("org.Hs.eg.db") library("GenomicFeatures") txdb<-(TxDb.Hsapiens.UCSC.hg38.knownGene,miRBaseBuild= "GRCh37.p5") target<-"uc021wui.2" select(txdb,keys=target,keytype = "TXNAME",columns =cols )

Thanks Tarek

txdb

what have you tried so far? How did you obtain the txdb object?

Hi,

Thanks for the reply I have a txdb from hg38 build and I want to exclude single transcript ""uc021wui.2". I can select this transcript using select function from genomic features package. however I do not know how to exclude it from the TxDb object.

>library("TxDb.Hsapiens.UCSC.hg38.knownGene")
>library("org.Hs.eg.db")
>library("GenomicFeatures")
>txdb<-(TxDb.Hsapiens.UCSC.hg38.knownGene,miRBaseBuild= "GRCh37.p5")
>target<-"uc021wui.2"
>select(txdb,keys=target,keytype = "TXNAME",columns =cols )

Move this comment to question please. Also add an EDIT tag so that users will know that it was added after the Q was published

1 answer

As far as I know, you can select the feature as you have noticed, but can't remove it directly from TxDb. Your options are 1) to create a new TxDb if you need it frequently
https://bioconductor.org/packages/devel/bioc/vignettes/GenomicFeatures/inst/doc/GenomicFeatures.pdf

OR, 2) Just remove that particular gene from the downstream analysis. Where and for what you are using the TxDb downstream?

Hi Santosh I am analyzing Chip-seq data, and I am using "chipseeker" package to annotate peaks. For peaks annotation I want to exclude all micro-RNA. I checked the "chipseeker" for such funtion, but I could not find one. So I thought about excluding them from the TxDb file that I use to annotate peaks. ibrary("ChIPseeker") annotatePeak("narrowpeak_bowtie_q0.05_IgG.txt", tssRegion=c(-3000, 3000), TxDb=txdb, annoDb="org.Hs.eg.db")

Hi, I think you are missing something in this line; could you see if this is correct?

txdb<-(TxDb.Hsapiens.UCSC.hg38.knownGene,miRBaseBuild= "GRCh37.p5")

More specifically, I am not sure why "miRBaseBuild" is there and is assigned to a genomeBuild. If possible, repost the main part of the (TxDb related) code again, formatted correctly.

Note: Use the code formatting button (101010) in the markup menu. The one you are using now is for quotation.

Log in to answer this question.