Package: phased-methylation
phased-methylationThis package defines a pipeline for phased methylation calling on raw Nanopore
data. It has three steps:Mapping reads to a reference genome (minimap2)Phasing variants and reads (longshot)Calling methylated bases (megalodon)TODOimprove documentationintegratedeepsignal-plantEnvironment setup and installationcondacreate-nphased-methylation-cbioconda-cconda-forgegitcythonpytest\pandaspysampybedtoolsminimap2longshotmegalodon==2.3.4gputilpsutil\tabulatepyfaidxgff2bed
condaactivatephased-methylation
pipinstallont_pyguppy_client_libnvsmitempfifophased-methylationTest runTo execute a test run of the pipeline, use thetestsubcommandphased-methylationtest<test_dir/>Usageusage: phased-methylation [-h]
                          {launch,map,phase,call,test,mean,promoter,gene-body,plot,plot-genes,plot-repeats,export-metilene,export-bedgraph}
                          ...

pipeline for methylation calling

positional arguments:
  {launch,map,phase,call,test,mean,promoter,gene-body,plot,plot-genes,plot-repeats,export-metilene,export-bedgraph}
    launch              launch full pipeline
    map                 perform mapping step
    phase               perform phasing step
    call                perform methylation calling step
    test                execute test run
    mean                calculate average methylation across chromosomes
    promoter            quantify promoter methylation
    gene-body           quantify gene body methylation
    plot                plot methylation across chromosomes
    plot-genes          plot methylation profiles over genomic features
    plot-repeats        plot methylation profiles over genomic features
    export-metilene     export methylation data formatted for input into
                        metilene
    export-bedgraph     export methylation data in bedgraph format

optional arguments:
  -h, --help            show this help message and exitInput filesOutput filesResults will be written to the indicated output directory.ExampleMinimal example:phased-methylationlaunchreference.fafast5s_dir/output_dir/query.fastqGPU resource managementphased-methylation(specifically, thecallstep usingmegalodon) requires at least one available GPU to run successfully. When the pipeline is launched, it will check for availability of the devices indicated by the--devicesargument, defaulting to device0. If one or more indicated devices are not available, the user will be prompted to free up resources by terminating processes running on them:Cannot launch because the following processes are occupying resources on device(s) 0:

=====  =====  ========================================  ==================
  GPU    PID  Process Name                              GPU Memory Usage
=====  =====  ========================================  ==================
    0  16397  /opt/ont/guppy/bin/guppy_basecall_server  9.80 GB
=====  =====  ========================================  ==================

Terminate these processes and continue? [y/N]:Enteryto terminate the indicated processes and continue with the pipeline,
or enter any other input to terminatephased-methylation.MiscDocumentation from original shell script:IMPORTANT, this can only be run when there are no sequencing runs in progress. If
there are they must be paused and then the guppy_basecaller needs to be killed to
clear the GPU memory. In a terminal, type nvidia-smi and find the job ID of the
guppy_basecaller(there may be two running).  KILL THEM all Run nvidia-smi again and
you should see that the GPU memory usage is very low now. Start this script.  Once
it gets to the megalodon part you can start sequencing on the PromethION again. If
you start the sequener too soon this script will crash once it gets to the megalodon
step