This file is indexed.

/usr/lib/R/site-library/VariantAnnotation/unitTests/test_snpSummary.R is in r-bioc-variantannotation 1.20.2-1+b1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
test_snpSummary_empty <- function()
{
    cnames <- c("g00", "g01", "g11", "a0Freq", "a1Freq", 
                "HWEzscore", "HWEpvalue")
    ## no genotype
    fl <- system.file("unitTests", "cases", 
              "FORMAT_header_no_SAMPLEs.vcf", 
              package="VariantAnnotation")
    res <- suppressWarnings(snpSummary(readVcf(fl, "hg19")))
    checkTrue(all(dim(res) == c(0L, 7L)))
    checkEquals(names(res), cnames)

    ## structural
    fl <- system.file("extdata", "structural.vcf", 
              package="VariantAnnotation")
    res <- suppressWarnings(snpSummary(readVcf(fl, "hg19")))
    checkTrue(all(dim(res) == c(0L, 7L)))
    checkEquals(names(res), cnames)
}

test_snpSummary_output <- function()
{
    fl <- system.file("extdata", "ex2.vcf", 
              package="VariantAnnotation")
    vcf <- readVcf(fl, "hg19")
    res <- snpSummary(vcf)

    checkTrue(is.integer(res$g00))
    checkTrue(is.integer(res$g01))
    checkTrue(is.integer(res$g11))

    checkEquals(nrow(res), nrow(vcf))
    checkEquals(rownames(res), rownames(vcf))

    checkEquals(as.integer(res[1,c("g00", "g01", "g11")]), c(1L, 1L, 1L))
    checkEquals(as.integer(res[2,c("g00", "g01", "g11")]), c(2L, 1L, 0L))
    checkEquals(round(res[["a0Freq"]], 2), c(0.50, 0.83, NA, NA, NA))
    checkEquals(round(res[["a1Freq"]], 2), c(0.50, 0.17, NA, NA, NA))
}