Package: modbedtools
modbedtoolsRequires Python >= 3.6A python command line tool to generate modbed files for visualization on theWashU Epigenome Browser.This tools has 2 modules/subcommands:parse MM/ML tag from BAM files generated from 3rdgeneration sequencing platform likeOxford NanoporeandPacBiodevices using thepysampackage.add background canonical base positions given modified bases.installationInstall throughpypi modbedtools project page(version number might change):$pipinstallmodbedtools
CollectingmodbedtoolsDownloadingmodbedtools-0.1.3-py3-none-any.whl(8.8kB)Requirementalreadysatisfied:pysamin/opt/apps/python3/lib/python3.7/site-packages(frommodbedtools)(0.19.1)Installingcollectedpackages:modbedtools
Successfullyinstalledmodbedtools-0.1.3modbed formatchr1151732735195306read_idscore+-110,-266,-1459,-1780,-1840,-1842,-1848,-1865,-1928,-1936,...-396,-1543,-3222,-4195,-4319,-4692,-5352,-5366,-5523,-5838,...
chr1151745075194585read_idscore+223,605,607,613,630,693,701,936,1761,3369,...307,544,1280,2017,2859,2994,3116,3249,3790,3935,...
chr1151745435196481read_idscore+187,271,508,570,576,593,901,1729,2826,3216,...568,656,664,1985,2961,3083,3703,4115,4286,4882,...Each row in this bed-based format is a long read, the columns are:chromosomestart position of this readend position of this readread name or id or something to tag this readscore (number), this can be used to sort the reads from top to bottom when viewing in Browser, can use 0 if no need to sortstrand (+ or - for mapping direction)methylated/modified base positions, relative to start, a dot.can be used if there is no modified basesunmethylated/unmodified/canonical base positions, relative to start, a dot.can be used if there is no unmodified basesAll positions are 0 based.8columns of data need be provided, 4thcolumn can be read identifiers or usechrom:start-end. 5thcolumn is score which is used to sort reads vertically in the view region.commands$modbedtools-husage:modbedtools[-h][--version]{bam2mod,addbg}...

PythoncommandlinetooltogeneratemodbedfilesforvisualizationonWashUEpigenomeBrowser.

optionalarguments:-h,--helpshowthishelpmessageandexit--version,-vshowprogram'sversionnumberandexitsubcommands:validsubcommands{bam2mod,addbg}additionalhelpbam2modconvertbamtomodbedaddbgaddbackgroudbasesgivenmodifiedbasesandreferencesequence(files for testing can be found in thetestfolder in this repository)bam2modconvert bam files with MM/ML tags to modbed format.$modbedtoolsbam2mod-husage:modbedtoolsbam2mod[-h][-b[{C,A,c,a}]][-g][-cCUTOFF][-oOUTPUT]bamfile

positionalarguments:bamfilebamfilewithMM/MLtags

optionalarguments:-h,--helpshowthishelpmessageandexit-b[{C,A,c,a}],--base[{C,A,c,a}]modificationbase,casein-sensitive,C/caresame.(default:C)-g,--cpgoutputforbothC/GbasesinCpG,onlyapplyswhenbaseisC-cCUTOFF,--cutoffCUTOFFmethylationcutoff,>=cutoffasmethylated.default:0.5-oOUTPUT,--outputOUTPUToutputfilename,asuffix.modbedwillbeadded.default:outputexamples:modbedtoolsbam2modhifi-test.bam-ohifimodbedtoolsbam2modremora-test.bam-oremoraaddbgFor data provided methylated bases, given a reference genome fasta sequence, add the unmethylated bases from genome sequence as background,this assumes all other specified bases from genome are unmethylated/unmodified.The input file should be in bed format, the last 2 columns save the comma separated relative base positions with modifications (0 based).example input:chr1151933605212743{middlecolumnscanbeanythingornone}21,273,296,307,440,461,475,688,689,694,863...The example data below is adopted from one of theFiber-seqdata fromJohn Stamatoyannopoulos lab.modbedtoolsaddbg-bAGSM4411218_tracks_m6A_DS75167.dm6.bed.gzdm6.fa.gz-oGSM4411218_tracks_m6A_DS75167misc scriptsConvertNanoMethPhase example datato modbed format.python3../misc/parse_nanomethphase.pyNA19240_chr21_39000000-40000000.bamNA19240_chr21_39000000-40000000_MethylationCalls.tsvIf need support of other methylation callers please submit an issue request.track formatingTabixis used to compress and index the modbed files generated in last steps.example:bgziphifi.modbed
tabix-pbedhifi.modbed.gzThen the .gz and .gz.tbi files can be placed into any web server for hosting and the URL to the .gz file can be used for Visualization inWashU Epigenome Browser.visualizationExample modbed files can be used for visualization:FileDescriptionOne-click URL for visualizationHG00621.remora.modbed.gzGenome wide ONT remora datalinkremora-test-chr11.modbed.gzONT remora data only on chr11linkHG00621.hifi.cpg.modbed.gzGenome wide PacBio Hifi datalinkhifi-test-chr11.cpg.modbed.gzPacBio Hifi data only on chr11 at CpG modelinkhifi-test.modbed-hbg.gz,index filePacBio Hifi data only onchr11:5162720-5356331, also for testing local track uploadlinkGSM4411218_tracks_m6A_DS75167.dm6.modbed.gzFruit fly Fiber-seq datalinkstep by step tutorialIn this tutorial, and we will usehifi-test.modbed.gzfor the next step by step tutorial.(Please note this test data only contains methylation signal on chr11)First we will go to the Browser by navigating your web browser tohttps://epigenomegateway.wustl.edu/browser/, clickhg38for the genome.In the test data, we will check methylation signal overKDM2Agene, we will use the gene search function, type inKDM2Aand choose the first hit in refGene:Go to Tracks menu, click Remote Tracks:Choose modbed from the track type dropdown list, paste the URL above:This is the default view after you submit this modbed file, each row represents a long read, each bar on each read means methylation level, gray bar indicates there is an cytosine base but it’s unmethylated. Mouse over each bar can show the tooltip.Zoom in 5-fold multiple times, you can see the methylation status at base pair level resolution, each filled circle means methylated, empty circle means unmethylated, orange circle above the line means it’s in + strand, blue in – strand.Zoom out multiple times from the default view, can clearly view m6A methylation profile over each read:Zoom out further, signals from all reads are summarized to one bar plot, gray line indicates read density, bar height means methylation level:At each view, right click the track, can change view to heatmap style like in IGV:upload modbed files as local trackPlease see the animation below for instructions, example files can be foundhere, and theindex file, please download both files to your local hard drive.Pacbio dataPacBio CpG methylation calls of circular consensus se-quencing (ccs) reads represents the predicted methylation status of the CpG site as a unit. Usually, we plotted the methylation prediction of CCS on both C base at each CpG site by enable the-goption:modbedtoolsbam2modhifi-test.bam-ohifi-gsee the below screenshots for pacbio data visualizaed at base pair level, top is without-gand button is with-goption: