CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [hwnd] Bioinformatics task: Edit Log



yaroba
Novice

May 19, 2013, 4:29 PM


Views: 1035
Re: [hwnd] Bioinformatics task

The main fact of this program is that the 3 letters(UUU) are being converted to one letter(F).
I found a site with a lot of useful info http://sinsixx.com/tutorials/Beginning%20Perl%20for%20Bioinformatics/75.htm

by the way there is my code:

open(DUOMENYS, "<seka.txt") or die "nepavyko nuskaityti failo: $!";

$DNR = <DUOMENYS>;
$DNR =~ s/\s//g;
$ilgis = length($DNR);
$ilgis -= ($ilgis % 3);
$DNR = substr($DNR, 0, $ilgis);
$poz = 0;

while($poz < length($DNR)){
$nukleo = substr($DNR, $poz, 3);

if ($nukleo =~ /UU[UC]/) {$aminas = "F"} #Fenilalaninas
elsif ($nukleo =~ /(UU[AG])|(CU[ACGU])/) {$aminas = "L"} #Leucinas
elsif ($nukleo =~ /(UC[ACGU])|(AG[UC])/) {$aminas = "S"} #Serinas
elsif ($nukleo =~ /UA[UC]/) {$aminas = "Y"}#Tirozinas
elsif ($nukleo =~ /(UA[AG])|UGA/) {$aminas = "_"} #STOP
elsif ($nukleo =~ /UG[UC]/) {$aminas = "C"} #Cisteinas
elsif ($nukleo =~ /UGG/) {$aminas = "W"} #Triptofanas
elsif ($nukleo =~ /CC[ACGU]/) {$aminas = "P"} #Prolinas
elsif ($nukleo =~ /CA[UC]/) {$aminas = "H"} #Histidinas
elsif ($nukleo =~ /CA[AG]/) {$aminas = "Q"} #Glutaminas
elsif ($nukleo =~ /(CG[ACGU])|(AG[AG])/) {$aminas = "R"} #Argininas
elsif ($nukleo =~ /AU[UCA]/) {$aminas = "I"} #Izoleucinas
elsif ($nukleo =~ /AUG/) {$aminas = "M"} #Metioninas
elsif ($nukleo =~ /AC[ACGU]/) {$aminas = "T"} #Treoninas
elsif ($nukleo =~ /AA[UC]/) {$aminas = "N"} #Asparginas
elsif ($nukleo =~ /AA[AG]/) {$aminas = "K"} #Lizinas
elsif ($nukleo =~ /GU./) {$aminas = "V"} #Valinas
elsif ($nukleo =~ /GC[ACGU]/) {$aminas = "A"} #Alaninas
elsif ($nukleo =~ /GA[UC]/) {$aminas = "D"} #Asparto r&#363;gštis
elsif ($nukleo =~ /GA[AG]/) {$aminas = "E"} #Glutamo r&#363;gštis
elsif ($nukleo =~ /GG[ACGU]/) {$aminas = "G"} #Glicinas
else {$aminas = "X"} #nežinomas

$baltymas .= $aminas;

$poz += 3;
}

close(DUOMENYS);

open(REZULTATAI, ">isvedimas.txt");
print REZULTATAI $baltymas;
close(REZULTATAI);


(This post was edited by yaroba on May 19, 2013, 5:11 PM)


Edit Log:
Post edited by yaroba (Novice) on May 19, 2013, 4:33 PM
Post edited by yaroba (Novice) on May 19, 2013, 5:11 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives