Package: pyllelic
pyllelicpyllelic: a tool for detection of allelic-specific methylation variation in bisulfite DNA sequencing files.Pyllelic documention is available athttps://paradoxdruid.github.io/pyllelic/and seepyllelic_notebook.ipynbfor a fully explored demonstration.QuickstartRun an interactive sample pyllelic environment in your web browser usingmybinder.org:pyllelic in actionDependencies and InstallationUsing Conda (preferred)Create a new conda environment using python 3.8:Easiest:# Get environment.yml file from this repocurl-Lhttps://github.com/Paradoxdruid/pyllelic/blob/master/environment.yml?raw=true>env.yml# Create and activate conda environmentcondaenvcreate--file=env.yml
condaactivatepyllelicor more explict step by step instructionscondacreate--namepyllelicpython=3.8
condaactivatepyllelic
condaconfig--env--addchannelsconda-forge
condaconfig--env--addchannelsbioconda
condaconfig--env--addchannelsparadoxdruid
condainstallpyllelic# Optional but usual use case:condainstallnotebookipywidgetsDocker containerdockerpullghcr.io/paradoxdruid/pyllelic:latestPyPi installationPyPi instructionsThis will require independent installation of samtools, bowtie2, and bismark packages.# PyPipython3-mpipinstallpyllelic# or Githubpython3-mpipinstallgit+https://github.com/Paradoxdruid/pyllelic.gitExample exploratory use in jupyter notebookSet up files:frompyllelicimportprocessfrompathlibimportPath# Retrieve promoter genomic sequence of region to analyzeprocess.retrieve_seq("tert_genome.txt",chrom="chr5",start=1293000,end=1296000)# Download a reference genome and bisulfite sequencing data# Genome data from, e.g. http://hgdownload.soe.ucsc.edu/goldenPath/hg19# Fastq data from, e.g. http://hgdownload.cse.ucsc.edu/goldenPath/hg19/encodeDCC/wgEncodeHaibMethylRrbs/genome=Path("/{your_directory}/{genome_file_directory}")fastq=Path("/{your_directory}/{your_fastq_file.fastq.gz}")# Use bismark tool to prepare bisulfite genome and align fastq to bam fileprocess.prepare_genome(genome)# can optionally give path to bowtie2 if not in PATHprocess.bismark(genome,fastq)# Sort and index the resultant bam filebamfile=Path("/{your_directory}/{bam_filename}.bam")process.sort_bam(bamfile)process.index_bam(bamfile.parent/f"{bamfile.stem}_sorted.bam")Run pyllelic:frompyllelicimportpyllelicconfig=pyllelic.configure(# Specify file and directory locationsbase_path="/home/jovyan/assets/",prom_file="tert_genome.txt",prom_start=1293200,prom_end=1296000,chrom="5",offset=1293000,# start position of retrieved promoter sequence# viz_backend="plotly",# fname_pattern=r"^[a-zA-Z]+_([a-zA-Z0-9]+)_.+bam$",# test_dir="test",# results_dir="results",)files_set=pyllelic.make_list_of_bam_files(config)# finds bam files# Run pyllelic; make take some time depending on number of bam filesdata=pyllelic.pyllelic(config=config,files_set=files_set)positions=data.positionscell_types=data.cell_typesmeans_df=data.means# mean methylation of readsmodes_df=data.modes# mode methylation of readsdiff_df=data.diffs# difference mean - mode of readsindividual_data=data.individual_data# read methylation valuesdata.save("output.xlsx")# save methylation resultsdata.save_pickle("my_run.pickle")# save data object for later analysisdata.write_means_modes_diffs(filename="Run1_")# write output data filesdata.histogram("CELL_LINE","POSITION")# visualize data for a pointdata.heatmap(min_values=1)# methylation level heatmapdata.reads_graph()# individual methylated / unmethylated reads graphdata.quma_results["CELL_LINE"]# see summary data for a cell lineAuthorsThis software is developed as academic software byDr. Andrew J. Bonhamat theMetropolitan State University of Denver. It is licensed under the GPL v3.0.This software incorporates implementation fromQUMA, licensed under the GPL v3.0.