rivettda / rivet-python Goto Github PK
View Code? Open in Web Editor NEWPython API for RIVET
License: BSD 3-Clause "New" or "Revised" License
Python API for RIVET
License: BSD 3-Clause "New" or "Revised" License
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
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:
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!
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.
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?
rivetTDA/rivet#143 identified that the format for bifiltrations (as opposed to point clouds or metric spaces) has changed recently in RIVET, the tests (and possibly the file generator for bifiltrations) need to be updated.
hilbert_distance which is imported in the example seems not to exist in the library. Is there a new update with this class?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.