Class MmtfActions


  • public class MmtfActions
    extends java.lang.Object
    A class of functions for reading and writing Biojava structures using MMTF
    Author:
    Anthony Bradley
    • Constructor Summary

      Constructors 
      Constructor Description
      MmtfActions()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Structure readFromFile​(java.nio.file.Path filePath)
      Get a Structure object from a mmtf file.
      static Structure readFromInputStream​(java.io.InputStream inStream)
      Read a Biojava structure from an InputStream
      static Structure readFromWeb​(java.lang.String pdbId)
      Get a Biojava structure from the mmtf REST service.
      static void writeToFile​(Structure structure, java.nio.file.Path path)
      Write a Structure object to a file.
      static void writeToOutputStream​(Structure structure, java.io.OutputStream outputStream)
      Write a Structure object to an OutputStream
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MmtfActions

        public MmtfActions()
    • Method Detail

      • readFromFile

        public static Structure readFromFile​(java.nio.file.Path filePath)
                                      throws java.io.IOException
        Get a Structure object from a mmtf file.
        Parameters:
        filePath - the mmtf file
        Returns:
        a Structure object relating to the input byte array.
        Throws:
        java.io.IOException
      • writeToFile

        public static void writeToFile​(Structure structure,
                                       java.nio.file.Path path)
                                throws java.io.IOException
        Write a Structure object to a file.
        Parameters:
        structure - the Structure to write
        path - the file to write
        Throws:
        java.io.IOException
      • writeToOutputStream

        public static void writeToOutputStream​(Structure structure,
                                               java.io.OutputStream outputStream)
                                        throws java.io.IOException
        Write a Structure object to an OutputStream
        Parameters:
        structure - the Structure to write
        outputStream - the OutputStream to write to
        Throws:
        java.io.IOException - an error transferring the byte[]
      • readFromWeb

        public static Structure readFromWeb​(java.lang.String pdbId)
                                     throws java.io.IOException
        Get a Biojava structure from the mmtf REST service.
        Parameters:
        pdbId - the PDB code of the required structure
        Returns:
        a Structure object relating to the input byte array
        Throws:
        java.io.IOException
      • readFromInputStream

        public static Structure readFromInputStream​(java.io.InputStream inStream)
                                             throws java.io.IOException
        Read a Biojava structure from an InputStream
        Parameters:
        inStream - the InputStream to read from
        Returns:
        the parsed Structure
        Throws:
        java.io.IOException