ravimore has asked for the wisdom of the Perl Monks concerning the following question:
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Pattern Matching using Array
by LanX (Saint) on Jul 23, 2010 at 11:11 UTC | |
please try to update it and add tags like <p>,<c> ...
Cheers Rolf UPDATE: since you're a beginner ----------------- I wanna match array element patterns($pats[$i]) with the row sequence($str). Also find the overlapping region location in the sequence($str). Please help me. But my loop is not work properly. Thanks. INPUT FILES: seq.txt >seq1 AAAAAA >seq2 TTTTT pat.txt seq1 AAAAA TTTTT GGGGG I want following output: Patterns sequence name start end length of seq. AAAAA seq1 1 5 6 AAAAA seq1 2 6 6 TTTTT seq2 1 5 5 not found GGGGG I wrote following PERL script:
--------------- | [reply] [d/l] [select] |
|
Re: Pattern Matching using Array
by jwkrahn (Abbot) on Jul 23, 2010 at 15:47 UTC | |
You need a space between the program name and any switches you need to pass to the program. Better to just use the warnings pragma:
You should always verify that the file opened correctly:
That could more simply be written as:
You don't put any values into @residue so that is the same as saying:
Perhaps you meant to use $residue instead of @residue?
Instead of five separate prints you just need one:
That is usually written as:
You exit the program at the bottom of the loop so you only ever read one line from your 'pat.txt' file. | [reply] [d/l] [select] |
|
Re: Pattern Matching using Array
by MidLifeXis (Monsignor) on Jul 23, 2010 at 15:13 UTC | |
Also see BioPerl. --MidLifeXis | [reply] |