Search in sources :

Example 1 with AminoAcidModification

use of org.nextprot.api.commons.bio.variation.prot.impl.seqchange.AminoAcidModification in project nextprot-api by calipho-sib.

the class SingleModificationBEDFormat method parse.

@Override
public SequenceVariation parse(String source, SequenceVariationBuilder.FluentBuilding builder) throws ParseException {
    Matcher m = PATTERN.matcher(source);
    if (m.matches()) {
        AminoAcidModification aaChange = AminoAcidModification.valueOfAminoAcidModification(m.group(1));
        AminoAcidCode affectedAA = AminoAcidCode.parseAminoAcidCode(m.group(2) + ((m.group(3) != null) ? m.group(3) : ""));
        int affectedAAPos = Integer.parseInt(m.group(4));
        return builder.selectAminoAcid(affectedAA, affectedAAPos).thenAddModification(aaChange).build();
    }
    return null;
}
Also used : Matcher(java.util.regex.Matcher) AminoAcidModification(org.nextprot.api.commons.bio.variation.prot.impl.seqchange.AminoAcidModification) AminoAcidCode(org.nextprot.api.commons.bio.AminoAcidCode)

Aggregations

Matcher (java.util.regex.Matcher)1 AminoAcidCode (org.nextprot.api.commons.bio.AminoAcidCode)1 AminoAcidModification (org.nextprot.api.commons.bio.variation.prot.impl.seqchange.AminoAcidModification)1