Entering edit mode
Auer Michael
▴
250
@auer-michael-953
Last seen 10.2 years ago
Only recently I have posted the problem of not having the
corresponding
Affy IDS and Locus IDS to the significant nodes from a GOHyperG
application.
I think this is a problem every body encounters sooner or later when
working with gene ontologies.
I have a temporary solution which performs quite well.
So here is the code:
input:
GOLOCmap: This is the result from applying GOALLLOCUSID to the set of
significant GO IDS. Its a list and every element corresponds to a
certain
GO ID and the entries to the LOCUS IDS mapping on it.
LOC: This are the AffyIDS and the corresponding LOCUS IDS, a vector.
It
comes from applying hgu133aLOCUSID to a set of AffyIDS.
The function looks for the Locus IDS (LOC) in the entries of every
element
of the list GOLOCmap.
The result is a list. Every element corresponds to a certain GO ID and
the
entries are the ocurring AffyIDS.
Locus_Affy_fromGO<-function(GOLOCmap,LOC)
{
LOCs<-sort(LOC)
maximum<-max(LOCs)
output<-as.list(1:length(names(GOLOCmap)))
res<-0
for (i in 1:length(names(GOLOCmap)))
{
output[[i]]<-list(GOID=names(GOLOCmap)[[i]],LOCUSIDSAffyIDS=c(1,2))
GOLOCmaps<-sort(GOLOCmap[[i]])
j<-1
while(GOLOCmaps[j]<= maximum)
{
if(j>=length(GOLOCmaps)) break
res<-c(res,LOCs[LOCs==GOLOCmaps[j]])
j<-j+1
}
output[[i]]$LOCUSIDSAffyIDS <-res[-1]
res<-0
}
output
}
I hope it is useful for some of you. And please let me know if any
bugs
are occuring.
Best regards
Michael