use of de.bioforscher.jstructure.efr.model.Start2FoldResidueAnnotation in project jstructure by JonStargaryen.
the class Start2FoldXmlParser method parse.
public static void parse(Chain chain, InputStream inputStream) {
try {
// assign baseline resp. entry container for each residue
chain.aminoAcids().forEach(aminoAcid -> aminoAcid.getFeatureContainer().addFeature(new Start2FoldResidueAnnotation()));
Document document = Jsoup.parse(inputStream, "UTF-8", "/");
Elements experimentElements = document.getElementsByTag("experiment");
logger.debug("found {} experiments", experimentElements.size());
List<Experiment> experiments = experimentElements.stream().map(Experiment::parse).collect(Collectors.toList());
for (Experiment experiment : experiments) {
assignValues(experiment, chain);
}
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
use of de.bioforscher.jstructure.efr.model.Start2FoldResidueAnnotation in project jstructure by JonStargaryen.
the class Start2FoldXmlParser method parseSpecificExperiment.
public static void parseSpecificExperiment(Chain chain, InputStream inputStream, List<Integer> experimentIds) {
logger.debug("ids: {}", experimentIds);
try {
// assign baseline resp. entry container for each residue if not already happened
chain.aminoAcids().filter(aminoAcid -> !aminoAcid.getFeatureContainer().getFeatureOptional(Start2FoldResidueAnnotation.class).isPresent()).forEach(aminoAcid -> aminoAcid.getFeatureContainer().addFeature(new Start2FoldResidueAnnotation()));
Document document = Jsoup.parse(inputStream, "UTF-8", "/");
Elements experimentElements = document.getElementsByTag("experiment");
List<Experiment> experiments = experimentElements.stream().map(Experiment::parse).filter(experiment -> experimentIds.contains(experiment.getExperimentId())).collect(Collectors.toList());
logger.debug("processing {} experiments", experiments.size());
if (experimentIds.size() != experiments.size()) {
throw new IllegalArgumentException("did not find all referenced experiments");
}
for (Experiment experiment : experiments) {
assignValuesForEarly(experiment, chain);
}
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
use of de.bioforscher.jstructure.efr.model.Start2FoldResidueAnnotation in project jstructure by JonStargaryen.
the class Start2FoldXmlParser method parseStability.
public static void parseStability(Chain chain, InputStream inputStream) {
try {
// assign baseline resp. entry container for each residue if not already happened
chain.aminoAcids().filter(aminoAcid -> !aminoAcid.getFeatureContainer().getFeatureOptional(Start2FoldResidueAnnotation.class).isPresent()).forEach(aminoAcid -> aminoAcid.getFeatureContainer().addFeature(new Start2FoldResidueAnnotation()));
Document document = Jsoup.parse(inputStream, "UTF-8", "/");
Elements experimentElements = document.getElementsByTag("experiment");
List<Experiment> experiments = experimentElements.stream().map(Experiment::parse).filter(experiment -> experiment.getMethod() == Method.STABILITY).collect(Collectors.toList());
for (Experiment experiment : experiments) {
assignValuesForStrong(experiment, chain);
}
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
Aggregations