I am new to biojava and am trying to convert a user inputted DNA sequence and get the protein sequence as the output. Below is the code that I have so far.
import java.util.Scanner;
import org.biojava.bio.seq.DNATools;
import org.biojava.bio.seq.ProteinTools;
import org.biojava.bio.seq.RNATools;
import org.biojava.bio.symbol.IllegalSymbolException;
import org.biojava.bio.symbol.SymbolList;
public class translation {
public static void main(String[] args) {
System.out.println("Please enter a DNA sequence: ");
Scanner input = new Scanner(System.in);
String input1 = input.nextLine();
SymbolList dna = DNATools.createDNA(input1);
SymbolList rna = RNATools.createRNA(dna);
SymbolList aa = ProteinTools.createProtein(rna);
}
catch (IllegalSymbolException ex) {
System.out.println("The protein is: " aa);
}
}
}
Please login or Register to submit your answer