check_continue: Checks whether there are SNPs in each segment

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/check_continue.R

Description

This function calculates the number of SNPs per segment. In case that there exist segments with less than 2 SNPs the user is asked for input to continue ("y") or not ("n"). In case that the user wants to continue, the recombination rates for segments without SNPs are estimated via imputation.

Usage

1
check_continue(seqName, segs, accept, format)

Arguments

seqName

A character string containing the full path and the name of the sequence file in fasta of vcf format. It is necessary to add the extension ("fileName.fa", "fileName.fasta", "fileName.vcf") in order to run LDJump. In case that format equals to DNABin the seqName equals to the name of the DNABin-object (without any extension).

segs

A (non-negative) integer which reflects the number of segments considered. It is calculated in the program based on the user-defined segment length.

accept

an optional logical value: by default FALSE and LDJump checks for segments with less than 2 SNPs and requires user input to proceed. If set to TRUE, the user accepts that the rates for these segments (<= 1 SNP) are estimated via imputation.

format

A character string which can be fasta, vcf, or DNAStringSet. If fasta is used, the package will proceed with the computation of the recombination map. If vcf, the package will convert the data in vcf format to fasta format with the function vcfR_to_fasta and then proceed as in case fasta. For the last format the seqName must equal to the DNABin-object which contains the sequences.

Value

This function returns TRUE in case that all segments contain SNPs. It will also return TRUE if the user agrees to continue although there exist segments without SNPs. It returns FALSE if the user denies to continue due to segments without SNPs.

Author(s)

Philipp Hermann philipp.hermann@jku.at, Andreas Futschik

References

Paradis E., Claude J. & Strimmer K. 2004. APE: analyses of phylogenetics and evolution in R language. Bioinformatics 20: 289-290.

See Also

read.FASTA, seg.sites

Examples

1
2
##### Do not run these examples                                  #####
##### check_continue(seqName, segs = segs)                       #####

PhHermann/LDJump documentation built on Nov. 16, 2019, 12:53 p.m.