Closed linas closed 4 years ago
After some guessing: this almost worked:
(gene-go-annotation (list "IGF1") "biological_process molecular_function cellular_component")
Cannot write scheme result files. system-error: (mkdir ~A (Permission denied) (13))
where are you trying to write files? Shouldn't you ask the user where to write them?
Also, ,describe gene-go-annotation
prints a lonely #f
so this needs documentation to be added. Add docs by saying
(define-public (gene-go-annotation FOO BAR)
"
The gene-go-annotation does foo to bar and needs 3 arguments.
"
(rest of code)
)
@linas if you see here, we look for a RESULT_DIR
environment variable first to see if it is defined. If it isn't defined we try to write to /root/result
. But I think we should just complain to the user the env variable isn't defined and also add it to the README.
Hmm. It would probably be best to not use environment variables, and instead pass the filename as a subroutine argument. At any rate, a simpler fix is to default to /tmp
instead of /root
-- that is what the /tmp
filesystem is meant to implement: something that any user can write to, and is automatically cleaned up every now and then. By contrast, the /root
filesystem is meant for the personal, private use of the system administrator; if a system is running well, then the sysadmin almost never logs in, and the /root
directory is almost empty.
So I suggest changing the API to be something like this:
(gene-go-annotation GENE-LIST TEXT-DESC FILEPATH)
BTW, is that some random text string, or do those strings "biological_process molecular_function cellular_component"
have some kind of meaning? If they have a meaning, then what is the complete list of valid strings? If they have meaning, then there does not seem to be any validation; I just tried "xbiologixcal_process molexcular_functixon celxxlular_componentx"
and it still worked ...
You are right. Actually, the /root
is a remnant of the days where we were running the code only inside the docker as we didn't have a build system to build it locally and we wanted to save the files under the home directory which is /root
in docker by default
Heh. Now its this:
Cannot write scheme result files. system-error: (mkdir ~A (No such file or directory) (2))
presumably because /tmp/result
doesn't exist ...
And the stuff written to the results file is identical to what gene-go-annotation
returns. Perhaps it would be easier and more straight-forward to not write anything at all? That way, if the user wants to save to a file, they just take the return-value from gene-go-annotation
and save it or do whatever-else they want with it (I'm thinking, for example, saving it to postgres, as a part of the atomspace, for example, or, just in general -- do other things with it.)
We designed the annotation-scheme as a submodule of the annotation service and one of the requirements of the annotation service is that users should get the result of an annotation run as scheme files in the future event that they want to import them into their own atomspaces. That is why we are writing the results to the filesystem.
@linas we are actually writing the results as we provide options for the user to download the scheme, CSV and JSON results of the annotation. Beside that, we have a CSV parser which reads the scheme result from the files and covert into CSV (which can actually be done with out the need to write to file actually) But we do use the files for these purposes.
Sure, but what I'm saying is that the annotation should be untangled from the file-writing. Thus, in the future, you can support other file formats; but also, maybe the user will want to annotate, and NOT write to a file (for whatever reason). It also allows annotation-servers to be built: instead of writing to a file, the annotation results are delivered on a socket, e.g. https, or whatever.
@linas are you still having issues running the code?
are you still having issues running the code?
I don't know. At this time, I am carrying so many different patches and hacks, that I have not re-tried on a clean, fresh system. I'll close this, and then later, when the dust clears, we can retry again on a freshly installed system.
So, following the README, I loaded
datasets/smpdb_chebi_wname.scm
and thenwhich gives
So the leading single-quote seems wrong, single quotes are short-handle for
(quote stuff)