split_with_overlap: A function to separate the gamete SNP positions into...

View source: R/split_with_overlap.R

split_with_overlapR Documentation

A function to separate the gamete SNP positions into overlapping segments

Description

This function separates each gamete into overlapping windows of size determined by the user. These overlaps are an input to the distance matrix constructed in reconstruct_haplotypes.

Usage

split_with_overlap(vector_of_positions, window_size, overlap_denom)

Arguments

vector_of_positions

vector of SNP positions

window_size

User-input value for length of segment

overlap_denom

User-input value for denominator in calculation of overlap, or the degree of overlap between segments

Details

Adapated from https://stackoverflow.com/questions/8872376/split-vector-with-overlapping-samples-in-r

Value

windows list of lists with the number of lists equal to the number of windows and each inner list containing the SNP positions in that overlapping segment


mccoy-lab/rhapsodi documentation built on July 27, 2022, 3:56 a.m.