PDB-REDO / dssp

Application to assign secondary structure to proteins
BSD 2-Clause "Simplified" License
157 stars 18 forks source link

feature request: input/ouput without writting files to disk #81

Closed lmiq closed 3 months ago

lmiq commented 3 months ago

Dear authors,

We have been using DSSP to analyze molecular dynamics simulations. We have wrapped it into a package that performs this analysis by writing each frame of a trajectory to a PDB file and then using DSSP to read it and compute the output, which has to be read then again.

Is there any chance to provide an interface in which these input/output data does not need to be written to the disk? For example by providing a command line parameter such as -input_file """CRYST \n ATOM ...""" or something of the sort?

PS: If the input/output was less PDB/mmCIF format centric (meaning, if the data passed was just the lower-level data that is required for the computations) that would be even better.

Thank you.

mhekkel commented 3 months ago

Dear Leandro,

Of course it is possible to change mkdssp to read from stdin when no file is specified. But there are alternatives. First of all, mkdssp (the program) is a light wrapper around libdssp. You could try to create a Julia plugin (if at all possible) that provides access to DSSP directly. A bit of work but might be worth the effort.

Another option is to use named pipes. You can create a fifo using system calls (use man 3 mkfifo for documentation) and pass that to mkdssp. That will create a temp file, but will not write to disk. You still have to remove the fifo after running mkdssp.

The last option is available right now and will be similar in performance to using a popen like setup, the option you are asking for.

lmiq commented 3 months ago

Thanks for the tips! I'll try that out!