Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Adding missing values into a hash

by Biopolete (Initiate)
on Jun 19, 2014 at 14:32 UTC ( [id://1090475]=note: print w/replies, xml ) Need Help??


in reply to Re: Adding missing values into a hash
in thread Adding missing values into a hash

Thank you very much for your answer :)

Your answer seems quite interesting but I don't know why but I obtain too many "NA".

With de first part of the script I obtain for example

AA=> NA, NA,1,2,5,NA,NA,NA,NA,NA

instead of

AA=> 1,2,5

Perhaps is related with

my (undef,%hash) = split /[\t;=]/,$line;

because you are spliting 3 times, I don't know.

The final csv is

AA => NA,NA,NA

AB => NA,NA,NA

AC => NA,NA,NA

Perhaps is because the problem with de "NA".

Replies are listed 'Best First'.
Re^3: Adding missing values into a hash
by poj (Abbot) on Jun 19, 2014 at 15:00 UTC

    Do you have other lines in the file apart from those like
    ##INFO=<ID=AA, and 1 AA=1;AB=2;AC=3 ? Blank lines for example.

    poj

      No, I don't have any other lines in the file :(

      I have the same problem if I use your complete script with:

      __DATA__

      ##INFO=<ID=AA,

      ##INFO=<ID=AB,

      ##INFO=<ID=AC,

      1 AA=1;AB=2;AC=3

      2 AA=2;AB=2

      3 AA=5;AB=1;AC=1

      I only obtain "NA" values in CVS file

        Check you have a tab character between between 1 and AA=1, 2 and AA=2, 3 and AA=5, not spaces

        poj

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1090475]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2024-04-24 20:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found