This function is used to subset a GBreaks object into a list of GBreaks
using a sliding window.
Usage
slidingWindow(
gb,
factor = 100,
windowSize = NULL,
stepSize = NULL,
merged = FALSE,
cut = TRUE
)Arguments
- gb
A
GBreaksobject.- factor
Number of windows.
- windowSize
The size of the window.
- stepSize
The size of the step.
- merged
set TRUE to output a
GBreaksobject- cut
whether cut the alignments out of the window
Value
Returns a GenomicRanges::GRangesList containing one GBreaks
object for each window, or a single GBreaks object if merged is TRUE.
Details
When cut is TRUE, an alignment that crosses a window boundary
is cut at that boundary on the target genome. Its query range is cut by
the same proportion, on the side given by the strand of the target range,
and its score, if any, is scaled by that proportion.
See also
Other Similarity indexes:
F81_distance(),
GOC(),
HKY85_distance(),
JC69_distance(),
JC69_distance_allseq(),
K80_distance(),
K80_gap_distance(),
P_distance(),
T92_distance(),
TN93_distance(),
breakpointGraphProperties(),
correlation_index(),
inversionDistance(),
inversionEstimate_BD(),
karyotype_index(),
logDet_distance(),
strand_randomisation_index(),
synteny_index(),
tau_index()
Examples
exampleInversion
#> GBreaks object with 3 ranges and 1 metadata column:
#> seqnames ranges strand | query
#> <Rle> <IRanges> <Rle> | <GRanges>
#> [1] chrA 100-190 + | chrB:100-190
#> [2] chrA 210-291 - | chrB:210-291
#> [3] chrA 301-400 + | chrB:301-400
#> -------
#> seqinfo: 1 sequence from an unspecified genome
slided_gb <- slidingWindow(exampleInversion, windowSize = 250, stepSize = 125)
slided_gb
#> GRangesList object of length 3:
#> $`1`
#> GBreaks object with 2 ranges and 5 metadata columns:
#> seqnames ranges strand | query window_id window_seqname
#> <Rle> <IRanges> <Rle> | <GRanges> <integer> <character>
#> [1] chrA 100-190 + | chrB:100-190 1 chrA
#> [2] chrA 210-250 - | chrB:251-291 1 chrA
#> window_start window_end
#> <integer> <integer>
#> [1] 1 250
#> [2] 1 250
#> -------
#> seqinfo: 1 sequence from an unspecified genome
#>
#> $`2`
#> GBreaks object with 3 ranges and 5 metadata columns:
#> seqnames ranges strand | query window_id window_seqname
#> <Rle> <IRanges> <Rle> | <GRanges> <integer> <character>
#> [1] chrA 126-190 + | chrB:126-190 2 chrA
#> [2] chrA 210-291 - | chrB:210-291 2 chrA
#> [3] chrA 301-375 + | chrB:301-375 2 chrA
#> window_start window_end
#> <integer> <integer>
#> [1] 126 375
#> [2] 126 375
#> [3] 126 375
#> -------
#> seqinfo: 1 sequence from an unspecified genome
#>
#> $`3`
#> GBreaks object with 2 ranges and 5 metadata columns:
#> seqnames ranges strand | query window_id window_seqname
#> <Rle> <IRanges> <Rle> | <GRanges> <integer> <character>
#> [1] chrA 251-291 - | chrB:210-250 3 chrA
#> [2] chrA 301-400 + | chrB:301-400 3 chrA
#> window_start window_end
#> <integer> <integer>
#> [1] 251 500
#> [2] 251 500
#> -------
#> seqinfo: 1 sequence from an unspecified genome
#>
sapply(slided_gb, strand_randomisation_index)
#> 1 2 3
#> 0.3787879 0.2612613 0.4184397