Hash of array printing issue.

Joined
Jul 20, 2009
Messages
1
Reaction score
0
This is the data:
CHR08FS019528015 . . 19528015 19528064 5.00E-20 . . 8
CHR08FS019528015 . . 19528091 19528140 5.00E-20 . . 8
CHR08FS019528217 . . 19528217 19528266 5.00E-20 . . 8
CHR08FS019528217 . . 19528273 19528322 5.00E-20 . . 8

I want to use hash of array to merge the first two lines and the last two lines with the scripts below:



while (<>){
chomp;
@t=split /\t/;
push (@{ $Objs{$t[0]} }, $t[1], $t[2], $t[3], $t[4], $t[5], $t[6], $t[7], $t[8]) ;
}

for $Obj (keys %Objs ){
print "$Obj\t";
print join("\t", @{ $Objs{$Obj}});
print "\n";



It should be like this
CHR08FS019528015 . . 19528015 19528064 5.00E-20 . . 8 . . 19528091 19528140 5.00E-20 . . 8
CHR08FS019528217 . . 19528217 19528266 5.00E-20 . . 8 . . 19528273 19528322 5.00E-20 . . 8


but the real output is this:

CHR08FS0.9528217. 19528273. 19528322 5.00E-20 ..00E-20. 8 . 8
CHR08FS0.9528015. 19528091. 19528140 5.00E-20 ..00E-20. 8 . 8


I checked all the hash array element has the correct data, just the output is incorrect, it seems the second part of the data overlapped with the first part, how come??? Who can help???

thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top