First of all thanks for a very thorough answer. I appreciate that. I ran all the options you recommended on my gff3 file. It seems that there is an issue with the gff3 file that txdb object is not created properly out of it. I have compared a txdb object created from gff3 file to a txdb created from biomaRt. Below are the outputs.
> library(biomaRt)
> listMarts(host="fungi.ensembl.org")
biomart version
1 fungal_mart Fungal Mart
2 fungal_variations Fungal Variation Mart
> txdb<- makeTxDbFromBiomart(
+ ,biomart ="fungal_mart"
+ ,dataset = "spombe_eg_gene"
+ ,host="fungi.ensembl.org"
+ )
Download and preprocess the 'transcripts' data frame ... OK
Download and preprocess the 'splicings' data frame ... OK
Download and preprocess the 'genes' data frame ... OK
Prepare the 'metadata' data frame ... OK
Make the TxDb object ... OK
Warning message:
In .normarg_makeTxDb_chrominfo(chrominfo, transcripts$tx_chrom, :
chromosome lengths and circularity flags are not available for this TxDb object
> genes(txdb, columns=c("TXID", "TXNAME", "GENEID"))
GRanges object with 7014 ranges and 3 metadata columns:
seqnames ranges strand | TXID TXNAME GENEID
<Rle> <IRanges> <Rle> | <IntegerList> <CharacterList> <CharacterList>
SPAC1002.01 I [1798347, 1799015] + | 508 SPAC1002.01.1 SPAC1002.01
SPAC1002.02 I [1799061, 1800053] + | 509 SPAC1002.02.1 SPAC1002.02
SPAC1002.03c I [1799915, 1803141] - | 2073 SPAC1002.03c.1 SPAC1002.03c
SPAC1002.04c I [1803624, 1804491] - | 2074 SPAC1002.04c.1 SPAC1002.04c
SPAC1002.05c I [1804548, 1806797] - | 2075 SPAC1002.05c.1 SPAC1002.05c
... ... ... ... ... ... ... ...
SPSNRNA.03 I [ 987570, 987825] - | 1851 SPSNRNA.03.1 SPSNRNA.03
SPSNRNA.04 II [ 467233, 467361] - | 4595 SPSNRNA.04.1 SPSNRNA.04
SPSNRNA.05 II [3236867, 3236986] + | 4106 SPSNRNA.05.1 SPSNRNA.05
SPSNRNA.06 I [2562276, 2562427] - | 2305 SPSNRNA.06.1 SPSNRNA.06
SPSNRNA.07 II [3958832, 3959086] - | 5528 SPSNRNA.07.1 SPSNRNA.07
-------
seqinfo: 6 sequences from an unspecified genome; no seqlengths
> length(transcripts(txdb))
[1] 7015
> length(transcriptsBy(txdb, "gene"))
[1] 7014
As you can see TXNAME and GENEIDs are what I expect and they are not gene names.
Also, the length of transcripts is only 1 more than transcriptsBy.
Continue below: