Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Matching strings from three files (three hashes)

by toolic (Bishop)
on Aug 16, 2010 at 20:27 UTC ( [id://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:

    Amp $VAR1 = { 'Seq1Perfect' => [], 'Seq6TruncB' => [], 'Seq7TruncF' => [], 'Seq3In' => [], 'TMEM200B' => [ 'TMEM200B', 'TTTTTTTGTTTGGTTGGTTTTGATTTGAGTGGTTTTTTTGGTG +TTTAGTTTAA GTTGTTTTTGTTGTAGTTTTGTTGTGGGTG +GAGGAGGTTTGGAAGGAGGGGGTGGGTAGGGAGAGGTTGGAGTTGGTGAT + GTTTTTTTTTTTTGTGTTGTGGTATGTAAAGTATAGTAGGGGGGAGGTGGGGTTTGGTG +AGTGATTTTTGTGGATTTGGG AGGTTTGAGTGTTTTTGTT +TTATTTGTTATGGTGTAGTTATGTGTGGGGGTGGGGTTGAGTTTGGGAGGTATTTATTTTG + GAGA' ], 'Seq4Del' => [], 'Seq2MM' => [], 'B3GAT2-2_P001' => [ 'B3GAT2-2_P001', 'GGTTGGTTTTTATTTTTTGGAAGAGTTTTAGATTATAG +GTGTTGTTGT TGTTAGTGAAGAAGAGTATGTTGGGTTGTG +TGTGTTGGTGTTGGTGTTTTTGGTGTAGTTAGGTGAGGTTTGTGTTGTGT + TGTTTAGTGGTGTGTGGTAGTTTGGGTTGTTTGTAGTGTTGTGGTGTGGGTATGTGTAG +GTGAGTGTTGGGTAGTT' ], 'Seq5Partial' => [] };
    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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-18 05:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found