This function takes a candidate data frame (see map_qtl) as input and removes SNPs for which either of the homozygotes is missing in at least one of the control and treated conditions.

filter_geno(candidate, geno, anno = NULL)

Arguments

candidate

A data frame containing feature IDs and SNP IDs. The first column must contain feature IDs and the second column must contain SNP IDs.

geno

A data frame formatted as input for MatrixEQTL. The first column must contain SNP IDs. The rest of the columns must contain genotypes, which can be dosage or coded as (0, 1, 2). Each column corresponds to each sample.

anno

A data frame containing sample IDs, subject IDs, and treatment conditions. The columns must be named as "sample", "subject", and "condition".

Value

A list of data frames containing the following elements:

  • included - A data frame containing filtered data.

  • excluded - A data frame containing excluded feature-SNP pairs.

Examples

candidate <- data.frame(
    feat_id = c("f1", "f2"),
    snp_id = c("g1", "g2")
)
geno <- data.frame(
    snp_id = c("g1", "g2"),
    d1 = c(0, 1), d2 = c(1, 2), d3 = c(2, 0)
)
anno <- data.frame(
    sample = paste0("s", 1:6),
    subject = rep(c("d1", "d2", "d3"), each = 2),
    condition = rep(c(0, 1), 3)
)
filter_geno(candidate = candidate, geno = geno, anno = anno)
#> $included
#>   feat_id snp_id
#> 1      f1     g1
#> 2      f2     g2
#> 
#> $excluded
#> [1] feat_id snp_id 
#> <0 rows> (or 0-length row.names)
#>