get_fragment_length_bed: Extract fragment length from a BAM file.

View source: R/plot_fragments.R

get_fragment_length_bedR Documentation

Extract fragment length from a BAM file.

Description

This function takes a BAM file and a BED file as an input and outputs the fragment length distributions of all the regions in a TXT file.

Usage

get_fragment_length_bed(
  bin_path = "tools/samtools/samtools",
  bam = "",
  bed = "",
  max_frag_length = 1000,
  mapq = 10,
  threads = 1,
  output_dir = "",
  verbose = FALSE,
  mode = 0,
  start = NULL,
  end = NULL,
  start_bin = NULL,
  end_bin = NULL
)

Arguments

bin_path

Path to samtools executable. Default path tools/samtools/samtools.

bam

Path to BAM file.

bed

Path to BED file.

max_frag_length

Maximum fragment length to keep. Default 1000.

mapq

Minimum MapQ of the reads to keep. Default 10.

threads

Number of cores. Default 1

output_dir

Directory to output results.

verbose

Enables progress messages. Default False.

mode

Mode in which to output the fragment length. Default 0. Mode 0: Returns fragment length for R1 and R2 reads. Mode 1: Returns fragment legnth for R1 reads. Mode 2: Returns fragment length for R2 reads.

start

Downstream distance from (start+end)/2 position in bed file

end

Upstream distance from (start+end)/2 position in bed file

start_bin

Downstream distance from (start+end)/2 position in bed file for bin

end_bin

Upstream distance from (start+end)/2 position in bed file for bin


TearsWillFall/DNAfrags documentation built on March 26, 2022, 6:02 a.m.