checkchunksize: Check chunk size

Description Usage Arguments Value Examples

View source: R/episcan.R

Description

Check the chunk size whether it is over the given number of variables(vaiants) in genotype data. If yes, reset the chunk size equal to the number of variables(vaiants).

Usage

1

Arguments

c

an integer indicating the set chunk size.

m

an integer indicating the number of variables(vaiants) in geno1 if there is only one genotype input.

n

an integer indicating the number of variables(vaiants) in geno2 if there are two genotype inputs. The default is NULL.

...

not used.

Value

an integer indicating the chunk size

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
set.seed(123)
geno1 <- matrix(sample(0:2, size = 1000, replace = TRUE, prob = c(0.5, 0.3, 0.2)), 
ncol = 10)
geno2 <- matrix(sample(0:2, size = 2000, replace = TRUE, prob = c(0.4, 0.3, 0.3)), 
ncol = 20)

# if chunk size is smaller, there is no problem
chunksize <- 10
checkchunksize(chunksize, ncol(geno1))

# if chunk size is bigger than the number of columns in genotype input, 
# set chunk size equal to the number of columns in genotype input
chuksize <- 12
checkchunksize(chunksize, ncol(geno1))

# if chunk size is bigger than the number of columns of geno1 and geno2, 
# set chunk size equal to the minima nunumber of columns of geno1 and geno2
chunksize <- 50
checkchunksize(chunksize, ncol(geno1), ncol(geno2))

episcan documentation built on May 2, 2019, 9:42 a.m.