Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: Matching strings from three files (three hashes)

by FluffyBunny (Acolyte)
on Aug 16, 2010 at 21:18 UTC ( #855360=note: print w/replies, xml ) Need Help??


in reply to Re: Matching strings from three files (three hashes)
in thread Matching strings from three files (three hashes)

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
Node Status?
node history
Node Type: note [id://855360]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2020-10-24 17:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (246 votes). Check out past polls.

    Notices?