Every atom name breaks down into 4 parts, which I already have broken up. The function atomName, simply returns the concatenation of all 4 parts.

Column 1 & 2 are the actual atomic element(1 or 2 letters, right-justified) except in the case of hydrogens, where column 1 is actually the number of the hydrogen.

Column 3 is the distance specified by a greek letter

Column 4, mostly empty, is the number of the heavy atom at the distance.

eg Leucine has two 'CD's so they are CD1 and CD2. the hydrogens respectively are: 1HD1, 2HD1, 3HD1, 1HD2, 2HD2 and 3HD3.

So weight can indeed be given. The highest weight would be given to atomnames that consist of the element only, N, C and O, and also to the 'first' Carbon, CA.

Thereafter, it matters little which heavy atom, only the distance is important, so the second tier of weights will be given to the distance: B,G,D,E,Z,H

Finally, the hydrogens are last, and their weights are threefold, their number followed by their distance, followed by their heavy atom number at that distance.

I'd started to 'weigh' things within the sortAtom function mentioned below this way:

foreach my $a (@names){ if($a->atomName eq 'N'){ $main{1}=$a; }elsif($a->atomName eq 'CA'){ $main{2}=$a; }elsif($a->atomName eq 'C'){ $main{3}=$a; }elsif($a->atomName eq 'O' || $a->atomName eq 'O\''){ $main{4}=$a; } }
my aim was to then do this:
foreach my $i (sort {$a <=> $b} keys %main){ push @values, $main{$i}; }
Is this what you're getting at browserUk?

Thanks
Sam


In reply to Re: Re: sorting according to greek alphabet in roman letters by seaver
in thread sorting according to greek alphabet in roman letters by seaver

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.