Open jma1991 opened 1 year ago
After some more exploration, this might be related to #5 as I've spotted the quotation character in some other node files:
The GoTerm-part000.csv has a 3',5'
string in one of the entries:
go:0097657\t'3',5'-nucleotide bisphosphate phosphatase activity'\t'Open Targets'\t'https://platform-docs.opentargets.org/licence'\t'22.11'\t'go:0097657'\t'go'\tBiologicalEntity|Entity|GoTerm|NamedThing
Likewise, the Efo.Disease-part000.csv has a Crohn's
string in one of the entries:
efo:0005622\t'http://www.ebi.ac.uk/efo/EFO_0005622'\t'Crohn's colitis'\t'Crohn's disease affecting the colon.'\t\t'Open Targets'\t'https://platform-docs.opentargets.org/licence'\t'22.11'\t'efo:0005622'\t'efo'\tBiologicalEntity|Disease|DiseaseOrPhenotypicFeature|Efo.Disease|Entity|NamedThing
Hi @jma1991, thanks for the report and the thorough description!
Funny error indeed, I think I have not yet encountered that one. If it really is connected to the quotes, I am not at all sure how we would get a 'missing header' from that. But I can confirm that the quotes are a constant source of trouble. I think I may have to add a parameter to the otar package that replaces quotes depending on which quotes the user chooses for the Neo4j files.
Can you tell me which version of the otar-biocypher
package you are using?
I have also encountered a similar issue with the quotes. (with the Disease-part000.csv) I am trying to import the graph to neo4j via neo4j-admin and get:
IMPORT FAILED in 550ms.
Data statistics is not available.
Peak memory usage: 0B
Error in input data
Caused by:ERROR in input
data source: BufferedCharSeeker[source:C:\Users\Shelig.Neo4jDesktop\relate-data\dbmss\dbms-e1730ac4-bd71-491e-aac4-3ba74af56ebb\import\Efo.Disease-part000.csv, position:31
95, line:6]
in field: description:string:4
for header: [:ID, code:string, name:string, description:string, ontology:string, source:string, licence:string, version:string, id:string, preferred_id:string, :LABEL]
raw field value: dysembryoplastic neuroepithelial tumor
original error: At C:\Users\Shelig.Neo4jDesktop\relate-data\dbmss\dbms-e1730ac4-bd71-491e-aac4-3ba74af56ebb\import\Efo.Disease-part000.csv @ position 3195 - there's a fie
ld starting with a quote and whereas it ends that quote there seems to be characters in that field after that ending quote. That isn't supported. This is what I read: 'A beni
gn glial-neuronal neoplasm. It is usually supratentorial, located, generally, in the cortex and occurs in children and young adults with a long-standing history of partial se
izures. A histologic hallmark of this tumor is the 's'
Hi @SheliO, thanks for the report. Unfortunately, quotes are really tricky to handle in a general manner, as people may have different preferences, and sometimes the operating system and Java also behave differently. Short-term solutions I tend to use are:
use a quote character in Neo4j that is very unusual, such as the "broken pipe", ¦
, ASCII code 221. The problem with this is that you have to be sure that the character you use is not in the text content, and sometimes also the character is not accepted by Neo4j (I think because of Java).
use a character replace function in the adapter, changing the quote character (e.g., single quote) to something else or removing it. This of course changes the content of the fields, which may not be desired, and also takes more time in building the DB.
convert text fields to base64 in the adapter, and then run a function in Neo4j that goes through the entire database and converts the text back to regular. This is quite involved and requires post-processing in the database after creation, so also not ideal, although it reliably solves the quote issue and does not change the text content.
Implementing any or all of these in the framework is a design decision, and I don't feel I have enough experience with the problem and community use to propose a default solution, so keeping it in the adapter would be most consistent with the BioCypher design philosophy.
What do you think, which way forward would you prefer?
Thank you @slobentanzer for your quick and detailed response. Because our goal is to upload the data on to a remote neo4j instance, we switched the effort from neo4j-admin to a python implementation that calls on APOC procedures. If you have any insights regarding this effort it will be much appreciated. Thanks
Hi @SheliO, this sounds super interesting; we have the driver module that uses the python driver (via neo4j_utils). Would be great to compare since we have not put much work in that recently, I would be interested if you do something differently.
We found initially that the driver is a bit slow for larger datasets, which is why we defaulted to the neo4j-admin
procedure so far.
Hi @SheliO, are you able to share any experiences you made with the driver connection, maybe point us to a public repo? Otherwise, feel free to close this issue.
Issue
I encountered the following error when I try to run the neo4j-admin-import-call.sh script using the latest commit d18348b:
The neo4j-admin-import-call.sh script is copied here:
Hardware
Computer: MacBook Air (M1, 2020) Chip: Apple M1 Memory: 16 GB macOS: Ventura 13.4.1
Dependencies
I installed all dependencies using conda package manager: