<jupyter_start><jupyter_text>Tutorial for pileup widgetThis tutorial demonstrates how to use the [pileup.js](https://github.com/hammerlab/pileup.js) widget in a Jupyter notebook.<jupyter_code># imports 
from bdgenomics.mango.io import read_bed, read_vcf
import bdgenomics.mango.pileup as pileup
from bdgenomics.mango.pileup.track import *
import modin.pandas as pd<jupyter_output><empty_output><jupyter_text>Pileup ExampleThis example shows how to visualize alignments through a Jupyter widget.<jupyter_code># read in JSON
readsJson = pd.read_json(alignmentJsonFile)
GA4GHAlignmentJson = readsJson.to_json()
# make pileup track

tracks=[Track(viz="pileup", label="my Reads", source=pileup.sources.GA4GHAlignmentJson(GA4GHAlignmentJson))]

# render tracks in widget
reads = pileup.PileupViewer(chrom="chr17",start=1,stop=100, reference="hg19", tracks=tracks)
reads

reads.zoomOut()<jupyter_output><empty_output><jupyter_text>Variant ExampleThis example shows how to visualize variants through a Jupyter widget.<jupyter_code>variantData = read_vcf(vcfFile)
variantData.head()
# make variant track
tracks=[Track(viz="variants", label="my Variants", source=pileup.sources.DataFrameSource(variantData))]

# render tracks in widget
variants = pileup.PileupViewer(chrom="chr22",start=21079589,stop=21079647, reference="hg19", tracks=tracks)
variants<jupyter_output><empty_output><jupyter_text>Feature ExampleThis example shows how to visualize features through a Jupyter widget.<jupyter_code>featuresData = read_bed(bedFile)
featuresData.head()
# make feature track
from ipywidgets import Layout
tracks=[Track(viz="features", label="my features", source=pileup.sources.DataFrameSource(featuresData))]

features = pileup.PileupViewer(chrom="chr17",start=167398,stop=461054, reference="hg19",
                               tracks=tracks)
features<jupyter_output><empty_output><jupyter_text>Genotype ExampleThis example shows how to visualize genotypes through a Jupyter widget.<jupyter_code># make genotype track
tracks=[Track(viz="genotypes", label="my Genotypes", source=pileup.sources.DataFrameSource(variantData))]

# render tracks in widget
genotypes = pileup.PileupViewer(chrom="chr22",start=21340030,stop=21340150, reference="hg19", tracks=tracks)
genotypes<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10542432195975503, 'fraction_numerical': 0.02930883639545057, 'mean_word_length': 8.411522633744855, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '346008', 'license': 'ECL-2.0', 'n_tokens_mistral': 822, 'n_tokens_neox': 733, 'n_words': 153, 'path': 'mango-pileup/examples/pileup-tutorial.ipynb', 'repo_name': 'heuermh/mango', 'size': '2286'}