Class CifStructureConverter
- java.lang.Object
-
- org.biojava.nbio.structure.io.cif.CifStructureConverter
-
public class CifStructureConverter extends Object
Convert BioJava structures to CifFiles and vice versa.- Since:
- 6.0.0
- Author:
- Sebastian Bittrich
-
-
Constructor Summary
Constructors Constructor Description CifStructureConverter()
-
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(InputStream inputStream)
Convert InputStream to Structure without any FileParsingParameters.static Structure
fromInputStream(InputStream inputStream, FileParsingParameters parameters)
Convert InputStream to Structure.static Structure
fromPath(Path path)
Read data from a file and convert to Structure without any FileParsingParameters.static Structure
fromPath(Path path, FileParsingParameters parameters)
Read data from a file and convert to Structure.static Structure
fromURL(URL url)
Get data from a URL and convert to Structure without any FileParsingParameters.static Structure
fromURL(URL url, FileParsingParameters parameters)
Get data from a URL and convert to Structure.static byte[]
toBinary(Structure structure)
Convert a structure to BCIF format.static void
toBinaryFile(Structure structure, Path path)
Write a structure to a BCIF file.static org.rcsb.cif.model.CifFile
toCifFile(Chain chain)
Convert Chain to CifFilestatic org.rcsb.cif.model.CifFile
toCifFile(Structure structure)
Convert Structure to CifFile.static String
toText(Chain chain)
Convert a chain to mmCIF format.static String
toText(Structure structure)
Convert a structure to mmCIF format.static void
toTextFile(Structure structure, Path path)
Write a structure to a CIF file.
-
-
-
Constructor Detail
-
CifStructureConverter
public CifStructureConverter()
-
-
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 dataparameters
- 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 dataparameters
- parameters for parsing- Returns:
- the target
- Throws:
IOException
- thrown when reading fails
-
fromInputStream
public static Structure fromInputStream(InputStream inputStream) throws 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:
IOException
- thrown when reading fails- See Also:
fromInputStream(InputStream, FileParsingParameters)
-
fromInputStream
public static Structure fromInputStream(InputStream inputStream, FileParsingParameters parameters) throws IOException
Convert InputStream to Structure.- Parameters:
inputStream
- the InputStream of information - can be gzipped or binary or text dataparameters
- parameters for parsing- Returns:
- the target
- Throws:
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 sourceparameters
- 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 sourcepath
- 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 sourcepath
- 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
-
-