jcvi icon indicating copy to clipboard operation
jcvi copied to clipboard

microsynteny plot mixed genes from different species with the same chr name

Open obenno opened this issue 3 years ago • 1 comments

Hi,

Thanks a lot for the wonderful tools!

I've been using mcscan pipeline to annotate homolog genes between wild (Glycine soja) and cultivated soybean (Glycine max) with their reference data from phytozome. The two species have common chromosome naming convenstion (Chr01, Chr02 etc.) but different gene naming convension (Glyma.01G000100 vs Glysoja.01G000001). I found the script for drawing micro synteny will mix genes from two species if they have the same chromosome name. Please find a minmum working example below:

command:

python -m jcvi.graphics.synteny t.blocks t.bed blocks.layout --genelabelsize 6 --notex

t.blocks:

Glyma.01G000100	Glysoja.01G000001
Glyma.01G000200	Glysoja.01G000002
Glyma.01G000300	Glysoja.01G000002
Glyma.01G000400	Glysoja.01G000003
Glyma.01G000500	.
Glyma.01G000600	Glysoja.01G000006
Glyma.01G000700	Glysoja.01G000008
Glyma.01G000800	.
Glyma.01G000900	Glysoja.01G000009

t.bed:

Chr01	27354	28320	Glyma.01G000100	0	-
Chr01	58974	67527	Glyma.01G000200	0	-
Chr01	67769	69968	Glyma.01G000300	0	+
Chr01	90151	95947	Glyma.01G000400	0	-
Chr01	90288	91197	Glyma.01G000500	0	+
Chr01	116093	127845	Glyma.01G000600	0	+
Chr01	143466	155573	Glyma.01G000700	0	+
Chr01	157029	157772	Glyma.01G000800	0	+
Chr01	170533	193342	Glyma.01G000900	0	+
Chr01	60338	60901	Glysoja.01G000001	0	-
Chr01	85575	109136	Glysoja.01G000002	0	-
Chr01	125657	131500	Glysoja.01G000003	0	-
Chr01	163230	174916	Glysoja.01G000006	0	+
Chr01	190547	202648	Glysoja.01G000008	1034	+
Chr01	209104	234267	Glysoja.01G000009	0	+

t.pdf: image

While after renaming the chromosome names, it was corrected. t.renamed.bed:

Gmax01	27354	28320	Glyma.01G000100	0	-
Gmax01	58974	67527	Glyma.01G000200	0	-
Gmax01	67769	69968	Glyma.01G000300	0	+
Gmax01	90151	95947	Glyma.01G000400	0	-
Gmax01	90288	91197	Glyma.01G000500	0	+
Gmax01	116093	127845	Glyma.01G000600	0	+
Gmax01	143466	155573	Glyma.01G000700	0	+
Gmax01	157029	157772	Glyma.01G000800	0	+
Gmax01	170533	193342	Glyma.01G000900	0	+
Gsoja01	60338	60901	Glysoja.01G000001	0	-
Gsoja01	85575	109136	Glysoja.01G000002	0	-
Gsoja01	125657	131500	Glysoja.01G000003	0	-
Gsoja01	163230	174916	Glysoja.01G000006	0	+
Gsoja01	190547	202648	Glysoja.01G000008	1034	+
Gsoja01	209104	234267	Glysoja.01G000009	0	+

t.pdf: image

blocks.layout:

# x,   y, rotation,   ha,     va,   color, ratio,            label
0.5, 0.6,        0, left, center,       m,     1,       Gmax Chr01
0.5, 0.4,        0, left, center, #fc8d62,     1,      Gsoja Chr01
# edges
e, 0, 1

Thanks, obenno

obenno avatar Jun 09 '21 08:06 obenno

@obenno

thanks for reporting this. yes, you have essentially found the fix for this issue (conflicting chromosome name).

tanghaibao avatar Jun 10 '21 03:06 tanghaibao