Skip to content

Instantly share code, notes, and snippets.

@nherbaut
Created October 5, 2023 11:08
Show Gist options
  • Save nherbaut/d0117c9d989a487bf8ea7ecbba2cbe5f to your computer and use it in GitHub Desktop.
Save nherbaut/d0117c9d989a487bf8ea7ecbba2cbe5f to your computer and use it in GitHub Desktop.
L2.3.5 Recherche Simple de gènes

Implementez la méthode findGeneSimple pour trouver les gènes dans les brins d'ADN

import java.io.*;
public class TagFinder {
public static String findGeneSimple(String dna) {
//codon début = ATG
//codon fin = TAA
return "";
}
public static void main(String ...args) {
{
String dna1 = "ATGGGGTTTAAATAATAATAG";
String gene1 = findGeneSimple(dna1);
System.out.println(gene1);
}
{
String dna2 = "AAATGCCCATGGGGTTTAAATAATAATAGTTCAA";
String gene2 = findGeneSimple(dna2);
System.out.println(gene2);
}
// et si la chaine ne contient pas ATG?
{
String dna3 = "GGCTATTTAGGGTTAA";
String gene3 = findGeneSimple(dna3);
System.out.println(gene3);
}
// et si la chaine ne contient pas TAA
{
String dna4 = "ATGGGCTATTTAGGGTTAG";
String gene4 = findGeneSimple(dna4);
System.out.println(gene4);
}
//et si les codons étaient groupés par 3?
{
String dna3 = "ATGGTTAA";
String gene3 = findGeneSimple(dna3);
System.out.println(gene3);
}
}
}
@nherbaut
Copy link
Author

nherbaut commented Oct 5, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment