Pogledajte određenu poruku
Staro 21. 12. 2011.   #1
webarto
expert
Grand Master
 
Avatar webarto
 
Datum učlanjenja: 11.04.2010
Poruke: 998
Hvala: 141
959 "Hvala" u 153 poruka
webarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished road
Default DNA, codons, proteins

Viagra Jezik nebitan. Zna li neko?

Given a string representing DNA, return a list of strings each representing one of the proteins coded for by the DNA.

(Some details of DNA and protein are ignored here, you should ignore them too)

DNA is represented as a string whose characters are all in the set [ACGT].
Proteins are represented as a string whose characters are all in the set [GAVLIMFWPSTCYNQDEKRH].
Three adjacent characters in DNA represent a codon. DNA is read one codon at a time and translated into protein. Reading starts with a start codon and stops at a stop codon.

There is one start codon, ATG, which also codes for the protein M (which means for the purposes of these problems that all proteins begin with M). ATG only acts as a start codon if it is not in between another start/stop codon pair.

There are three stop codons, TAA, TAG, and TGA. These do not code for a character in the resulting protein, they simply terminate the protein.

For example, here is a short sequence of DNA:

ACATGGTGCACCTGACTCTCATTTGAGATATAAAAAAACCATGAGATCGA TGGCGCTACGCATAATATAAAAA

It is translated as follows:

(junk) M V H L T L I STOP (junk) M R S M A L R I I STOP (junk)
ACCTCCAAC-ATG-GTG-CAC-CTG-ACT-CTC-ATT-TGA-GATATAAAAAAACC-ATG-AGA-TCG-ATG-GCG-CTA-CGC-ATA-ATA-TAA-AAAAGGCCA

So given the above protein as input your program should return:
MVHLTLI
MRSMALRII

IN
Citat:
// Codons
AAA K Lys
AAC N Asn
AAG K Lys
AAT N Asn
ACA T Thr
ACC T Thr
ACG T Thr
ACT T Thr
AGA R Arg
AGC S Ser
AGG R Arg
AGT S Ser
ATA I Ile
ATC I Ile
ATG M Met*
ATT I Ile
CAA Q Gln
CAC H His
CAG Q Gln
CAT H His
CCA P Pro
CCC P Pro
CCG P Pro
CCT P Pro
CGA R Arg
CGC R Arg
CGG R Arg
CGT R Arg
CTA L Leu
CTC L Leu
CTG L Leu
CTT L Leu
GAA E Glu
GAC D Asp
GAG E Glu
GAT D Asp
GCA A Ala
GCC A Ala
GCG A Ala
GCT A Ala
GGA G Gly
GGC G Gly
GGG G Gly
GGT G Gly
GTA V Val
GTC V Val
GTG V Val
GTT V Val
TAA X STOP
TAC Y Tyr
TAG X STOP
TAT Y Tyr
TCA S Ser
TCC S Ser
TCG S Ser
TCT S Ser
TGA X STOP
TGC C Cys
TGG W Trp
TGT C Cys
TTA L Leu
TTC F Phe
TTG L Leu
TTT F Phe
// DNA
ACATGGTGCACCTGACTCTCATTTGAGATATAAAAAAACCATGAGAGCGA TGGCGCTACGCATAATATAAAAA
OUT
Citat:
MVHLTLI
MRAMALRII
__________________
Github // LinkedIn // PHP // ZCE // Stackoverflow PHP // Site5 Web Hosting

Poslednja izmena od webarto : 21. 12. 2011. u 01:01.
webarto je offline   Odgovorite uz citat