Login

Join for Free!
118908 members
table of contents table of contents

Biology Articles » Bioinformatics » Introductory Workbook on Perl for Biology Students » 8. Perl program for DNA to RNA transcription

8. Perl program for DNA to RNA transcription
- Introductory Workbook on Perl for Biology Students

The objective of the program is to convert the DNA string to RNA string. We store the DNA in $dna. We translate the T to U in the dna and store it back in $dna. This translated DNA is then copied to $rna. The base UGC is substituted by “start” in the RNA and the number of times it has been substituted is stored in $start Count. We would need this to find the actual length of the RNA.

 

When we find the length of the RNA it counts every character in the RNA. Therefore, it also counts all the letters of the word “start”. We need to remove this number from the total length of the RNA to get the actual length. Hence in the 10th line, we do a subtraction between the length of the RNA and the $start Count which is multiplied by 5 (as the start contains 5 letters). This actual length is stored in $length.

 

1.    #program for transcribing

2.    $dna="TGCAGCGAAATGT";

3.    ($dna=~tr/T/U/);

4.    $rna=$dna;

5.    print"translated seq:$rna\n";

6.    #Show start codon in RNA

7.    $startCount=($rna=~(s/UGC/start/));

8.    print"the start seq:$rna\n";

9.    #length of rna

10.     $length=(length($rna)-5*$startCount);

11.     print"length of RNA:$length\n";

 

 

RESULTS:

 

translated seq: UGCAGCGAAAUGU

the start seq: startAGCGAAAUGU

length of RNA:10

rating: 3.70 from 114 votes | updated on: 30 Jan 2009 | views: 95196 |

Rate article:







excellent!bad…