Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
tanghaibao committed Jan 24, 2025
1 parent cb436b4 commit ab4b9e2
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions src/jcvi/projects/sugarcane.py
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,8 @@ def chromosome(args):
%prog chromosome [2n+n_FDR|2n+n_SDR|nx2+n]
"""
p = OptionParser(simulate.__doc__)
_, args, iopts = p.set_image_options(args, figsize="6x6")
p.add_argument("-k", default=0, type=int, help="Plot k-th simulated genomes")
opts, args, iopts = p.set_image_options(args, figsize="6x6")
if len(args) != 1:
sys.exit(not p.print_help())

Expand All @@ -1024,7 +1025,9 @@ def chromosome(args):
for cross in CROSSES:
filename = op.join(indir, f"all_{cross}")
with open(filename, encoding="utf-8") as fp:
for row in fp:
for i, row in enumerate(fp):
if i != opts.k:
continue
genome = Genome.from_str(row)
break
genomes.append((cross, genome))
Expand Down Expand Up @@ -1068,6 +1071,23 @@ def chromosome(args):
root.text(
0.5, yy - chrom_height / 2, r"$\times$", ha="center", va="center", fontsize=36
)
# Genome labels
root.text(
0.215,
yy - chrom_height / 2,
markup("*So*\n(8x)"),
ha="center",
va="center",
color=SoColor,
)
root.text(
0.945,
yy - chrom_height / 2,
markup("*Ss*\n(16x)"),
ha="center",
va="center",
color=SsColor,
)

for _, genome in genomes:
yy -= yinterval
Expand Down

0 comments on commit ab4b9e2

Please sign in to comment.