Solved

DNA validation

Posted on 2009-05-15
1
197 Views
Last Modified: 2012-05-07
I'm trying to write a perl script in the form of a loop which basically scans through a sequence:

$dna =
acgcatgcatcagtcagatcgtacgatagXagtagtgatgatatg
cagtcagtacgPcagactgcatagctQcagtacgactcgatata

you'll notice in a dna sequence of a's c's g's and t's there are anomolies in $dna. I'm trying to write a loop which recognises all characters that arn't a c g or t and change them to "a" by default. Basically add some validation to sequence scanning.

Thanks.
0
Comment
Question by:StephenMcGowan
1 Comment
 
LVL 39

Accepted Solution

by:
Adam314 earned 500 total points
ID: 24397686

$dna =~ s/[^acgt]/a/g;

Open in new window

0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question