Hi,
I am trying to bulid the relationship between my nodes.
However, the "variable not defined "error messages keep pop up in my neo4j browser, even though the variable existed.
When I run this
LOAD CSV WITH HEADERS FROM 'file:///genes2hallmark.csv' AS link
MATCH (g:gene{ENS_ID: topTable.ID}),(hmgs:HMGS{hallmark_gene_sets: hmgenesets.hallmark_genesets})
WITH g, hmgs
MERGE (g)-[r:BELONG]->(hmgs)
Gives me the error message:
Variable
topTable
not defined (line 2, column 23 (offset: 86))
"MATCH (g:gene{ENS_ID: topTable.ID}),(hmgs:HMGS{hallmark_gene_sets: hmgenesets.hallmark_genesets})"
Anyone can give me a hints about this?
Thank you so much.
My code and data --------------------------------------------------------------------------------------------------------------------------- - neo4j version 3.5.14, browser version 3.2.26 - API / driver: I am using neo4j browser
My cypher query as following (I run them in order): > USING PERIODIC COMMIT 1000 > LOAD CSV WITH HEADERS FROM 'file:///hmgs.csv' AS hmgenesets > MERGE (hmgs:HMGS{hallmark_gene_sets: hmgenesets.hallmark_genesets}) > WITH hmgs > MATCH (hmgs) > RETURN (hmgs)
USING PERIODIC COMMIT 500
LOAD CSV WITH HEADERS FROM 'file:///topTable.csv' AS topTable
MERGE (g:gene
{ENS_ID: topTable.ID,
log_FG: topTable.logFC,
Average_Expression: topTable.AveExpr,
t_test: topTable.t,
P_value: topTable.P_Value,
Adjusted_P_value: topTable.adj_P_Val,
entrez_id: topTable.entrezid,
gene_name: topTable.gene_name})
WITH (g)
MATCH (g)
RETURN (g)
LOAD CSV WITH HEADERS FROM 'file:///genes2hallmark.csv' AS link
MATCH (g:gene{ENS_ID: topTable.ID}),(hmgs:HMGS{hallmark_gene_sets: hmgenesets.hallmark_genesets})
WITH g, hmgs
MERGE (g)-[r:BELONG]->(hmgs)
The topTable.csv looks like this:
ID,logFC,AveExpr,t,P_Value,adj_P_Val,entrezid,gene_name
E971,3,8,3,8,1,5,FO
E938,3,8,3,8,1,5,F
The geneshallmark.csv looks like this:
gene_id,geneset
E938,HALLMARK_A
E971,HALLMARK_C
E971,HALLMARK_C
The hmgs.csv looks like this:
hallmark_genesets
HALLMARK_A
HALLMARK_C