You are right Devon, I had to be more specific. So I prepared de.genes the same way as you showed me here from deseq2resoutput. Then for lengthDataI did as follow as goseq workflow suggests:
txdb <- makeTranscriptDbFromBiomart(biomart="fungal_mart", dataset="spombe_eg_gene", host="fungi.ensembl.org")
txsByGene=transcriptsBy(txdb, "gene")
lengthData=median(width(txsByGene))
May be I am wrong interpreting the source of the problem. If you need any other information please write.