methods: Methods for aSnpMatrix and aXSnpMatrix objects

show,aSnpMatrix-methodR Documentation

Methods for aSnpMatrix and aXSnpMatrix objects

Description

These methods extend those that already exist for matrix and SnpMatrix objects, so that the aligned snp and sample summary data are correctly processed.

Usage

## S4 method for signature 'aSnpMatrix'
show(object)

## S4 method for signature 'aSnpMatrix,ANY,missing,missing'
x[i]

## S4 method for signature 'aXSnpMatrix,ANY,missing,missing'
x[i]

## S4 method for signature 'aSnpMatrix,missing,ANY,missing'
x[i, j]

## S4 method for signature 'aXSnpMatrix,missing,ANY,missing'
x[i, j]

## S4 method for signature 'aSnpMatrix,ANY,ANY,missing'
x[i, j]

## S4 method for signature 'aXSnpMatrix,ANY,ANY,missing'
x[i, j]

## S4 replacement method for signature 'aSnpMatrix'
rownames(x) <- value

## S4 replacement method for signature 'aXSnpMatrix'
rownames(x) <- value

## S4 replacement method for signature 'aSnpMatrix'
colnames(x) <- value

## S4 replacement method for signature 'aXSnpMatrix'
colnames(x) <- value

## S4 replacement method for signature 'aSnpMatrix,ANY'
dimnames(x) <- value

## S4 replacement method for signature 'aXSnpMatrix,ANY'
dimnames(x) <- value

## S4 method for signature 'aSnpMatrix,ANY'
switch.alleles(x, snps)

## S4 method for signature 'aXSnpMatrix,ANY'
switch.alleles(x, snps)

Arguments

object

aSnpMatrix or aXSnpMatrix object

x

aSnpMatrix or aXSnpMatrix object

i

row (sample) index

j

column (SNP) index

value

replacement value

snps

index vector of SNPs for which alleles should be switched

Details

cbind2 binds two aSnpMatrix objects with the same samples, different SNPs

rbind2 binds two aSnpMatrix objects with the same SNPs, different samples

[ does the usual subsetting/reordering operations, but ties the SNP and sample support data.frames in at the same time

Value

object of same class as x

Author(s)

Chris Wallace

Examples

X <- new("aSnpMatrix")
X
## load some example data from snpStats
data(for.exercise)
X <- new("aSnpMatrix",
         .Data = snps.10[1:10,1:5],
         snps=snp.support[1:5,],
         samples=subject.support[1:10,])
X

chr1swallace/annotSnpStats documentation built on April 18, 2023, 11:22 a.m.