transScores {GGtools} | R Documentation

## obtain the top trans associations for each SNP in an smlSet

### Description

obtain the top trans associations for each SNP in an smlSet

### Usage

    transScores( tconfig )

    transScores.legacy(smpack, snpchr = "chr1", rhs, K = 20, targdirpref = "tsco", geneApply = lapply,
      chrnames = paste("chr", as.character(1:22), sep = ""), geneRanges = NULL, snpRanges = NULL,
      radius = 2e+06, renameChrs = NULL, probesToKeep = NULL, batchsize = 200,
      genegran = 50, shortfac = 10, wrapperEndo = NULL,
      geneannopk = "illuminaHumanv1.db",
      snpannopk = snplocsDefault(), gchrpref = "",
                     schrpref = "ch", exFilter=function(x)x,
       smFilter=function(x)x,
       SSgen=GGBase::getSS)

    meta.transScores (smpackvec = c("GGdata", "hmyriB36"),
        snpchr = "22", rhsList=list(~1, ~1), K = 20, targdirpref = "mtsco",
        geneApply = lapply, chrnames = as.character(21:22),
        radius = 2e+06, renameChrs=NULL,
        probesToKeep=NULL, batchsize=200, genegran=50, shortfac=10, wrapperEndo=NULL,
        geneannopk = "illuminaHumanv1.db", snpannopk = snplocsDefault(),
        gchrpref = "", schrpref="ch",
        exFilterList= list(function(x)x, function(x)x),
        SMFilterList = list(function(x)x, function(x)x),
        SSgen = GGBase::getSS)

### Arguments

`tconfig` | instance of `TransConfig-class`
`smpack` | name of package holding eset.rda providing 'ex' ExpressionSet when loaded, and holding SnpMatrix instances in inst/parts
`smpackvec` | vector of names of package holding eset.rda providing 'ex' ExpressionSet when loaded, and holding SnpMatrix instances in inst/parts
`snpchr` | name or vector of chromosome names of SNPs of interest
`rhs` | right hand side of snp.rhs.tests model for which expression is left hand side, e.g., covariates other than genotype
`rhsList` | list of right hand side of snp.rhs.tests model for which expression is left hand side, e.g., covariates other than genotype, one per element of `smpackvec`
`K` | number of most highly associated features to be retained
`targdirpref` | prefix of target folder name (passed to `eqtlTests`
`geneApply` | passed to `eqtlTests`
`chrnames` | names of chromosomes harboring genes that will be tested for association with genotype
`geneRanges` | list of `GRanges-class` instances containing chromosomal coordinate defined regions occupied by genes, with regions partitioned by chromosomes, and list element names as given in `chrnames` above
`snpRanges` | list of `GRanges-class` instances with SNP addresses
`radius` | radius within which an association is considered cis and therefore the corresponding test statistic is set to zero
`renameChrs` | passed to `getSS`
`probesToKeep` | passed to `getSS`
`batchsize` | defines batch size for `ffrowapply`
`genegran` | passed to `eqtlTests`
`shortfac` | passed to `eqtlTests`
`wrapperEndo` | a function accepting and returning an smlSet instance, evaluated before numerical analysis of associations, which will be executed on the output of this function
`gchrpref` | prefix to convert `chrnames` into appropriate tokens for obtaining gene metadata; in future this may need to be a string transformation function
`schrpref` | prefix to convert `chrnames` into appropriate tokens for use with `snplocs` for the SNP location information package identified in `snpannopack` parameter below
`geneannopk` | character string naming a Bioconductor .db expression chip annotation package
`snpannopk` | character string naming a Bioconductor SNPlocs.* SNP metadata package
`exFilter` | function to transform ExpressionSet component of retrieved smlSet, to reduce probe sets in use, for example
`smFilter` | function to transform smlSet instance before use; filter can affect genotypes in smList(x)[[1]], for example
`exFilterList` | list of functions serving as exFilters for each of the elements of smpackvec
`SMFilterList` | list of functions servicing as wrapperEndos for each of the elements of smpackvec
`SSgen` | function to be used to create smlSet instance for testing – in general, GGBase::getSS has been used to pull the ExpressionSet and SnpMatrix data from a named package, but in some cases a specialize task is needed to create the desired smlSet. Whatever is passed to SSgen must return an smlSet instance.

### Value

a list with elements

`scores` | an S by K ff matrix where S is number of SNPs, K is number of best features to be retained, with element s,k the kth largest score statistic among association tests computed for SNP s
`inds` | an S by K ff matrix with s,k element telling which element of guniv (see below) is the gene giving the kth largest score statistic for association
`guniv` | the vector of gene identifiers defining the universe of genes tested
`snpnames` | vector of SNP identifiers
`call` | the call used to create the result

### Author(s)

VJ Carey <stvjc@channing.harvard.edu>

### Examples

    ## Not run:
    library(GGdata)
    # need to define the geneRanges and snpRanges ...
    transScores("GGdata", "20", renameChrs="chr20", chrnames="chr21")

    ## End(Not run)

[Package GGtools version 5.16.0 Index]