Class CifFileConverter


  • public class CifFileConverter
    extends java.lang.Object
    Convert BioJava structures to CifFiles and vice versa.
    Since:
    5.3.0
    Author:
    Sebastian Bittrich
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Structure fromCifFile​(org.rcsb.cif.model.CifFile cifFile)
      Convert CifFile to Structure without any FileParsingParameters.
      static Structure fromCifFile​(org.rcsb.cif.model.CifFile cifFile, FileParsingParameters parameters)
      Convert CifFile to Structure.
      static Structure fromInputStream​(java.io.InputStream inputStream)
      Convert InputStream to Structure without any FileParsingParameters.
      static Structure fromInputStream​(java.io.InputStream inputStream, FileParsingParameters parameters)
      Convert InputStream to Structure.
      static Structure fromPath​(java.nio.file.Path path)
      Read data from a file and convert to Structure without any FileParsingParameters.
      static Structure fromPath​(java.nio.file.Path path, FileParsingParameters parameters)
      Read data from a file and convert to Structure.
      static Structure fromURL​(java.net.URL url)
      Get data from a URL and convert to Structure without any FileParsingParameters.
      static byte[] toBinary​(Structure structure)
      Convert a structure to BCIF format.
      static void toBinaryFile​(Structure structure, java.nio.file.Path path)
      Write a structure to a BCIF file.
      static org.rcsb.cif.model.CifFile toCifFile​(Structure structure)
      Convert Structure to CifFile.
      static java.lang.String toText​(Structure structure)
      Convert a structure to mmCIF format.
      static void toTextFile​(Structure structure, java.nio.file.Path path)
      Write a structure to a CIF file.
      • Methods inherited from class java.lang.Object

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

      • CifFileConverter

        public CifFileConverter()
    • Method Detail

      • fromPath

        public static Structure fromPath​(java.nio.file.Path path)
                                  throws java.io.IOException
        Read data from a file and convert to Structure without any FileParsingParameters.
        Parameters:
        path - the source of information - can be gzipped or binary or text data
        Returns:
        the target
        Throws:
        java.io.IOException
      • fromPath

        public static Structure fromPath​(java.nio.file.Path path,
                                         FileParsingParameters parameters)
                                  throws java.io.IOException
        Read data from a file and convert to Structure.
        Parameters:
        path - the source of information - can be gzipped or binary or text data
        parameters - parameters for parsing
        Returns:
        the target
        Throws:
        java.io.IOException
      • fromURL

        public static Structure fromURL​(java.net.URL url)
                                 throws java.io.IOException
        Get data from a URL and convert to Structure without any FileParsingParameters.
        Parameters:
        url - the source of information - can be gzipped or binary or text data
        Returns:
        the target
        Throws:
        java.io.IOException - thrown when reading fails
      • fromInputStream

        public static Structure fromInputStream​(java.io.InputStream inputStream)
                                         throws java.io.IOException
        Convert InputStream to Structure without any FileParsingParameters.
        Parameters:
        inputStream - the InputStream of information - can be gzipped or binary or text data
        Returns:
        the target
        Throws:
        java.io.IOException - thrown when reading fails
        See Also:
        fromInputStream(InputStream, FileParsingParameters)
      • fromInputStream

        public static Structure fromInputStream​(java.io.InputStream inputStream,
                                                FileParsingParameters parameters)
                                         throws java.io.IOException
        Convert InputStream to Structure.
        Parameters:
        inputStream - the InputStream of information - can be gzipped or binary or text data
        parameters - parameters for parsing
        Returns:
        the target
        Throws:
        java.io.IOException - thrown when reading fails
      • fromCifFile

        public static Structure fromCifFile​(org.rcsb.cif.model.CifFile cifFile)
        Convert CifFile to Structure without any FileParsingParameters.
        Parameters:
        cifFile - the source
        Returns:
        the target
        See Also:
        fromCifFile(CifFile, FileParsingParameters)
      • fromCifFile

        public static Structure fromCifFile​(org.rcsb.cif.model.CifFile cifFile,
                                            FileParsingParameters parameters)
        Convert CifFile to Structure.
        Parameters:
        cifFile - the source
        parameters - parameters for parsing
        Returns:
        the target
      • toTextFile

        public static void toTextFile​(Structure structure,
                                      java.nio.file.Path path)
                               throws java.io.IOException
        Write a structure to a CIF file.
        Parameters:
        structure - the source
        path - where to write to
        Throws:
        java.io.IOException - thrown when writing fails
      • toBinaryFile

        public static void toBinaryFile​(Structure structure,
                                        java.nio.file.Path path)
                                 throws java.io.IOException
        Write a structure to a BCIF file.
        Parameters:
        structure - the source
        path - where to write to
        Throws:
        java.io.IOException - thrown when writing fails
      • toBinary

        public static byte[] toBinary​(Structure structure)
                               throws java.io.IOException
        Convert a structure to BCIF format.
        Parameters:
        structure - the source
        Returns:
        the binary representation of the structure
        Throws:
        java.io.IOException - thrown when writing fails
      • toText

        public static java.lang.String toText​(Structure structure)
                                       throws java.io.IOException
        Convert a structure to mmCIF format.
        Parameters:
        structure - the source
        Returns:
        the mmCIF String representation of the structure
        Throws:
        java.io.IOException - thrown when writing fails
      • toCifFile

        public static org.rcsb.cif.model.CifFile toCifFile​(Structure structure)
        Convert Structure to CifFile.
        Parameters:
        structure - the source
        Returns:
        the target