I looked at the code of makeTranscriptDbFromGFF and it imports a lot of other functions. I tried to modify it, but couldn't find the most updated code for all the functions that makeTranscriptDbFromGFF depends on. Instead of going deeper and deeper into the code, what I observed was that the function automatically picks up columns that are marked by the name gene_id
, so I modified the gtf file like this:
sed -e 's/gene/entity/g' -e 's/transcript_alias_1/gene_id/g' lncipedia_3_0.gtf > lncipedia_3_0_1.gtf
Here I have replaced every gene
with entity
and transcript_alias_1
with gene_id
, so that now it skips the original gene_id
column and looks at transcript_alias_1
column (which is now renamed as gene_id
) instead. Then you can use this new gtf file as shown in the the code below, although now you have to specify names.expr='gene_id'
:
txdblnc = makeTranscriptDbFromGFF(file = "lncipedia_3_0_1.gtf",format = "gtf")
wh = GRanges("chr10", IRanges(93525000, 93656000))
p4 = autoplot(txdblnc, wh, color = "Dark Green", fill = "Dark Green", names.expr="gene_id")
This will generate the kind of plot you want but I would advise against it. Because a lot of values that are associated with transcript_alias_1
column, in the original GTF file, are NON-ENST values, for e.g. :
chr4 lncipedia.org exon 9680180 9680546 . - . gene_id lnc-SLC2A9-6 ; transcript_id lnc-SLC2A9-6:1 ; transcript_alias_1 l_2603_chr4:9680179-9682164_kidney ;
chrY lncipedia.org exon 58883380 58883510 . + . gene_id lnc-PRYP4-3 ; transcript_id lnc-PRYP4-3:1 ; gene_alias_1 XLOC_008304 ; gene_alias_2 linc-SPRY3-3 ; transcript_alias_1 TCONS_00017658 ; transcript_alias_2 NONHSAT139812 ;
chr1 lncipedia.org exon 78217436 78217681 . + . gene_id lnc-FAM73A-1 ; transcript_id lnc-FAM73A-1:1 ; transcript_alias_1 expReg_chr1_10783_+ ;
And you should still contact the maintainer so that they can update their code for more flexibility.
You might try to contact the ggbio maintainer, either via the bioconductor support site or directly (instructions for that are shown when you load the ggbio package).