PoisonAlien / trackplot

Generate IGV style locus tracks from bigWig files in R
133 stars 16 forks source link

Custom GTF #22

Closed peterpdu closed 12 months ago

peterpdu commented 12 months ago

Hi,

I'm trying to use trackplot for plotting custom genomic tracks and was wondering if you could provide an example of the minimum fields required in the GTF file or what structures are expected by the plotting function. I have tried plotting some alignments, and while I can get the bigwig tracks to load (t = track_extract(cd, loci=loci, gtf=gtffile, query_ucsc=F)) and plot (track_plot(summary_list = t)), I cannot get the GTF features to appear due this error:

Error in rect(xleft = txtbl[[1]], ybottom = tx_id - 0.75, xright = txtbl[[2]], : cannot mix zero-length and non-zero-length coordinates

The first few lines of my GTF file look like this (have taken a few liberties of calling things transcripts and genes in order for them to be plotted):

provirus    custom  transcript  1   98  .   +   .   gene_id "5_LTR"; transcript_id "R";
provirus    custom  transcript  99  181 .   +   .   gene_id "5_LTR"; transcript_id "U5";
provirus    custom  transcript  228 353 .   +   .   gene_id "psi"; transcript_id "psi";

Thanks!

PoisonAlien commented 12 months ago

Hi, Thanks for the issue. You would need exon rows as well for each transcript.

For example:

13      ensembl_havana  transcript      28577411        28674729        .       -       .       gene_id "ENSG00000122025"; transcript_id "ENST00000241453"
13      ensembl_havana  exon    28674605        28674729        .       -       .       gene_id "ENSG00000122025";  transcript_id "ENST00000241453"; exon_number "1"

Could you please share first 100 rows of your gtf?

peterpdu commented 12 months ago

Thanks! I was able to figure it out. It seems like only "exon" features are required to display the gene track.