Benson has asked for the wisdom of the Perl Monks concerning the following question:
ALLOWED=("AA","AG","GC","GT","CA","CG","TT","TC "); DISALLOWED=("AC","AT","GG","GA","CC","CT","TG","TA")
using the above DISALLOWED regions when the program reads the input file it should chop(break) and continue. For the ALLOWED region it should not chop unless it finds a disallowed character. And also at the end of each line if the last character of each line and the first character of next line is in the ALLOWED region it should not chop. And also if the character N comes in between the sequence it should be chopped also. For Ex
CTGTCAGCNNNCCGGTTTTCAAGNNGAGCACACACCAAAAATGCACCAAAGCTTNACATCCATACAAA
For the above input sequence the output should be
C T GTCAGC NNN C CG GTTTTCAAG NN G AGCA CA CA C CAAAAA T GCA C CAAAGC TT N A CA TC CA T A CAAA
Edit: g0n - added code tags
2005-10-19 Retitled by g0n, as per Monastery guidelines
Original title: 'substring'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Extracting a substring according to some criteria
by blazar (Canon) on Oct 19, 2005 at 12:07 UTC | |
|
Re: Extracting a substring according to some criteria
by blokhead (Monsignor) on Oct 19, 2005 at 16:08 UTC | |
by Benson (Initiate) on Oct 20, 2005 at 07:19 UTC | |
|
Re: Extracting a substring according to some criteria
by Skeeve (Parson) on Oct 19, 2005 at 11:42 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |