Class MmtfActions

java.lang.Object
org.biojava.nbio.structure.io.mmtf.MmtfActions

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

    • MmtfActions

      public MmtfActions()
  • Method Details

    • readFromFile

      public static Structure readFromFile(Path filePath) throws 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:
      IOException
    • writeToFile

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

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

      public static Structure readFromWeb(String pdbId) throws 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:
      IOException
    • readFromInputStream

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