Dear toolic,
This script works beautifully on my dummy data.

When I run it using my real files I get an error message that repeats itself line after line until I stop it.

Use of uninitialized value in string eq at HUGOID_extract.pl line 50, <$GENEFILE> line 1.

Line 50 is -if ($genes2 eq $hugo$i) -

I am confused as to why it would work on dummy data but not real.
My only thoughts are that in the IDs file (DUMMYHUGO) there are up to 28 columns with aliases for genes names (for which I want to return the HUGO ID (hopefully this is clear from my initial post). However, not all gene names have 28 alises.

With the dummy data, there was always an 'eq' for the gene name. In the real files there may not be. Is it possible that if there is no match in the DUMMYHUGO file that the script doesn't know how to move on?

I have added some code after your if loop (below)

if ($genes[2] eq $hugo[$i]) { print $OUT "$genes[0]\t$genes[1]\t$genes[2]\t$genes[3] +\t$hugo[1]\n"; })


My code is as follows (looks a little squiffy here but still):
#added by me else { print $OUT "$genes[0]\t$genes[1]\t$genes[2]\t$ +genes[3]\tHUGO_notfound\n"; $i++; }


I still get the infinite error though.
Any further ideas that can help?
Thanks again.

In reply to Re^2: (Failing) script to return an official ID by Anonymous Monk
in thread (Failing) script to return an official ID by Anonymous Monk

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.