Skip to content

Detailed Use: OKseq RFD (Replication Fork Directionality) Track Generation

pongorlorinc edited this page May 1, 2019 · 4 revisions

Generating RFD track and scaled Watson/Crick strand coverage tracks is a one step process with BAMscale. As input, you need to pick an OK-seq BAM file, specify the RFD operation, and set the binsize. Generally, the bin size is set to 10k.

Basic Command (example)

./BAMscale scale --bam <INPUT_OKseq.bam> --operation rfd --binsize 1000 -t 4

Specifying "-t 4" tells BAMscale, to use 4 processing threads, instead of the default (1 thread). Each chromosome is processed by a single thread, so in this example, 4 chromosomes are processed in parallel. Note: increasing no. of threads over 4 might not increase performance substantially (benchmarks).

This command will generate three files in BigWig format:

1. RFD Scaled Coverage
2. Forward-Oriented (Watson Strand) Scaled Coverage Track 
3. Reverse-Oriented (Crick Strand) Scaled Coverage Track 

Comparison with Published Dataset

In this comparison we will process data from published OK-seq sequencing. (Generating the coverage tracks took ~3 minutes using 4 threads). A detailed walkthrough of the processing can be seen below.

Blue indicates the deposited RFD track from GEO. Green was the track generated with BAMscale. Grey and black coverage tracks are the Watson/Crick scaled coverage tracks, that are generated by default.

There are some minor differences, however the overall tendencies are the same.

WARNING: When using this function, process one file at a time (otherwise the program will just immediately exit).

Preparing input data for BAMscale

1) Downloading Files from SRA in fastq Format

 fasterq-dump SRR7440353 --split-3

2) Aligning Reads with BWA "mem"

bwa mem -t 8 <mm10.idx> SRR7440353_1.fastq SRR7440353_2.fastq \
    | samtools view -Sbh > SRR7440353.unsorted.bam

3) Sorting Reads and Marking Duplicates

samtools sort -o SRR7440353.sorted.bam SRR7440353.unsorted.bam

samtools index SRR7440353.sorted.bam

java -Xmx8g -jar picardtools.jar MarkDuplicates \
      I=SRR7440353.sorted.bam \
      O=SRR7440353.sorted.dedup.bam \
      M=SRR7440353.sorted.dedup.metrics

samtools index SRR7440353.sorted.dedup.bam

4) Generating RFD Tracks and Scaled Watson/Crick Strand Coverage Tracks

./BAMscale scale --bam SRR7440353.sorted.dedup.bam --operation rfd --binsize 1000
Clone this wiki locally