Dear list,
I do have a list of (all) human GO categories and associated genes, and I would like to remove the genes that are annotated as "IEA" (inferred from electronic annotation). http://geneontology.org/page/guide-go-evidence-codes
Sounds like an easy exercise, however, I cannot get this to work.... Any pointer on how to achieve this would be very appreciated!
Guido
> library(org.Hs.eg.db)
> xx <- as.list (org.Hs.egGO2ALLEGS)
> xx[1]
$`GO:0000002`
TAS IDA TAS IEA ISS IMP IEA IEA IEA NAS IMP IEA IMP
"291" "1763" "1890" "3980" "4205" "4358" "5428" "9093" "9361" "9361" "10000" "10891" "30968"
IEA IMP IMP NAS IEA IEA IMP TAS IMP IEA
"50484" "55022" "56652" "56652" "80119" "83667" "92667" "92667" "201973" "246243"
>
> # check evidence codes genes belonging to 1st category
> xx[[1]]
TAS IDA TAS IEA ISS IMP IEA IEA IEA NAS IMP IEA IMP
"291" "1763" "1890" "3980" "4205" "4358" "5428" "9093" "9361" "9361" "10000" "10891" "30968"
IEA IMP IMP NAS IEA IEA IMP TAS IMP IEA
"50484" "55022" "56652" "56652" "80119" "83667" "92667" "92667" "201973" "246243"
>
#get rid of genes that are IEA
> i= 1
> xx[[i]][names(xx[[i]])!="IEA"]
TAS IDA TAS ISS IMP NAS IMP IMP IMP IMP NAS IMP TAS
"291" "1763" "1890" "4205" "4358" "9361" "10000" "30968" "55022" "56652" "56652" "92667" "92667"
IMP
"201973"
>
How to loop this? So i will end up with a list in which for each GO categorie all IEA genes are removed
for (i in 1:length(xx)) { .... ???
Thanks James, very useful, as always. Works like a charm!
Guido