|
|
| P is for Practical | |
| PerlMonks |
converting list of rankings into list of rankratio's.by BioGeek (Hermit) |
| on Aug 15, 2004 at 22:50 UTC ( [id://383173]=perlquestion: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.BioGeek has asked for the wisdom of the Perl Monks concerning the following question:
Hi monks,
I've been struggling with this one for some time now, but I can't seem to get it to work. I wan't to convert a list of rankings into a list of rankratio's. I have stored into a MySQL database the following information: gene names, and rankings for three different techniques. Step 1: for all the collumns, the lowest value should get assigned rank 1, the second lowest value 2, etc. Step 2: count the number of rankings in each column (is eaqual to 'find the ranking with the highest value'). Step 3: for each cell, divide the ranking by the 'count of rankings for that column', as to get rankratio's.
I've various code snippets lying around that do some part of the problem, but can't manage to get them into one working construct. Either it's a "illegal division by zero problem" (a column can have no elements), or then I get a "Use of uninitialized value" warning because I try to divide an undefined value. So, I wanted to get some fresh insigths, and see how the other monasterians would tackle this problem. Hope you can put me in the rigth direction. Update: Fixed typo (s/1.857/1.000/).
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||||||