Skip to main content

Draw an ideogram of either HG38 or CHM13 contigs in a matplotlib axes object.

Project description

pyryotype

PyPI - Version PyPI - Python Version


Table of Contents

Installation

    pip install ideogram

Example usage

from pyryotype import GENOME, plot_ideogram
from matplotlib import pyplot as plt
fig, axes = plt.subplots(
    ncols=1,
    nrows=22,
    figsize=(11, 11),
    facecolor="white",
)
genome = GENOME.CHM13
for ax, contig_name in zip(axes, range(1, 23)):
    chromosome = f"chr{contig_name}"
    plot_ideogram(ax, target=chromosome, genome=genome)
fig.savefig("ideogram.png", dpi=300)

Will output: Example ideogram

Coverage plotting is designed to be used with the output of Mosdepth. The following example uses the output of mosdepth to plot the coverage of the first 10Mb of chromosome 1 of the CHM13 genome.

from pyryotype import GENOME, plot_coverage
from matplotlib import pyplot as plt
fig, ax = plt.subplots(
    figsize=(11, 2),
    facecolor="white",
)
plot_coverage(
    ax,
    "HG01280.regions.bed.gz",
    target="chr1",
    start=0,
    end=10000000,
)
fig.savefig("coverage.png", dpi=300)

License

pyryotype is distributed under the terms of the MIT license.

Cytoband data

  • HG38 - Nushell, will have to be adapted for bash curl -L "https://hgdownload.cse.ucsc.edu/goldenpath/hg38/database/cytoBand.txt.gz" | gzip -d - | rg -Ne "^chr\\d+\t" | save cytoBand_HG38.tsv
  • CHM13 - bash yay curl -L http://t2t.gi.ucsc.edu/chm13/hub/t2t-chm13-v2.0/download/chm13v2.0_cytobands_allchrs.bed.gz | gzip -d - > cytobands_chm13.bed

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyryotype-0.0.5.tar.gz (484.2 kB view hashes)

Uploaded Source

Built Distribution

pyryotype-0.0.5-py3-none-any.whl (30.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page