提交 7c4d9541 编写于 作者: rictjo's avatar rictjo

liquid

上级 48cdbdd0
......@@ -491,11 +491,12 @@ the definition for the mitochondrion is fully contained within the melanosome me
In this [example](https://gist.githubusercontent.com/richardtjornhammar/e84056e0b10f8d550258a1e8944ee375/raw/e44e7226b6cb8ca486ff539ccfa775be981a549c/example9.py) we do exactly this for two gaussian point clouds. The dbscan search is just a single line `dbscan ( data_frame = point_cloud_df , eps=0.45 , minPts=4 )`, while the last lines are there to plot the [results](https://bl.ocks.org/richardtjornhammar/raw/0cc0ff037e88c76a9d65387155674fd1/?raw=true) ( has [graph revision dates](https://gist.github.com/richardtjornhammar/0cc0ff037e88c76a9d65387155674fd1/revisions) )
# Notes
These examples were meant as illustrations of some of the codes implemented in the impetuous-gfa package. The impetuous visualisation codes requires [Bokeh](https://docs.bokeh.org/en/latest/index.html) and are still being migrated to work with the latest Bokeh versions.
If you like these concepts and approaches then might also enjoy reading "Computer Simulations of Liquids" by "Allen and Tildesley" for and undergraduate introduction to some important concepts in Biological Physics.
# Manually updated code backups for this library :
GitLab: https://gitlab.com/richardtjornhammar/impetuous
......
......@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
setuptools.setup(
name = "impetuous-gfa",
version = "0.69.0",
version = "0.69.1",
author = "Richard Tjörnhammar",
author_email = "richard.tjornhammar@gmail.com",
description = "Impetuous Quantification, a Statistical Learning library for Humans : Alignments, Clustering, Enrichments and Group Analysis",
......
......@@ -635,7 +635,7 @@ def select_from_distance_matrix(boolean_list,distance_matrix):
def calculate_rdf ( particles_i=None , particles_o=None , nbins=100 ,
distance_matrix = None , bInGroup = None , bNotInGroup = None ,
n_dimensions = 3 , xformat="%.3f" ) :
n_dimensions = 3 , xformat="%.3f" , bLiquidState=True, constant=4.0/3.0) :
import operator
crit1 = particles_i is None and particles_o is None
......@@ -644,10 +644,10 @@ def calculate_rdf ( particles_i=None , particles_o=None , nbins=100 ,
if not crit2 :
particles_i = distance_matrix_to_absolute_coordinates ( \
select_from_distance_matrix ( bInGroup , distance_matrix ) ,
n_dimensions = 2 )
n_dimensions = n_dimensions )
particles_o = distance_matrix_to_absolute_coordinates ( \
select_from_distance_matrix ( bNotInGroup , distance_matrix ) ,
n_dimensions = 2 )
n_dimensions = n_dimensions )
else :
particles_i = particles_i.T
particles_o = particles_o.T
......@@ -659,7 +659,10 @@ def calculate_rdf ( particles_i=None , particles_o=None , nbins=100 ,
X_ = 0.5*(X[1:]+X[:1])
bUse = [ x<rmax/2.0 for x in X_ ]
rd = X_
dd = Y_ / len(rdf_p)
norm = len(rdf_p)
if bLiquidState :
norm = constant * np.pi * ( ( X_ + np.diff(X) )**n_dimensions - X_**n_dimensions )*len(rdf_p)
dd = Y_ / norm
rd = [ r for r,b in zip(rd,bUse) if b ]
dd = [ y for y,b in zip(dd,bUse) if b ]
bar_source = {'density_values': dd, 'density_ids':[ xformat % (d) for d in rd ] }
......@@ -667,7 +670,7 @@ def calculate_rdf ( particles_i=None , particles_o=None , nbins=100 ,
else :
print ( """calculate_rdf ( particles_i=None , particles_o=None , Nbins=100 ,
distance_martix = None, bInGroup = None, bNotInGroup = None ,
n_dimensions = 3 )""")
n_dimensions = 3 , xformat="%.3f" , bLiquidState=True, constant=4.0/3.0 )""")
exit ( 1 )
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册