Class CifStructureConverter


  • public class CifStructureConverter
    extends Object
    Convert BioJava structures to CifFiles and vice versa.
    Since:
    6.0.0
    Author:
    Sebastian Bittrich
    • Method Detail

      • fromPath

        public static Structure fromPath​(Path path)
                                  throws 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:
        IOException
      • fromPath

        public static Structure fromPath​(Path path,
                                         FileParsingParameters parameters)
                                  throws 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:
        IOException
      • fromURL

        public static Structure fromURL​(URL url)
                                 throws 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:
        IOException - thrown when reading fails
      • fromURL

        public static Structure fromURL​(URL url,
                                        FileParsingParameters parameters)
                                 throws IOException
        Get data from a URL and convert to Structure.
        Parameters:
        url - the source of information - can be gzipped or binary or text data
        parameters - parameters for parsing
        Returns:
        the target
        Throws:
        IOException - thrown when reading fails
      • 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,
                                      Path path)
                               throws IOException
        Write a structure to a CIF file.
        Parameters:
        structure - the source
        path - where to write to
        Throws:
        IOException - thrown when writing fails
      • toBinaryFile

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

        public static byte[] toBinary​(Structure structure)
        Convert a structure to BCIF format.
        Parameters:
        structure - the source
        Returns:
        the binary representation of the structure
      • toText

        public static String toText​(Structure structure)
        Convert a structure to mmCIF format.
        Parameters:
        structure - the source
        Returns:
        the mmCIF String representation of the structure
      • toText

        public static String toText​(Chain chain)
        Convert a chain to mmCIF format.
        Parameters:
        chain - the source
        Returns:
        the mmCIF String representation of the chain
      • toCifFile

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

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