package org.biojava.nbio.structure.io;

import java.io.IOException;
import java.io.InputStream;

import org.biojava.nbio.structure.Structure;
import org.biojava.nbio.structure.io.mmtf.MmtfActions;

/**
 * A class to read MMTF files and cache them locally.
 * @author Anthony Bradley
 *
 */
public class MMTFFileReader extends LocalPDBDirectory {
	
	
	public static final String[] MMTF_SPLIT_DIR    = new String[]{"data","structures","divided" ,"mmtf"};
	public static final String[] MMTF_OBSOLETE_DIR = new String[]{"data","structures","obsolete","mmtf"};
	
	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);
	}
	
	
	@Override
	public Structure getStructure(InputStream inStream) throws IOException {
		return MmtfActions.readFromInputStream(inStream);
	}

	@Override
	protected String getFilename(String pdbId) {
		return pdbId.toLowerCase()+".mmtf.gz";
	}

	@Override
	protected String[] getSplitDirPath() {
		return MMTF_SPLIT_DIR;
	}

	@Override
	protected String[] getObsoleteDirPath() {
		return MMTF_OBSOLETE_DIR;
	}
	

}

@@ -135,16 +135,80 @@
 ucture;%0A
+import org.biojava.nbio.structure.align.util.UserConfiguration;%0A
 import o
@@ -254,16 +254,16 @@
 ctions;%0A
-
 %0A/**%0A * 
@@ -674,17 +674,16 @@
 ption %7B%0A
-%0A
 %09%09MMTFFi
@@ -912,18 +912,691 @@
 uc);%0A%09%7D%0A
-
 %09%0A
+%09/**%0A%09 * Constructs a new %7B@link MMTFFileReader%7D, initializing the extensions member variable.%0A%09 * The path is initialized in the same way as %7B@link UserConfiguration%7D,%0A%09 * i.e. to system property/environment variable %7B@link UserConfiguration#PDB_DIR%7D.%0A%09 * Both autoFetch and splitDir are initialized to false%0A%09 */%0A%09public MMTFFileReader() %7B%0A%09%09this(null);%0A%09%7D%0A%09%0A%09/**%0A%09 * Constructs a new %7B@link MMTFFileReader%7D, initializing the extensions member variable.%0A%09 * The path is initialized to the given path, both autoFetch and splitDir are initialized to false.%0A%09 */%0A%09public MMTFFileReader(String path) %7B%0A%09%09super(path);%0A%09%09addExtension(%22.mmtf%22);%0A%09%09addExtension(%22.mmtf.gz%22);%09%0A%09%09%7D%0A
 %09%0A%09@Over

Add constructors for the MMTFFilereader