Learn R Programming

rehh (version 3.2.2)

subset.haplohh: Subsets object of haplohh-class

Description

Subsets the data of an object of class haplohh-class, meeting certain conditions.

Usage

# S3 method for haplohh
subset(
  x,
  select.hap = NULL,
  select.mrk = NULL,
  min_perc_geno.hap = NA,
  min_perc_geno.mrk = 100,
  min_maf = NA,
  max_alleles = NA,
  verbose = TRUE,
  ...
)

Arguments

x

object of class haplohh-class to be subset.

select.hap

expression, indicating haplotypes to select.

select.mrk

expression, indicating markers to select.

min_perc_geno.hap

threshold on percentage of missing data for haplotypes (haplotypes with less than min_perc_geno.hap percent of markers genotyped are discarded). Default is NA, hence no constraint.

min_perc_geno.mrk

threshold on percentage of missing data for markers (markers genotyped on less than min_perc_geno.mrk percent of haplotypes are discarded). By default, min_perc_geno.mrk=100, hence only fully genotyped markers are retained. This value cannot be set to NA or zero.

min_maf

threshold on the Minor Allele Frequency. Markers having a MAF lower than or equal to minmaf are discarded. In case of multi-allelic markers the second-most frequent allele is referred to as minor allele. Setting this value to zero eliminates monomorphic sites. Default is NA, hence no constraint.

max_alleles

threshold for the maximum number of different alleles at a site. Default is NA, hence no restriction. In order to retain only bi-allelic markers, set this parameter to 2.

verbose

logical. If TRUE (default), report verbose progress.

...

further arguments are ignored.

See Also

haplohh-class, data2haplohh

Examples

Run this code
# NOT RUN {
#example haplohh object (280 haplotypes, 1424 SNPs)
#see ?haplohh_cgu_bta12 for details
data(haplohh_cgu_bta12)
#select subset of first 10 hyplotypes and first 5 markers
subset(haplohh_cgu_bta12, select.hap = 1:10, select.mrk = 1:5)
# }

Run the code above in your browser using DataLab