Пример #1
0
    def __init__(self, p, collength=16, verbose=False):
        """
        Instantiates a MAP object corresponding to MAP files.

        The data_format is how the file is set up for use with reading and writing HDF5 tables. The dictionary
        key represents the name of the column, the first part of the value tuple represents where it is located
        when the line is split and the second part represents the datatype to use within the table.
        :param p: The full file path
        """
        self.data_format = {"chromosome": (0, StringCol(collength)), "identifier": (1, StringCol(collength)),
                            "distance": (2, StringCol(collength)), "position": (3, StringCol(collength))}
        DataType.__init__(self, p, "map", verbose)
Пример #2
0
    def __init__(self, p, collength=16, verbose=False):
        """
        Instantiates a MAP object corresponding to MAP files.

        The data_format is how the file is set up for use with reading and writing HDF5 tables. The dictionary
        key represents the name of the column, the first part of the value tuple represents where it is located
        when the line is split and the second part represents the datatype to use within the table.
        :param p: The full file path
        """
        self.data_format = {
            "chromosome": (0, StringCol(collength)),
            "identifier": (1, StringCol(collength)),
            "distance": (2, StringCol(collength)),
            "position": (3, StringCol(collength))
        }
        DataType.__init__(self, p, "map", verbose)
Пример #3
0
    def __init__(self, p, collength=16, writing=False, verbose=False):
        """
        Instantiates a PED object corresponding to MAP files.

        See MAP.py for data_format explanation.
        :param p: The full file path.
        """
        self.input = p
        self.data_format = {"family": (0, StringCol(collength)), "sample": (1, StringCol(collength)),
                            "paternal": (2, StringCol(collength)), "maternal": (3, StringCol(collength)),
                            "sex": (4, StringCol(collength)), "affection": (5, StringCol(collength))}
        if not writing:
            self.geno_length = self.get_geno_length()
            self.data_format["genotype"] = (6, StringCol(self.geno_length))
        else:
            self.data_format["genotype"] = (6, StringCol(4))
        DataType.__init__(self, p, "ped", verbose)
Пример #4
0
    def __init__(self, p, collength=16, writing=False, verbose=False):
        """
        Instantiates a PED object corresponding to MAP files.

        See MAP.py for data_format explanation.
        :param p: The full file path.
        """
        self.input = p
        self.data_format = {
            "family": (0, StringCol(collength)),
            "sample": (1, StringCol(collength)),
            "paternal": (2, StringCol(collength)),
            "maternal": (3, StringCol(collength)),
            "sex": (4, StringCol(collength)),
            "affection": (5, StringCol(collength))
        }
        if not writing:
            self.geno_length = self.get_geno_length()
            self.data_format["genotype"] = (6, StringCol(self.geno_length))
        else:
            self.data_format["genotype"] = (6, StringCol(4))
        DataType.__init__(self, p, "ped", verbose)