Conversion of affymetrix annotation environment to matrix
1
0
Entering edit mode
@michael-watson-iah-c-378
Last seen 10.3 years ago
Hi I want to convert the drosgenome1GO environment to a matrix with columns: Affy-probe_id, GOID, GOEvidence, GOOntology I have figured out that if I do: lis <- as.list(drosgenome1GO) lis2 <- lis[!is.na(lis)] m <- matrix(unlist(lis2), ncol=3, byrow=TRUE) I get something approaching what I want (ie a matrix with columns GO ID, GO Evidence and GO Ontology), but I also want the actual affy probe ids in there as a column (I eventually want to do a table join from the output of topTable() to this table) Thanks Mick
GO affy convert GO affy convert • 553 views
ADD COMMENT
0
Entering edit mode
@wolfgang-huber-3550
Last seen 3 months ago
EMBL European Molecular Biology Laborat…
Hi Michael, fun = function(i) { res = matrix(unlist(lis[[i]]), ncol=3, byrow=TRUE) cbind(rep(names(lis)[i], nrow(res)), res) } z = do.call("rbind", lapply(seq(along=lis), fun)) will do (see below), I wonder if anybody can give a simpler solution! Best wishes Wolfgang > z [,1] [,2] [,3] [,4] [1,] "155157_at" "GO:0006281" "NAS" "BP" [2,] "155157_at" "GO:0016538" "ISS" "MF" [3,] "155157_at" "GO:0016538" "NAS" "MF" [4,] "155122_at" NA NA NA [5,] "155036_at" NA NA NA [6,] "154985_at" NA NA NA [7,] "154948_at" "GO:0003743" "ISS" "MF" [8,] "154948_at" "GO:0005085" "IDA" "MF" [9,] "154948_at" "GO:0005085" "ISS" "MF" michael watson (IAH-C) wrote: > Hi > > I want to convert the drosgenome1GO environment to a matrix with > columns: > > Affy-probe_id, GOID, GOEvidence, GOOntology > > I have figured out that if I do: > > lis <- as.list(drosgenome1GO) > lis2 <- lis[!is.na(lis)] > m <- matrix(unlist(lis2), ncol=3, byrow=TRUE) > > I get something approaching what I want (ie a matrix with columns GO ID, > GO Evidence and GO Ontology), but I also want the actual affy probe ids > in there as a column (I eventually want to do a table join from the > output of topTable() to this table) > > Thanks > Mick ------------------------------------- Wolfgang Huber European Bioinformatics Institute European Molecular Biology Laboratory Cambridge CB10 1SD England Phone: +44 1223 494642 Fax: +44 1223 494486 Http: www.ebi.ac.uk/huber
ADD COMMENT

Login before adding your answer.

Traffic: 659 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6