hi all,
the "column" is in a text file. fyi, david's pattern matching expression
(/^[ATGC]+$/i) did the job perfectly.
thanks all for you feedback!
anjan

On Tue, Sep 23, 2008 at 5:07 AM, sanket vaidya <[EMAIL PROTECTED]>wrote:

>
>
>
> Hi Anjan,
>        Not able to get where your "column" is. I am Assuming your column is
> in Text file. However even if it is not in text file, then also this may
> provide you a fair hint about how to proceed further.
>
> use warnings;
> use strict;
> open FH,"example.txt" or die "Cannot open file: $!"; #(example.txt is file
> containing your column)
> undef $/;
> my $text = <FH>;
> $text=~s/[^AGTC]//g; #remove anything which is not A,G,T or C
> print "$text"; # $text will contain your required output
>
> Let me know if this helps.
>
> Thanks
> Sanket Vaidya
>
>
> -----Original Message-----
> From: ANJAN PURKAYASTHA [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, September 23, 2008 6:52 AM
> To: beginners@perl.org
> Subject: pattern matching question
>
> here is my problem:
> i have to check the entries of a column and write them out to a file if
> they
> happen to be DNA sequences ie they are exclusively composed of the letters
> A, T, G, C- no spaces or digits.
> the column also happens to have other strings that are made of
> word/digit/space characters.
> i tried
> if($x=~ /[ATGC]/ )then .....
> however this pattern matching expression is unable to filter out the
> non-DNA
> sequences.
> i have also tried other expressions too convoluted to write out here.
>
> any ideas?
>
> tia,
> anjan
>
> --
> =============================
> anjan purkayastha, phd
> bioinformatics analyst
> whitehead institute for biomedical research
> nine cambridge center
> cambridge, ma 02142
>
> purkayas [at] wi [dot] mit [dot] edu
> 703.740.6939
>
>
> http://www.patni.com
> World-Wide Partnerships. World-Class Solutions.
> _____________________________________________________________________
>
> This e-mail message may contain proprietary, confidential or legally
> privileged information for the sole use of the person or entity to whom this
> message was originally addressed. Any review, e-transmission dissemination
> or other use of or taking of any action in reliance upon this information by
> persons or entities other than the intended recipient is prohibited. If you
> have received this e-mail in error kindly delete this e-mail from your
> records. If it appears that this mail has been forwarded to you without
> proper authority, please notify us immediately at [EMAIL PROTECTED] and
> delete this mail.
> _____________________________________________________________________
>



-- 
=============================
anjan purkayastha, phd
bioinformatics analyst
whitehead institute for biomedical research
nine cambridge center
cambridge, ma 02142

purkayas [at] wi [dot] mit [dot] edu
703.740.6939

Reply via email to