Skip to content

CifFile

mmcif.io.CifFile.CifFile

CifFile

New method prototype --

CifFile* ParseCifSimple(const std::string& fileName, const bool verbose = false, const unsigned int intCaseSense = 0, const unsigned int maxLineLength = CifFile::STD_CIF_LINE_LENGTH, const std::string& nullValue = CifString::UnknownValue, const std::string& parseLogFileName = std::string());

Source code in mmcif/io/CifFile.py
class CifFile(object):
    """
    CifFile

    New method prototype --

    CifFile* ParseCifSimple(const std::string& fileName,
                            const bool verbose = false,
                            const unsigned int intCaseSense = 0,
                            const unsigned int maxLineLength = CifFile::STD_CIF_LINE_LENGTH,
                            const std::string& nullValue = CifString::UnknownValue,
                            const std::string& parseLogFileName = std::string());

    """

    def __init__(self, fileName, parseLogFileName=None):
        self.__fileName = fileName

        if parseLogFileName is None:
            self.__cifFile = ParseCifSimple(self.__fileName, False, 0, 255, "?", "")
        else:
            self.__cifFile = ParseCifSimple(self.__fileName, False, 0, 255, "?", parseLogFileName)

    def getCifFile(self):
        return self.__cifFile

    @classmethod
    def getFileExt(cls):
        return "cif"

    def write(self, fileName):
        self.__cifFile.Write(fileName)

    @classmethod
    def read(cls, fileName):
        return cls(fileName)

__init__(self, fileName, parseLogFileName=None) special

Source code in mmcif/io/CifFile.py
def __init__(self, fileName, parseLogFileName=None):
    self.__fileName = fileName

    if parseLogFileName is None:
        self.__cifFile = ParseCifSimple(self.__fileName, False, 0, 255, "?", "")
    else:
        self.__cifFile = ParseCifSimple(self.__fileName, False, 0, 255, "?", parseLogFileName)

getCifFile(self)

Source code in mmcif/io/CifFile.py
def getCifFile(self):
    return self.__cifFile

getFileExt() classmethod

Source code in mmcif/io/CifFile.py
@classmethod
def getFileExt(cls):
    return "cif"

read(fileName) classmethod

Source code in mmcif/io/CifFile.py
@classmethod
def read(cls, fileName):
    return cls(fileName)

write(self, fileName)

Source code in mmcif/io/CifFile.py
def write(self, fileName):
    self.__cifFile.Write(fileName)