Morten_S has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I am doing lots of molecular simulations. I often just use native tools, but have recently started developing my own tools. As such I have a situation where i have 32 different molecules. I am interested in determining the number of clusters. So far my script works like so that i have the data angle and distance between each molecule in a txt file at each timestep.
an example could be the angle txt file:
143.2
13.4
55.6
.
.
where each new line is the subsequent timestep. The distance file is the same. The name of the files relate to the molecule 1_2.txt is the relation between molecule 1 and 2. 1_32 is relation between molecule 1 and 32. In order for the molecules to be part of a cluster the molecules need to have a angle less than 20 degrees and a distance less than 2nm. So fare I have made a very poor script that determines the molecule relations that pass these conditions and prints all of the relations to a single txt file with the notation:
1_3 1_5 5_7 9_23
1_3 1_5 5_7 9_23 14_23
1_3 1_5 5_7 9_23 14_23 17_20
.
.
each line represents the subsequent timestep. What I need to do is determine connectivity and cluster sizes. Like 1_3 1_5 5_7 9_23 14_23 17_20, molecule 1, 3, 5 and 7 is a single cluster, molecule 9, 14 and 23 is another cluster and molecule 17 and 20 is another cluster. what i need is the perl script to return something like
file for number of clusters
3
.
.
file for cluster sizes
4 3 2
.
.
sorry for the complicated question :) I have no idea how to do this :) Hope you can help.
Best regards
Morten
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Conditional connectivety
by 1nickt (Canon) on Nov 12, 2017 at 19:12 UTC | |
|
Re: Conditional connectivety
by Anonymous Monk on Nov 12, 2017 at 17:58 UTC | |
by Morten_S (Initiate) on Nov 15, 2017 at 13:46 UTC | |
|
Re: Conditional connectivety
by vr (Curate) on Nov 12, 2017 at 23:17 UTC | |
by Morten_S (Initiate) on Nov 15, 2017 at 13:56 UTC |