PDA

View Full Version : URGENT HELP!!! Search


Tsuyoshi
07-09-2005, 04:58 PM
Hi, would really appreciate if anyone can help mi out.

Does anyone know how to search for a string from a of strings and compare and then display it out?

String 1
Example:ATCTACTATCATCATCAJNJKDAJDNJAJDHASUENNCNLNACNKJH

Search for 'TCA' then from there on then compare with another string like 'JDH' . after comparing print out only that length.

Result will be: TCATCATCAJNJKDAJDNJAJDH

Anyone know plz help mi out.THANKS A LOTS!!!!!!!!!

livecdbiz
07-09-2005, 07:34 PM
You can use regular expression to extract it
something like TCA*JDH

see this url, about extracting words
http://www.scit.wlv.ac.uk/~jphb/perl/pod/perlretut.html#extracting%20matches

Tsuyoshi
07-09-2005, 07:54 PM
Thanks for replying.

I had read through the website you gave me on extracting matches.Howver it didn't mentions the things that i wnated.

Wonder if you could help me out on it.Thanks.

I need to extract out the strings based on the start codon of 'ATG' till the end codons 'TGA','TAA' and 'TAG'

I have tried the blelow codes. but it doesn't seems to works.

my @matches = $sequence =~ /(ATG(.*?)TAG)/gi;

foreach (@matches) {


print "\n Matched: $_\n";
}

livecdbiz
07-09-2005, 09:24 PM
Is this what you want to do?

$sequence = "JJATG123ABCTAG223";
my @matches = $sequence =~ /(ATG.*TAG)/gi;
my @matches = $1 . $2 . $3;
foreach (@matches) {
print "\n Matched: $_\n";
}

-----------output-------------
Matched: ATG123ABCTAG