Search in sources :

Example 6 with SymbolList

use of org.biojava.bio.symbol.SymbolList in project ice by JBEI.

the class SequenceUtils method translateToProtein.

/**
     * Calculate the amino acid translation of the given dnaSequence string.
     *
     * @param dnaSequence DNA sequence to translate.
     * @return String of amino acid symbols.
     * @throws UtilityException
     */
public static String translateToProtein(String dnaSequence) throws UtilityException {
    SymbolList symL = null;
    try {
        symL = DNATools.createDNA(dnaSequence);
        symL = DNATools.toProtein(symL);
    } catch (IllegalSymbolException | IllegalAlphabetException e) {
        throw new UtilityException(e);
    }
    return symL.seqString();
}
Also used : IllegalAlphabetException(org.biojava.bio.symbol.IllegalAlphabetException) IllegalSymbolException(org.biojava.bio.symbol.IllegalSymbolException) SymbolList(org.biojava.bio.symbol.SymbolList)

Aggregations

SymbolList (org.biojava.bio.symbol.SymbolList)6 IllegalSymbolException (org.biojava.bio.symbol.IllegalSymbolException)4 IllegalAlphabetException (org.biojava.bio.symbol.IllegalAlphabetException)3 DNASequence (org.jbei.ice.lib.dto.DNASequence)2 BioException (org.biojava.bio.BioException)1 SimpleSymbolList (org.biojava.bio.symbol.SimpleSymbolList)1 DNAFeature (org.jbei.ice.lib.dto.DNAFeature)1 ABITrace (org.jbei.ice.lib.parsers.abi.ABITrace)1 FeatureDAO (org.jbei.ice.storage.hibernate.dao.FeatureDAO)1 SequenceDAO (org.jbei.ice.storage.hibernate.dao.SequenceDAO)1 SequenceFeatureDAO (org.jbei.ice.storage.hibernate.dao.SequenceFeatureDAO)1 Feature (org.jbei.ice.storage.model.Feature)1 Sequence (org.jbei.ice.storage.model.Sequence)1 SequenceFeature (org.jbei.ice.storage.model.SequenceFeature)1