Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.biojava.bio.structure.io
Class MMCIFFileReader

    java.lang.Object
      org.biojava.bio.structure.io.MMCIFFileReader

All Implemented Interfaces:
  StructureIO, StructureIOFile

    public class MMCIFFileReader

extends Object
implements StructureIOFile

How to parse an mmCif file:

      public static void main(String[] args){
            String filename =  "/path/to/something.cif.gz" ;

            StructureIOFile reader = new MMCIFFileReader();

            try{
                Structure struc = reader.getStructure(filename);
                System.out.println(struc);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

Since:
  1.7
Author:
  Andreas Prlic

Constructor Summary
`MMCIFFileReader()`

Method Summary
`void` | `addExtension(String ext)` add a known File extension.
`void` | `clearExtensions()` clear all file extensions
`String` | `getPath()` get the directory path to the files
`Structure` | `getStructure(File filename)` Opens filename, parses it and returns a Structure object.
`Structure` | `getStructure(String filename)` Opens filename, parses it and returns a Structure object .
`Structure` | `getStructureById(String pdbId)` Get a structure by PDB code.
`boolean` | `isAutoFetch()` Fetch files automatically from FTP server.
`static void` | `main(String[] args)`
`void` | `setAutoFetch(boolean autoFetch)` Tell the parser to fetch missing PDB files from the FTP server automatically.
`void` | `setPath(String path)` Set path to file / connection string to db.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### MMCIFFileReader

    public MMCIFFileReader()

Method Detail

### main

    public static void main(String[] args)

### addExtension

    public void addExtension(String ext)

  Description copied from interface: `StructureIOFile`
  add a known File extension.

  Specified by:
    `addExtension` in interface `StructureIOFile`
  Parameters:
    `ext` - a String ...

### clearExtensions

    public void clearExtensions()

  Description copied from interface: `StructureIOFile`
  clear all file extensions

  Specified by:
    `clearExtensions` in interface `StructureIOFile`

### getStructure

    public Structure getStructure(String filename)
                           throws IOException

  Opens filename, parses it and returns a Structure object .

  Specified by:
    `getStructure` in interface `StructureIOFile`
  Parameters:
    `filename` - a String
  Returns:
    the Structure object
  Throws:
    `IOException` - ...

### getStructure

    public Structure getStructure(File filename)
                           throws IOException

  Opens filename, parses it and returns a Structure object.

  Specified by:
    `getStructure` in interface `StructureIOFile`
  Parameters:
    `filename` - a File object
  Returns:
    the Structure object
  Throws:
    `IOException` - ...

### setPath

    public void setPath(String path)

  Description copied from interface: `StructureIOFile`
  Set path to file / connection string to db. This is for installations of PDB/mmCif where all files are located in one directory.

  Specified by:
    `setPath` in interface `StructureIOFile`
  Parameters:
    `path` - a String specifying the path value

### getPath

    public String getPath()

  Description copied from interface: `StructureIOFile`
  get the directory path to the files

  Specified by:
    `getPath` in interface `StructureIOFile`
  Returns:
    path

### getStructureById

    public Structure getStructureById(String pdbId)
                               throws IOException

  Get a structure by PDB code. This works if a PATH has been set via setPath, or if setAutoFetch has been set to true.

  Specified by:
    `getStructureById` in interface `StructureIO`
  Parameters:
    `pdbId` - a 4 letter PDB code.
  Returns:
    a Structure object
  Throws:
    `IOException` - ...

### isAutoFetch

    public boolean isAutoFetch()

  Description copied from interface: `StructureIOFile`
  Fetch files automatically from FTP server. Default: false

  Specified by:
    `isAutoFetch` in interface `StructureIOFile`
  Returns:
    flag is true or false.

### setAutoFetch

    public void setAutoFetch(boolean autoFetch)

  Description copied from interface: `StructureIOFile`
  Tell the parser to fetch missing PDB files from the FTP server automatically. default is false. If true, new PDB files will be automatically stored in the Path and gzip compressed.

  Specified by:
    `setAutoFetch` in interface `StructureIOFile`
  Parameters:
    `autoFetch` - flag.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD