initialize-ASEset {AllelicImbalance} | R Documentation |
Functions to construct ASEset objects
ASEsetFromCountList(rowRanges, countListUnknown = NULL, countListPlus = NULL, countListMinus = NULL, colData = NULL, mapBiasExpMean = NULL, phase = NULL, aquals = NULL, verbose = FALSE, ...) ASEsetFromArrays(rowRanges, countsUnknown = NULL, countsPlus = NULL, countsMinus = NULL, colData = NULL, mapBiasExpMean = NULL, phase = NULL, genotype = NULL, aquals = NULL, verbose = FALSE, ...)
rowRanges |
A |
countListUnknown |
A |
countListPlus |
A |
countListMinus |
A |
colData |
A |
mapBiasExpMean |
A 3D |
phase |
A |
aquals |
A 4-D array containing the countinformation, see details |
verbose |
Makes function more talkative |
... |
arguments passed on to SummarizedExperiment constructor |
countsUnknown |
An array containing the countinformation |
countsPlus |
An array containing the countinformation |
countsMinus |
An array containing the countinformation |
genotype |
matrix |
The resulting ASEset object is based on the RangedSummarizedExperiment class, and will therefore inherit the same accessors and ranges operations.
If both countListPlus and countListMinus are given they will be used to calculate countListUnknown, which is the sum of the plus and minus strands.
countListPlus, countListMinus and countListUnknown are i.e. the outputs from the getAlleleCounts function.
aquals is new for the devel branch and will be changed slighly before the relase to include better granularity.
ASEsetFromCountList
returns an ASEset
object.
ASEsetFromCountList
requires the same input data as a
RangedSummarizedExperiment, but with minimum one assay for the allele counts.
Jesper R. Gadin, Lasse Folkersen
#make example alleleCountListPlus set.seed(42) countListPlus <- list() snps <- c('snp1','snp2','snp3','snp4','snp5') for(snp in snps){ count<-matrix(rep(0,16),ncol=4,dimnames=list( c('sample1','sample2','sample3','sample4'), c('A','T','G','C'))) #insert random counts in two of the alleles for(allele in sample(c('A','T','G','C'),2)){ count[,allele]<-as.integer(rnorm(4,mean=50,sd=10)) } countListPlus[[snp]] <- count } #make example alleleCountListMinus countListMinus <- list() snps <- c('snp1','snp2','snp3','snp4','snp5') for(snp in snps){ count<-matrix(rep(0,16),ncol=4,dimnames=list( c('sample1','sample2','sample3','sample4'), c('A','T','G','C'))) #insert random counts in two of the alleles for(allele in sample(c('A','T','G','C'),2)){ count[,allele]<-as.integer(rnorm(4,mean=50,sd=10)) } countListMinus[[snp]] <- count } #make example rowRanges rowRanges <- GRanges( seqnames = Rle(c('chr1', 'chr2', 'chr1', 'chr3', 'chr1')), ranges = IRanges(1:5, width = 1, names = head(letters,5)), snp = paste('snp',1:5,sep='') ) #make example colData colData <- DataFrame(Treatment=c('ChIP', 'Input','Input','ChIP'), row.names=c('ind1','ind2','ind3','ind4')) #make ASEset a <- ASEsetFromCountList(rowRanges, countListPlus=countListPlus, countListMinus=countListMinus, colData=colData)