Erinevus lehekülje "ITI0011-2015:harjutus 03" redaktsioonide vahel

Allikas: Kursused
Mine navigeerimisribale Mine otsikasti
(Uus lehekülg: '<source lang="java"> →‎* * Home assignment 03. * * Read more: https://courses.cs.ttu.ee/pages/ITI0011:harjutus_03: public class Task03 { /** * Given a string, check wh...')
 
1. rida: 1. rida:
 +
 +
Kirjutada 4 funktsiooni:
 +
* etteantud sõne puhul leiab, kas see on korrektne DNA järjestus (koosneb vaid sümbolitest A, C, G, T)
 +
* etteantud sõne puhul leiab kõige rohkem esineva sümboli esinemiste arvu
 +
* etteantud sõne puhul teisendab DNA ahela RNA ahelaks, teisendused: A -> U, G -> C, C -> G, T -> A
 +
* etteantud sõne puhul teisendab DNA ahelda proteiini ahelaks.
 +
 
<source lang="java">
 
<source lang="java">
 
/**
 
/**
45. rida: 52. rida:
 
* Given a possible DNA string, transcribe it to RNA
 
* Given a possible DNA string, transcribe it to RNA
 
* and then translate RNA to protein sequence.
 
* and then translate RNA to protein sequence.
 +
* See http://rosalind.info/glossary/rna-codon-table/
 
* @param dnaSequence Possible DNA sequence.
 
* @param dnaSequence Possible DNA sequence.
 
* @return Translated protein sequence. In case the input
 
* @return Translated protein sequence. In case the input

Redaktsioon: 12. veebruar 2015, kell 07:57

Kirjutada 4 funktsiooni:

  • etteantud sõne puhul leiab, kas see on korrektne DNA järjestus (koosneb vaid sümbolitest A, C, G, T)
  • etteantud sõne puhul leiab kõige rohkem esineva sümboli esinemiste arvu
  • etteantud sõne puhul teisendab DNA ahela RNA ahelaks, teisendused: A -> U, G -> C, C -> G, T -> A
  • etteantud sõne puhul teisendab DNA ahelda proteiini ahelaks.

<source lang="java"> /**

* Home assignment 03.
* 
* Read more: https://courses.cs.ttu.ee/pages/ITI0011:harjutus_03
*/

public class Task03 {

/** * Given a string, check whether it represents a valid * DNA sequence, e.g. it contains only A, C, G, T characters. * @param sequence Possible DNA sequence. * @return Whether the given sequence is a valid DNA sequence. */ public static boolean isValidDnaSequence(String sequence) { return true; }

/** * Given a string, find what is the highest * occurrence of one nucleotide base (A, C, G, or T). * @param dnaSequence Possible DNA sequence. * @return The number representing how many times the most * frequent nucleotide base occurs in the string. In case * the input sequence is not a valid DNA sequence, returns -1. */ public static int highestOccurrence(String dnaSequence) { return 0; }

/** * Given a possible DNA string, transcribe it to RNA. * In the transcription process, you have to do the * following substitutions: * A -> U, G -> C, C -> G, T -> A * @param dnaSequence Possible DNA sequence. * @return Transcribed RNA. In case the input sequence * is not a valid DNA sequence, returns null. */ public static String transcribe(String dnaSequence) { return ""; }

/** * Given a possible DNA string, transcribe it to RNA * and then translate RNA to protein sequence. * See http://rosalind.info/glossary/rna-codon-table/ * @param dnaSequence Possible DNA sequence. * @return Translated protein sequence. In case the input * sequence is not a valid DNA sequence, returns null. */ public static String translateProtein(String dnaSequence) { return ""; }

/** * The main method, which is the entry point of the program. * !!IMPORTANT!! You have to keep the main method in order * to get your solution tested. * @param args Arguments from the command line */ public static void main(String[] args) { System.out.println(isValidDnaSequence("ACTGT")); // => true System.out.println(highestOccurrence("AACT")); // => 2 System.out.println(transcribe("ACAGCT")); // => UGUCGA System.out.println(translateProtein("ACAGCT")); // => CR

}

}

</source>