schneebergerlab / plotsr

Tool to plot synteny and structural rearrangements between genomes
MIT License
283 stars 28 forks source link

[question] how to add a gene track as displayed in the 'introduction'? #23

Closed JWDebler closed 5 months ago

JWDebler commented 2 years ago

Hi, I'd like to add a 'Gene' track the way it is displayed in the Introduction section:

image

But I can't figure out what tags in the 'tracks.txt' file to use to make it look like that. I can only get it to look like the 'SNP' track. Cheers

mnshgl0110 commented 2 years ago

Hi Johannes, you have to use ft:gff and a GFF file to plot genes. Please check the example track file. Best Manish

JWDebler commented 2 years ago

How exactly does plotsr expect a gff file to be formated like? I converted mine into a bed file as I would just get gff parsing errors.

track - WARNING - Reading GFF file AlKewell_EC_fixed_CDS_added_NCBI-ready.gff3. Overlapping transcripts would be plotted as such without any filtering.
Traceback (most recent call last):
  File "/home/ubuntu/miniconda3/envs/plotsr/bin/plotsr", line 6, in <module>
    main(sys.argv[1:])
  File "/home/ubuntu/miniconda3/envs/plotsr/lib/python3.10/site-packages/plotsr/main.py", line 55, in main
    plotsr(args)
  File "/home/ubuntu/miniconda3/envs/plotsr/lib/python3.10/site-packages/plotsr/plotsr.py", line 257, in plotsr
    tracks = readtrack(TRACKS, chrlengths)
  File "/home/ubuntu/miniconda3/envs/plotsr/lib/python3.10/site-packages/plotsr/func.py", line 732, in readtrack
    t.readdata(chrlengths)
  File "/home/ubuntu/miniconda3/envs/plotsr/lib/python3.10/site-packages/plotsr/func.py", line 702, in readdata
    self._readgff(chrlengths)
  File "/home/ubuntu/miniconda3/envs/plotsr/lib/python3.10/site-packages/plotsr/func.py", line 657, in _readgff
    if line[0] not in chrs:
IndexError: list index out of range
mnshgl0110 commented 2 years ago

There is an example gff file (and other example data) here. Are there empty lines in the GFF? They would result in this error. Removing them should fix it.

JWDebler commented 2 years ago

Hi, I found the problem. There was an empty line as the last line in my gff3. That took some time to pick up :-)