tanghaibao / jcvi

Python library to facilitate genome assembly, annotation, and comparative genomics
BSD 2-Clause "Simplified" License
761 stars 186 forks source link

Change color of inversions #714

Closed alexzaccaron closed 1 month ago

alexzaccaron commented 1 month ago

Hello,

I am generating a synteny plot using

python -m jcvi.graphics.karyotype --figsize=10x13 --chrstyle=rect seqids layout

It works really well. The chromosomes I am plotting have many inversions, which I would like to highlight somehow. Is there a way to change the color of the syntenic wedges that are inversions? Also, just a small detail, but is there a way to ommit the chomosome labels?

Thank you for this nice tool

jcvi_inversions
tanghaibao commented 1 month ago

@alexzaccaron

The blocks can be generally colored following the tutorial ("What if we want to highlight a specific block?"): https://github.com/tanghaibao/jcvi/wiki/MCscan-(Python-version)

However, there is no support to automatically color inversions at this point. It's not hard, but it needs some coding.

The chromosome labels can be removed with this option:

  --nocircles           Do not plot chromosome circles [default: False]

Haibao

alexzaccaron commented 1 month ago

Hi Haibao,

Thank you for your reply. Instead of trying to change the code, I changed the anchor files to add color to the inversions, based on the tutorial you mentioned.

for SIMPLE in *anchors.simple; do 
   sed -i '/-$/ s/^/g*/g' $SIMPLE; 
done

My apologies, I missed the --nocircles option in the help page to hide the chr labels.

The resulting plot is what I wanted. Thank you

jcvi_inversions_color