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


In reply to Conditional connectivety by Morten_S

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.