ChromosomeIdeogram
A python package for drawing genome-wide data on ideograms.
Install
pip install chromosome-ideogram --upgrade
Usage example
import matplotlib.pyplot as plt
from matplotlib import gridspec
from chromosome_ideogram import ChromosomeIdeogram
plt.rcParams['font.size'] = 12
plt.rcParams['pdf.fonttype'] = 42
fig = plt.figure(figsize=(18, 15))
gs = gridspec.GridSpec(nrows=12, ncols=4)
axes1 = fig.add_subplot(gs[:10, :])
axes2 = fig.add_subplot(gs[10:, :3]) # Used to display the detailed karyotype of a certain chromosome (such as chromosome 14)
ci1 = ChromosomeIdeogram(
karyotype='example/karyotype.xls',
radius=0.4, # Radius of chromosome
space=4 # Chromosome center coordinate interval (radius x space)
)
ci1.draw_chromh(axes=axes1, centromere_angle=60, facecolor='lightgrey', edgecolor=None, linewidth=0)
ci1.annotations(axes=axes1, annotations='example/satellite_DNA.bed', height=None)
# show rDNA
ci1.mark_loci(axes=axes1, markers='example/hapA_rDNA.bed', pos='bottom', size=None) # Draw the rDNA beneath haplotype A chromosomes
ci1.mark_loci(axes=axes1, markers='example/hapB_rDNA.bed', pos='top', size=None) # Draw the rDNA above haplotype B chromosomes
# Create a second karyotype ideogram object (containing only chromosome 14)
ci2 = ChromosomeIdeogram(
karyotype='example/Chr14_karyotype.xls',
radius=0.4,
space=3
)
ci2.draw_chromh(axes=axes2, centromere_angle=60, facecolor='white', edgecolor='#4d4d4d', linewidth=1)
ci2.annotations(axes=axes2, annotations='example/satellite_DNA.bed', height=None)
ci2.mark_loci(axes=axes2, markers='example/hapA_rDNA.bed', pos='bottom', size=None)
ci2.mark_loci(axes=axes2, markers='example/hapB_rDNA.bed', pos='top', size=None)
ci2.draw_synteny(axes=axes2, synteny_file='example/Chr14_SV.bed') # show synteny
axes1.legend(handles=ci1.handles, loc=(0.85, 0.85)) # Set axes1 legend
axes2.legend(handles=ci2.handles, loc=(1.05, 0.1), ncol=2) # You can also set axes2 legend
plt.subplots_adjust(hspace=9) # Adjust the vertical distance between the two subgraphs
plt.savefig('example/satellite_DNA.pdf', bbox_inches='tight')
plt.savefig('example/satellite_DNA.png', bbox_inches='tight')
Metadata
Release files for chromosome-ideogram 0.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| chromosome_ideogram-0.0.6.tar.gz | 6.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| chromosome_ideogram-0.0.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.4 kB
Release files / chromosome_ideogram-0.0.6.tar.gz
| Download URL | chromosome_ideogram-0.0.6.tar.gz |
|---|---|
| Size | 6.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
021f713ec5f207663f5547a6daf3b26886e180431c5923812d416833aeb1c451
|
|
BLAKE2b-256 checksum How to use checksums |
3a352be58e12d61c8b035521af1606774bd0672af18ed087d8aa3d2c1d3b266f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.8.20
|
Release files / chromosome_ideogram-0.0.6-py3-none-any.whl
| Download URL | chromosome_ideogram-0.0.6-py3-none-any.whl |
|---|---|
| Size | 7.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
aad1200f9c60f52b288709fa104815e0f39326895c50dd6e4b9f04d2473cd3ec
|
|
BLAKE2b-256 checksum How to use checksums |
a0749146bc4bd94bb48f1d1066e0fa68a6962ff4fef1d2833757f177466c8a4e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.8.20
|