/** * Constructs a new {@link MMTFFileReader}, initializing the extensions member variable. * The path is initialized to the given path, both autoFetch and splitDir are initialized to false. */ public MMTFFileReader(String path) { super(path); addExtension(".mmtf"); addExtension(".mmtf.gz"); }
/** * 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); }