Solved

DNA validation

Posted on 2009-05-15
1
202 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Perl 101 11 81
Awk Question 2 129
Insert Text into odbc.ini file 15 67
Put query string from URL request -  PERL HTTP Daemon 2 85
Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
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…

829 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