If you wanted them back into their original order, you have another step to make.

#! perl -slw use strict; my @data = map{ chomp; [ split '\s*\|\s*', $_ ] } <DATA>; my @counts; for my $field ( 1 .. 3 ) { my $rank = 0; @data = map { $_->[ $field ] and $_->[ $field ] = ++$rank; $_; } sort { ( $a->[ $field ]||0 ) <=> ( $b->[ $field ]||0 ) } @data; $counts[ $field ] = $rank; } for my $data ( @data ) { map { $data->[ $_ ] and $data->[ $_ ] = sprintf '%5.3f', $data->[ $_ ] /= $counts[ $_ ]; } 1 .. 3; } print join "\t", @$_ for @data; __DATA__ ENSG00000179050 | | | 4 ENSG00000124183 | 237 | | 2 ENSG00000179033 | | | 7 ENSG00000124181 | | 13 | 1 ENSG00000174306 | | | 5 ENSG00000132793 | | | 8 ENSG00000183798 | | | 6 ENSG00000124177 | | | 3 ENSG00000087530 | 153 | | ENSG00000185513 | 258 | | ENSG00000101052 | 231 | | ENSG00000124249 | 154 | 7 | ENSG00000101098 | 159 | | ENSG00000166913 | 141 | | __OUTPUT__ P:\test>383173 ENSG00000166913 0.143 ENSG00000087530 0.286 ENSG00000101098 0.571 ENSG00000101052 0.714 ENSG00000185513 1.000 ENSG00000124249 0.429 0.500 ENSG00000124181 1.000 0.125 ENSG00000124183 0.857 0.250 ENSG00000124177 0.375 ENSG00000179050 0.500 ENSG00000174306 0.625 ENSG00000183798 0.750 ENSG00000179033 0.875 ENSG00000132793 1.000

Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
"Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon

In reply to Re: converting list of rankings into list of rankratio's. by BrowserUk
in thread converting list of rankings into list of rankratio's. by BioGeek

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.