Code Monkey home page Code Monkey logo

rivet-python's People

Contributors

mlesnick avatar xoltar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

rivet-python's Issues

Question: Homology dimension clarification

Hi, I was hoping you could provide some clarification on the homology parameter that is used in methods such as rivet.betti.

As stated in "Persistent Homology for Virtual Screening", the ith Betti number corresponds to the number of i-dimensional holes
Screen Shot 2020-09-01 at 9 57 41 AM

However, from working with the API in this repository and exploring the RIVET GUI, I am not sure how the homology parameter comes into play. That is, even if I set, homology=0 for example, I seem to have access to information about 1-dimensional and 2-dimensional holes:
Screen Shot 2020-09-01 at 9 59 30 AM

Therefore, I was hoping to get a better understanding of what the homology parameter is doing, e.g. if I am working with 3D coordinates of molecules and I want to calculate L2 hilbert-distance between two molecules, what determines whether I should set homology=0, 1, 2...?

Thanks in advance for any help!

Error with matching_distance function in iPython example

Do you know what might have caused the following error when I try to replicate what is shown in your ipython example with the matching_distance function? I managed to get the same results on all other parts of the notebook. I am using Linux and a Python 3.7 under Conda environment. Thanks!

Error in file /tmp/tmpahk85_rb/self.txt, line number 15: cannot parse "--"
ERROR:root:Failure in invocation of Hera, input files copied to error-hera-yellow-31885-1553538069.0262306 for reference
Traceback (most recent call last):
  File "/home/milad/anaconda3/envs/myenvpy37/lib/python3.7/site-packages/pyrivet/hera.py", line 86, in multi_bottleneck_distance
    ["bottleneck_dist", t1_name, t2_name, str(relative_error)])
  File "/home/milad/anaconda3/envs/myenvpy37/lib/python3.7/subprocess.py", line 395, in check_output
    **kwargs).stdout
  File "/home/milad/anaconda3/envs/myenvpy37/lib/python3.7/subprocess.py", line 487, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['bottleneck_dist', '/tmp/tmpahk85_rb/self.txt', '/tmp/tmpahk85_rb/other.txt', '1e-10']' returned non-zero exit status 1.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/milad/anaconda3/envs/myenvpy37/lib/python3.7/site-packages/pyrivet/matching_distance.py", line 99, in matching_distance
    [bars for (_, bars) in multi_bars2]
  File "/home/milad/anaconda3/envs/myenvpy37/lib/python3.7/site-packages/pyrivet/hera.py", line 86, in multi_bottleneck_distance
    ["bottleneck_dist", t1_name, t2_name, str(relative_error)])
  File "/home/milad/anaconda3/envs/myenvpy37/lib/python3.7/subprocess.py", line 395, in check_output
    **kwargs).stdout
  File "/home/milad/anaconda3/envs/myenvpy37/lib/python3.7/subprocess.py", line 487, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['bottleneck_dist', '/tmp/tmpahk85_rb/self.txt', '/tmp/tmpahk85_rb/other.txt', '1e-10']' returned non-zero exit status 1.

visualize Hilbert functions from precomputed RIVET data?

Apologies for this simple query. I'm wondering if rivet-python has a way to take pre-computed RIVET data (i.e. the output file of rivet_console) and plot the Hilbert functions?

I see in the API demo examples where the rivet.betti_file command is used on metric space data (standard rivet_console input). This outputs a rivet.MultiBetti object, and this has a graded_rank call for the Hilbert function, that can be plotted.

What I don't see is how to recover the MultiBetti object from precomputed RIVET data.

I suppose I could recompute like in the API demo, but several of my computations took 12+ hours, and I'd like to save some time.

If I'm reading the code for betti_file correctly, it looks like I need to take the screen output from rivet_console (i.e. not the file output) and parse that with _parse_betti. Here is the primary part of betti_file:

_parse_betti(subprocess.check_output(shlex.split(cmd)).split(b'\n'))

I don't know the check_output command in subprocess well, but from what I can see it is essentially returning the screen output from the call to rivet_console.

Is there not an easy way to recover this information from the text file output of rivet_console?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.