This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to see into a txdb object?

Hi,

I make txdb as below. I would like to see what is inside this object and to know what information do I have. How can I do it? head() gives an error.

> txdb <- makeTranscriptDbFromBiomart(biomart="fungal_mart", dataset="spombe_eg_gene", host="fungi.ensembl.org")\
> head(txdb)
Error in x[seq_len(n)] : object of type 'S4' is not subsettable
txdb

1 answer

Just typing txdb will give you basic information about the object. A TranscriptDb is essentially a database, so there's no simple way to see what's in it, since that has no meaning. If you want to see what sorts of things you can select from it, then columns(txdb) is pretty informative. If you're familiar with SQL, you can treat it as an SQL database and select(txdb, keys=some_vector, columns=...). Aside from that, you likely just want the standard functions like transcript(), exon() and so on.

Edit: BTW, if you really want to see everything, then select(txdb, columns=columns(txdb), keys=keys(txdb), keytype=c("GENEID")) should do it.

Log in to answer this question.