/** * Load a {@link Structure} from MMTF either from the local file system. * @param pdbId the input PDB id * @return the {@link Structure} object of the parsed structure * @throws IOException error reading from Web or file system */ private Structure loadStructureFromMmtfByPdbId(String pdbId) throws IOException { logger.debug("Loading structure {} from mmtf file.", pdbId); MMTFFileReader reader = new MMTFFileReader(); reader.setFetchBehavior(fetchBehavior); reader.setObsoleteBehavior(obsoleteBehavior); Structure structure = reader.getStructureById(pdbId.toLowerCase()); return structure; }
public static void main(String[] args) throws Exception { MMTFFileReader reader = new MMTFFileReader(); FileParsingParameters params = new FileParsingParameters(); reader.setFileParsingParameters(params); Structure struc = reader.getStructureById("1m4x"); System.out.println(struc); }