mask_snp_file: Masks entries of a single SNP chip file.

Description Usage Arguments Details Value See Also Examples

Description

This function runs through a single file and masks specified columns of specified rows. It is a simplified version of rbind_snp_files.

Usage

1
2
3
4
5
mask_snp_file(fn, outfn, masking = NULL, snps = NULL, snpsinnew = FALSE,
  dropIDs = NULL, na = 9, int = TRUE, format = NULL)

mask_SNPs(fn, outfn, masking = NULL, snps = NULL, snpsinnew = FALSE,
  dropIDs = NULL, na = 9, int = TRUE, format = NULL)

Arguments

fn

Input filename.

outfn

Output filename.

masking

List that specifies how to mask. Positions given here refer to columns in fn. See details.

snps

Vector of column indicies to use in output file. Defaults to all.

snpsinnew

Logical, when TRUE, positions in masking are mapped to the output file instead of input file.

dropIDs

IDs to exclude from output.

na

Value to use for masking.

int

Logical (default TRUE), read and write integers.

format

Character, Fortran edit descriptors for output. See parseformat.

Details

The masking argument controls which samples / loci are masked as missing with na. It accepts three different objects: 1) an integer vector of loci to mask, 2) a list with first element containing integer vector of IDs for samples to mask and second element an integer vector of loci to mask for those samples, or a list of 2). For 1), the given loci are masked for all samples. For 2) it is limited to those IDs given. By default, the integer vector of loci to mask are mapped to the input file. To map them to output file, set snpsinnew=TRUE.

Value

Invisible list of vectors sent to Fortran subtroutine.

See Also

rbind_snp_files

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
SNPs <- Siccuracy:::make.true(9, 12)
snpfile <- tempfile()
write.snps(SNPs, snpfile)

masking = list(
list(1:3, c(1,3,5,7,9,11)),
list(4:6, c(2,4,6,8,10,12)),
list(7:9, c(1,3,9,10,12))
)

fn <- tempfile()
res <- mask_SNPs(snpfile, fn, masking=masking, na=9)
m <- read.snps(fn)

## End(Not run)

stefanedwards/Siccuracy documentation built on May 30, 2019, 10:44 a.m.