pooldata.subset {poolfstat}R Documentation

Create a subset of the pooldata object that contains Pool-Seq data

Description

Create a subset of the pooldata object that contains Pool-Seq data

Usage

pooldata.subset(pooldata, pool.index = c(1, 2), min.cov.per.pool = -1,
  max.cov.per.pool = 1e+06, min.maf = -1)

Arguments

pooldata

A pooldata object containing Pool-Seq information

pool.index

Indexes of the pools (at least two), that should be selected to create the new pooldata object

min.cov.per.pool

Minimal allowed read count (per pool). If at least one pool is not covered by at least min.cov.perpool reads, the position is discarded

max.cov.per.pool

Maximal allowed read count (per pool). If at least one pool is covered by more than min.cov.perpool reads, the position is discarded

min.maf

Minimal allowed Minor Allele Frequency (computed from the ratio overal read counts for the reference allele over the read coverage)

Value

A pooldata object with 7 elements:

  1. "refallele.readcount": a matrix with nsnp rows and npools columns containing read counts for the reference allele (chosen arbitrarily) in each pool

  2. "readcoverage": a matrix with nsnp rows and npools columns containing read coverage in each pool

  3. "snp.info": a matrix with nsnp rows and four columns containing respectively the contig (or chromosome) name (1st column) and position (2nd column) of the SNP; the allele in the reference assembly (3rd column); the allele taken as reference in the refallele matrix.readcount matrix (4th column); and the alternative allele (5th column)

  4. "poolsizes": a vector of length npools containing the haploid pool sizes

  5. "poolnames": a vector of length npools containing the names of the pools

  6. "nsnp": a scalar corresponding to the number of SNPs

  7. "npools": a scalar corresponding to the number of pools

See Also

To generate pooldata object, see vcf2pooldata, popsync2pooldata

Examples

 make.example.files(writing.dir=tempdir())
 pooldata=popsync2pooldata(sync.file=paste0(tempdir(),"/ex.sync.gz"),poolsizes=rep(50,15))
 pooldata.subset=pooldata.subset(pooldata,pool.index=c(1,2))

[Package poolfstat version 1.1.1 Index]