Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: Matching strings from three files (three hashes)

by toolic (Bishop)
on Aug 16, 2010 at 20:27 UTC ( #855354=note: print w/replies, xml ) Need Help??

in reply to Matching strings from three files (three hashes)

I'm having a hard time following your code and question, but a simple thing for you to try quickly is Data::Dumper:
use Data::Dumper; print 'bwa ', Dumper(\%bwa); print 'Input ', Dumper(\%Input); print 'Amp ', Dumper(\%Amp);

See also Basic debugging checklist

Replies are listed 'Best First'.
Re^2: Matching strings from three files (three hashes)
by FluffyBunny (Acolyte) on Aug 16, 2010 at 21:18 UTC

    Hello toolic, Thank you for that useful code. I found out that my bwa and Input hashes are okay because they share the same key (ID), but hash Amp does not share the same key! so it makes weird data structure like this:

    I will explain again... basically bwa is an alignment program and i already ran bwa so the bwa input file (input file #1 - .sam file) contain both Reference Amplicon ID and Input sequence ID.. Hash 'Amp' contains Reference Amplicon ID and Hash 'Input' contains Input sequence ID.. so a sequence from bwa file will have Reference Amplicon ID AND Input sequence ID both. So you use these two IDs to pick a sequence in Input file #2 (Reference Amplicon ID) and a sequence in Input file #3 (Input sequence ID) and trying to print them so I can compare them later (codes for this comparison is not added yet) Should I create nested foreach to use two different keys? or is there easier way?

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2020-10-31 05:27 GMT
Find Nodes?
    Voting Booth?
    My favourite web site is:

    Results (286 votes). Check out past polls.