use of org.nextprot.api.isoform.mapper.domain.impl.exception.InvalidFeatureQueryTypeException in project nextprot-api by calipho-sib.
the class SequenceFeatureBase method newFeature.
public static SequenceFeature newFeature(SingleFeatureQuery query) throws FeatureQueryException {
// throw exception if invalid query
query.checkFeatureQuery();
AnnotationCategory annotationCategory = AnnotationCategory.getDecamelizedAnnotationTypeName(query.getFeatureType());
try {
switch(annotationCategory) {
case MUTAGENESIS:
case VARIANT:
return new SequenceVariant(query.getFeature());
case GENERIC_PTM:
return new SequenceModification(query.getFeature());
default:
throw new InvalidFeatureQueryTypeException(query);
}
} catch (ParseException e) {
throw new InvalidFeatureQueryFormatException(query, e);
}
}
Aggregations