Gets candidate sites from FIMO motif matches and add flanking regions, and filters the candidate sites by different thresholds, and filters out sites in blacklist regions.

process_candidate_sites(
  fimo_file,
  flank = 100,
  thresh_pValue = 1e-05,
  thresh_pwmscore = 0,
  chr_order = paste0("chr", c(1:22, "X", "Y", "M")),
  blacklist_file = NULL,
  mapability_file = NULL,
  thresh_mapability = 0.8,
  bigWigAverageOverBed_path = "bigWigAverageOverBed"
)

Arguments

fimo_file

FIMO result ‘.txt’ file

flank

Flanking region (bp) around motif matches (default: 100)

thresh_pValue

FIMO p-value threshold (default: 1e-5)

thresh_pwmscore

FIMO PWM score threshold (default: 0)

chr_order

Chromosomes to include (default: 'chr1', ..., 'chr22', 'chrX', 'chrY', 'chrM'). Please change this accordingly if you use non-human data.

blacklist_file

Filename of the blacklist regions (default: NULL)

mapability_file

Filename of the mapability reference file

thresh_mapability

Mapability threshold (default: 0.8, candidate sites need to be mapable at least 80% positions). This is only used when the mapability_file is available.

bigWigAverageOverBed_path

Path to bigWigAverageOverBed executable (only needed when filtering mapability).

Value

A data frame of processed candidate binding sites passing the threshold filtering.

Examples

if (FALSE) {
sites <- process_candidate_sites(fimo_file='fimo.txt',
                                 thresh_pValue=1e-5,
                                 blacklist_file='blacklist.hg38.bed.gz')
}