#!/bin/bash

# Requires Pacbio SMRT Link v8.0 
smrtlink8=/path/to/smrtlink-release_8.0.0.79519/bundles/smrttools/install/smrttools-release_8.0.0.79510/smrtcmds/bin
export PATH=$PATH:$smrtlink8

# Include the provided scripts in your $PATH if running single_region_m6A_pipeline.sh unmodified:
export PATH=$PATH:./src

# The following command-line tools will also be required:
#       samtools
#       bedops (https://bedops.readthedocs.io/en/latest/)
#       datamash (https://www.gnu.org/software/datamash/)

# Example region from Figure 2E
echo -e "chr2L\t17381000\t17391000" > fig2E.dm6.bed

# Raw data from GEO
subreads=DS75167.subreads.bam

# Mapping locations of molecules provided in GEO
# (not needed if running whole-genome pbalign on the complete raw subreads)
ZMW_index=GSM4411218_DS75167_ZMW_IDs_dm6.bed.gz 

# Thresholds for calling base modifications depending on subread coverage per molecule.
thresholds=config/base_mod_thresholds.DS75167.txt

reference=dm6.fa

single_region_m6A_pipeline.sh "$subreads" fig2E.dm6 fig2E.dm6.bed "$reference" "$ZMW_index" "$thresholds"

