[BioC] ask for some code to remove absent genes

Stefano Calza stecalza at tiscali.it
Thu May 12 16:14:59 CEST 2005


something like

wG = apply(matrix,1,FUN=function(x) sum(x == "P") > 13)
matrixNew = matrix[wG,]

should work

HIH

Stefano


On Thu, May 12, 2005 at 01:56:54PM +0000, zhihua li wrote:
<zhihua>hi netters,
<zhihua>
<zhihua>i have a gene expression matrix where rows are genes and columns are 
<zhihua>conditions. The values are either "A"(absent) or "P"(present). There are 15 
<zhihua>conditions in total. If a gene is absent in most of these conditions, say 
<zhihua>at least 13 out of the 15 values are "A", then I would like to remove this 
<zhihua>gene from the matrix. So finally I'll get a new matrix with only those 
<zhihua>genes that are present in at least 2 of the conditions. Could anyone give 
<zhihua>me a hint about how to write the code? 
<zhihua>
<zhihua>Thanks a lot!
<zhihua>
<zhihua>_______________________________________________
<zhihua>Bioconductor mailing list
<zhihua>Bioconductor at stat.math.ethz.ch
<zhihua>https://stat.ethz.ch/mailman/listinfo/bioconductor

-- 
Stefano Calza, PhD
Sezione di Statistica Medica e Biometria
Dip. di Scienze Biomediche e Biotecnologie
Università degli Studi di Brescia - Italia
Viale Europa, 11 25123 Brescia
email: calza at med.unibs.it
Telefono/Phone: +390303717532
Fax: +390303717488

Section of Medical Statistics and Biometry
Dept. Biomedical Sciences and Biotechnology
University of Brescia - Italy



More information about the Bioconductor mailing list