schneebergerlab / plotsr

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

Errors when using plotsr with more than 10 genomes #9

Closed Chenglin20170390 closed 2 years ago

Chenglin20170390 commented 2 years ago

HI Manish,

Many thanks for your kind reply. I can use plotsr to draw a figure no more than 10 genomes. If more than 10 genomes, it will occur errors like below.

Traceback (most recent call last):
  File "/home/chenglin/softwares/plotsr/bin/plotsr", line 6, in <module>
    main(sys.argv[1:])
  File "/home/chenglin/softwares/miniconda3/envs/py39/lib/python3.9/site-packages/plotsr/main.py", line 54, in main
    plotsr(args)
  File "/home/chenglin/softwares/miniconda3/envs/py39/lib/python3.9/site-packages/plotsr/plotsr.py", line 161, in plotsr
    chrlengths, genomes = validalign2fasta(alignments, args.genomes.name)
  File "/home/chenglin/softwares/miniconda3/envs/py39/lib/python3.9/site-packages/plotsr/func.py", line 775, in validalign2fasta
    CHRCOLS = [j for i in range(int(count/2)) for j in [CHRCOLS[i]] + [CHRCOLS[int(i +count/2)]]] + [m]
UnboundLocalError: local variable 'm' referenced before assignment
mnshgl0110 commented 2 years ago

Hi Lin,

It should be fixed with https://github.com/schneebergerlab/plotsr/commit/6c4dbc9c250bd63f7f3eb4ee321209e2ccb0afac

Please update using:

git clone https://github.com/schneebergerlab/plotsr.git
cd plotsr
python setup.py install

Let me know if there are more issue.

Best Manish

Chenglin20170390 commented 2 years ago

Thanks ! it's solved perfectly.

Chenglin20170390 commented 2 years ago

Hi Manish,

Another question about 10+ genomes, I just checked the figure. Unable to clearly distinguish structural variants in plotsr output although it works for 10+ genomes.

image
mnshgl0110 commented 2 years ago

You can decrease the line width of the genome using the 'lw' tag in the genomes.txt file. Also, I think increasing the height of the plot would help in better visualising the differences.

Chenglin20170390 commented 2 years ago

Thanks