Search in sources :

Example 61 with Structure

use of de.bioforscher.jstructure.model.structure.Structure in project jstructure by JonStargaryen.

the class A02_WriteDatasetCsv method handleProtein.

private static String handleProtein(String pdbId, String chainIds, String thermophile) {
    System.out.println("handling " + thermophile + " protein " + pdbId + " with chains " + chainIds);
    Structure structure = StructureParser.fromPdbId(pdbId).parse();
    List<Chain> chains = chainIds.equals("Null") ? Stream.of(structure.chainsWithAminoAcids().findFirst().get()).collect(Collectors.toList()) : Pattern.compile(",").splitAsStream(chainIds).map(chainId -> {
        Optional<Chain> optionalChain = structure.select().chainId(chainId).asOptionalChain();
        return optionalChain.orElseGet(() -> structure.select().chainId(chainId.toUpperCase()).asChain());
    }).collect(Collectors.toList());
    return chains.stream().map(chain -> handleChain(pdbId, chain, thermophile)).collect(Collectors.joining(System.lineSeparator()));
}
Also used : EnergyProfile(de.bioforscher.jstructure.feature.energyprofile.EnergyProfile) Logger(org.slf4j.Logger) LoopFraction(de.bioforscher.jstructure.feature.loopfraction.LoopFraction) Files(java.nio.file.Files) ResidueTopologicPropertiesContainer(de.bioforscher.jstructure.feature.graphs.ResidueTopologicPropertiesContainer) LoggerFactory(org.slf4j.LoggerFactory) Structure(de.bioforscher.jstructure.model.structure.Structure) IOException(java.io.IOException) GenericSecondaryStructure(de.bioforscher.jstructure.feature.sse.GenericSecondaryStructure) StructureParser(de.bioforscher.jstructure.model.structure.StructureParser) Collectors(java.util.stream.Collectors) EgorAgreement(de.bioforscher.jstructure.feature.energyprofile.EgorAgreement) PLIPInteractionContainer(de.bioforscher.jstructure.feature.interactions.PLIPInteractionContainer) List(java.util.List) AccessibleSurfaceArea(de.bioforscher.jstructure.feature.asa.AccessibleSurfaceArea) Start2FoldConstants(de.bioforscher.start2fold.Start2FoldConstants) Stream(java.util.stream.Stream) ProteinGraph(de.bioforscher.jstructure.feature.graphs.ProteinGraph) ProteinGraphFactory(de.bioforscher.jstructure.feature.graphs.ProteinGraphFactory) Chain(de.bioforscher.jstructure.model.structure.Chain) Optional(java.util.Optional) StandardFormat(de.bioforscher.jstructure.StandardFormat) Pattern(java.util.regex.Pattern) Chain(de.bioforscher.jstructure.model.structure.Chain) Structure(de.bioforscher.jstructure.model.structure.Structure) GenericSecondaryStructure(de.bioforscher.jstructure.feature.sse.GenericSecondaryStructure)

Aggregations

Structure (de.bioforscher.jstructure.model.structure.Structure)61 IOException (java.io.IOException)45 Collectors (java.util.stream.Collectors)40 Chain (de.bioforscher.jstructure.model.structure.Chain)39 Files (java.nio.file.Files)35 StructureParser (de.bioforscher.jstructure.model.structure.StructureParser)30 Path (java.nio.file.Path)26 AminoAcid (de.bioforscher.jstructure.model.structure.aminoacid.AminoAcid)23 List (java.util.List)22 StandardFormat (de.bioforscher.jstructure.StandardFormat)21 Logger (org.slf4j.Logger)20 LoggerFactory (org.slf4j.LoggerFactory)20 Test (org.junit.Test)19 Group (de.bioforscher.jstructure.model.structure.Group)18 UncheckedIOException (java.io.UncheckedIOException)18 Pattern (java.util.regex.Pattern)17 Stream (java.util.stream.Stream)17 Jsoup (org.jsoup.Jsoup)17 ComputationException (de.bioforscher.jstructure.model.feature.ComputationException)16 java.util (java.util)15