Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: Little pattern problem...

by CombatSquirrel (Hermit)
on Aug 22, 2003 at 17:34 UTC ( #285875=note: print w/replies, xml ) Need Help??

in reply to Little pattern problem...

Have a look at Regex with variables?. From what I understood this might be what you need.
Cheers, CombatSquirrel.
Update: Or maybe in your case, the following might help as well:
#!perl use strict; use warnings; my ($curr, $probe, $target, $pos, $sense); for (<DATA>) { if (/>probe:(\w+):(\w+):\d+:\d+;\s+Interrogation_Position=(\d+);\s+ +(\w+);/) { ($probe, $target, $pos, $sense) = ($1, $2, $3, $4); if ($curr and $curr ne $target) { if ($curr) { ### do processing for mismatch here } $curr = $target; } else { $curr = $target if (!$curr); ### do processing for target here } } else { ### do processing for probe sequence here } } __DATA__ >probe:MOE430A:1415670_at:549:177; Interrogation_Position=2436; Antise +nse; GGCTGATCACATCCAAAAAGTCATG >probe:MOE430A:1415670_at:549:177; Interrogation_Position=2513; Antise +nse; GAGGAAACGTTCACCCTGTCTACTA >probe:MOE430A:1415670_at:467:433; Interrogation_Position=2521; Antise +nse; GTTCACCCTGTCTACTATCAAGACA >probe:MOE430A:1415670_at:254:643; Interrogation_Position=2533; Antise +nse; TACTATCAAGACACTCGAAGAGGCT >probe:MOE430A:1415670_at:54:269; Interrogation_Position=2556; Antisen +se; CTGTGGGCAATATTGTGAAGTTCCT >probe:MOE430A:1415670_at:405:339; Interrogation_Position=2583; Antise +nse; GAATGCATCCTTGTGAGAGGTCAGA >probe:MOE430A:1415670_at:60:395; Interrogation_Position=2597; Antisen +se; GAGAGGTCAGACAAAGTGCCAGAAA >probe:MOE430A:1415670_at:284:165; Interrogation_Position=2619; Antise +nse; AAAACAAGAACACCCACACGCTGCT >probe:MOE430A:1415670_at:622:145; Interrogation_Position=2634; Antise +nse; ACACGCTGCTGCTAGCTGGAGTATT >probe:MOE430A:1415670_at:291:661; Interrogation_Position=2804; Antise +nse; TATCTTGTCCAACACTACGTCGAAG >probe:MOE430A:1415670_at:146:701; Interrogation_Position=2956; Antise +nse; TTGTCACCATGCCTGCAAGGAGAGA >probe:MOE430A:1415671_at:116:525; Interrogation_Position=1156; Antise +nse; GGAACAGGAATGTCGCAACATCGTA >probe:MOE430A:1415671_at:655:137; Interrogation_Position=1173; Antise +nse; ACATCGTATGGATTGCTGAGTGCAT >probe:MOE430A:1415671_at:398:139; Interrogation_Position=1232; Antise +nse;

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://285875]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2018-07-19 09:48 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (405 votes). Check out past polls.