Write a program that scans a given DNA string for incorrect nucleotides (i.e other than A,G,C,T) and replace them with a *
Example input
AGUCGACFTGCTCGATC
Example output
AG*CGAC*TGCTCGATC
check out my blog to find weekly problems in perl and new bioinformatics posts
Isn't U one of the nucleotide bases? When translated T becomes U right? Correct me if I am wrong but m-RNA sequences will contain U, and so a * must be placed at places other than A,T, C, G and U. But if we are looking at an m-RNA sequence then, there must be no T's. So how do you propose to approach this problem? This can definitely be applied to areas of data curation in new databases.
ReplyDeleteThats why I have specified 'DNA' string. DNA when transcribed into mRNA have 'U'.(T in DNA will be converted to U in mRNA).Translation is a different process where mRNA is converted to protein.DNA strings wont contain 'U'.They will contain only AGCT . mRNA will contain AGCU. So u have to place a * at U also.
ReplyDeleteHERE IS A SOLUTION TO PERL PROBLEM 4 BY AMIT
ReplyDeletemy $input="AGUCGACFTGCTCGATC";
my @temp=split("",$input);
my $output="";
foreach my $char ( @temp ) {
if ( $char =~ /[AGCT]/ ) {
$output .= $char;
}
else
{
$output .= "*";
}
}
print "\n Output : $output \n";
chomp($input = <>);
ReplyDelete$input =~ s/[^AGTC]/\*/g;
print "$input\n";