Description Usage Arguments Details Value Author(s) See Also Examples
This function selects columns of a matrix that correspond to 1 or 2 factor levels of attendant vector.
1 | MiDataSample(Matrix, specimens, group1, group2 = NULL)
|
Matrix |
matrix |
specimens |
factor vector with length equal to number of |
group1 |
value of factor level to sample |
group2 |
additional value of factor level to sample |
This function is ment for sampling specimens in gene/transcript expression matrix for binary classification
in case when specimens belong to more than two groups. The aim is to create gene/transcript expression
matrix that contains specimens for only 1 or 2 groups.
Groups are specified in corresponding factor vector that contains specimens description.
It should be used together with MiSpecimenSample
that samples specimens'
description in the same way.
Matrix
with rescricted number of columns that correspond to specimens from 1 or 2 groups.
Elena N. Filatova
1 2 3 4 5 6 7 8 9 10 11 12 | #get gene expression and specimen data
data("IMexpression");data("IMspecimen")
dim(IMexpression) # 100 columns (genes/transcripts) - 89 specimens
colnames(IMexpression)[1:10] # look at first 10 columns of matrix - specimens IDs
IMspecimen[1:10,] # specimens IDs and group factor - diagnoses in attendant vector
# note that specimens in matrix columns are in the same order as specimens in description data
# select specimens with only EBV and NORM diagnoses (and sample the description data as well)
SampleMatrix<-MiDataSample(IMexpression, IMspecimen$diagnosis, "ebv", "norm")
SampleSamples<-MiSpecimenSample(IMspecimen$diagnosis, "ebv", "norm")
dim(SampleMatrix)# only 68 specimens with EBV and NORM diagnoses left
colnames(SampleMatrix)[1:10]
SampleSamples[1:10] # corresponding diagnoses
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.