Question: Matrix index error when using dnet package to calculate semantic similarity of genes
0
gravatar for dolevrahat
3.2 years ago by
dolevrahat10
Israel
dolevrahat10 wrote:

Hello

I am trying to use the dnet package in R to calculate the semantic similarity of different genes to BRCA1 based on disease ontology (DO).

To do so, I am iterating over the genes list with the following code:

#initalize DAG based on DO
ig.DO <- dRDataLoader(RData = "ig.DO")
g <- ig.DO
org.Hs.egDO <- dRDataLoader(RData = "org.Hs.egDO")
dag <- dDAGannotate(g, annotations=org.Hs.egDO, path.mode="all_paths", verbose=TRUE)

#find genes annotated by DO (used later to avoid querying
#genes that are not annotated, as this invokes an error
annotated<-unique(unlist(V(dag)$annotations))
annotatable<-intersect(entrezID$entrezgene,annotated)  

#calculate semantic similarity 
DO.similarity<-sapply(entrezID$entrezgene, function(gene){
if(gene%in%annotatable){ # check if gene is the list of DO annotated genes.
sim<-dDAGgeneSim(g=dag, genes=c(BRCA1enterz,gene),
method.gene=combine_method,
method.term=sim_method, 
parallel=TRUE, verbose=TRUE)
val<-sim[as.character(BRCA1enterz),as.character(gene)]
return(val)
 }
else{return NA}
}

with entrezID and BRCA1enterz being objects defined earlier in the code containing respectively the list of enterz IDs to query, and the entrez ID for BRCA1.

While this works well for some gene, when querying entrez gene 729230 (corresponding to hgnc gene CCR2) I got the following error:

Error in intI(i, n = di[margin], dn = dn[[margin]], give.dn = FALSE) :  index larger than maximal 2

Does anyone work with this package and has any idea what the problem might be?

Thanks in advance

dnet R semantic-similarity • 990 views
ADD COMMENTlink modified 3.2 years ago • written 3.2 years ago by dolevrahat10
1
gravatar for dolevrahat
3.2 years ago by
dolevrahat10
Israel
dolevrahat10 wrote:

I have contacted the maintainer of dnet, which quickly and efficiently fixed the bug that triggered the error. The code now works properly on dnet version 1.09

ADD COMMENTlink written 3.2 years ago by dolevrahat10
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1494 users visited in the last hour