Search in sources :

Example 1 with SimpleSymbolList

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

the class PlainParser method parse.

@Override
public DNASequence parse(String textSequence) throws InvalidFormatParserException {
    SymbolList sl;
    try {
        textSequence = cleanSequence(textSequence);
        sl = new SimpleSymbolList(DNATools.getDNA().getTokenization("token"), textSequence.replaceAll("\\s+", "").replaceAll("[\\.|~]", "-").replaceAll("[0-9]", ""));
    } catch (BioException e) {
        throw new InvalidFormatParserException("Couldn't parse Plain sequence!", e);
    }
    return new DNASequence(sl.seqString());
}
Also used : DNASequence(org.jbei.ice.lib.dto.DNASequence) BioException(org.biojava.bio.BioException) SimpleSymbolList(org.biojava.bio.symbol.SimpleSymbolList) SymbolList(org.biojava.bio.symbol.SymbolList) SimpleSymbolList(org.biojava.bio.symbol.SimpleSymbolList)

Aggregations

BioException (org.biojava.bio.BioException)1 SimpleSymbolList (org.biojava.bio.symbol.SimpleSymbolList)1 SymbolList (org.biojava.bio.symbol.SymbolList)1 DNASequence (org.jbei.ice.lib.dto.DNASequence)1