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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
|
### =========================================================================
### ScanVcfParam class methods
### =========================================================================
## - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
## Constructor
##
setMethod(ScanVcfParam, "ANY",
function(fixed=character(), info=character(), geno=character(),
samples=character(), trimEmpty=TRUE, which, ...)
{
ScanBcfParam(fixed, info, geno, samples, trimEmpty=trimEmpty,
which=which, class="ScanVcfParam")
})
setMethod(ScanVcfParam, "missing",
function(fixed=character(), info=character(), geno=character(),
samples=character(), trimEmpty=TRUE, which, ...)
{
ScanBcfParam(fixed, info, geno, samples, trimEmpty=trimEmpty,
class="ScanVcfParam")
})
## - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
## Validity
##
.valid.ScanVcfParam <- function(object)
{
samples <- vcfSamples(object)
geno <- vcfGeno(object)
if (any(is.na(samples)) && length(geno) > 0L)
return("ScanVcfParam: 'geno' cannot be specified if 'samples' is 'NA'")
if (any(is.na(geno)) && length(samples) > 0L)
return("ScanVcfParam: 'samples' cannot be specified if 'geno' is 'NA'")
NULL
}
setValidity("ScanVcfParam", .valid.ScanVcfParam,
where=asNamespace("VariantAnnotation"))
## - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
## Getters and Setters
##
vcfFixed <- function(object) slot(object, "fixed")
"vcfFixed<-" <- function(object, value)
{
slot(object, "fixed") <- value
object
}
vcfInfo <- function(object) slot(object, "info")
"vcfInfo<-" <- function(object, value)
{
slot(object, "info") <- value
object
}
vcfGeno <- function(object) slot(object, "geno")
"vcfGeno<-" <- function(object, value)
{
slot(object, "geno") <- value
object
}
vcfSamples <- function(object) slot(object, "samples")
"vcfSamples<-" <- function(object, value)
{
slot(object, "samples") <- value
object
}
vcfTrimEmpty <- function(object) slot(object, "trimEmpty")
"vcfTrimEmpty<-" <- function(object, value)
{
slot(object, "trimEmpty") <- value
object
}
vcfWhich <- function(object)
{
slot(object, "which")
}
"vcfWhich<-" <- function(object, value)
{
slot(object, "which") <- as(value, "RangesList")
object
}
|