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
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