prepare.data {chicane} | R Documentation |
prepare.data
Description
Prepare data for running interaction calling. Takes a BAM file and baits and restriction fragments as input, and returns a data table with data ready for analysis.
Usage
prepare.data(
bam,
baits,
fragments,
replicate.merging.method = "sum",
include.zeros = c("none", "cis", "all"),
remove.adjacent = FALSE,
temp.directory = NULL,
keep.files = FALSE,
verbose = FALSE
)
Arguments
bam |
Path to a BAM file |
baits |
Path to a BED file containing the baits |
fragments |
Path to a BED file containing all restriction fragments in the genome |
replicate.merging.method |
Method that should be used for merging replicates, if applicable |
include.zeros |
String specifying what zero counts to include. Options are none (default), cis, and all. |
remove.adjacent |
Logical indicating whether to remove all reads mapping to adjacent restriction fragments. |
temp.directory |
Directory where temporary files should be stored. Defaults to current directory. |
keep.files |
Logical indicating whether to keep temporary files |
verbose |
Logical indicating whether to print progress reports. |
Value
Data table object with columns
target.id |
String in chrN:start-end format identifying target fragment |
bait.id |
String in chrN:start-end format identifying bait fragment |
target.chr |
Chromosome of target fragment |
target.start |
Start coordinate of target fragment (zero-based) |
target.end |
End coordinate of target fragment |
bait.chr |
Chromosome of bait fragment |
bait.start |
Start coordinate of bait fragment (zero-based) |
bait.end |
End coordinate of bait fragment |
bait.to.bait |
Boolean indicating if the interaction is bait-to-bait (i.e. the fragment listed as target is also a bait) |
count |
The number of reads linking the two fragments |
bait.trans.count |
The number of reads linking the bait to fragments in trans (a measure of "interactibility") |
target.trans.count |
The number of reads linking the target to fragments in trans (a measure of "interactibility") |
distance |
Distance between the midpoints of the bait and target fragments (basepairs). NA for trans interactions |
Examples
if( bedtools.installed() ) {
bam <- system.file('extdata', 'Bre80_2q35.bam', package = 'chicane');
baits <- system.file('extdata', '2q35.bed', package = 'chicane');
fragments <- system.file('extdata', 'GRCh38_HindIII_chr2.bed.gz', package = 'chicane');
input.data <- prepare.data(
bam = bam,
baits = baits,
fragments = fragments
);
}