def __init__(self, filename):
        super(MSTMap, self).__init__(filename)
        fp = open(filename)
        startidx = 1
        for row in fp:
            if row.startswith("locus_name"):
                if row.split()[1] == "seqid":
                    startidx = 3
                self.header = row.split()
                break

        for row in fp:
            self.append(MSTMapLine(row, startidx=startidx))

        self.nmarkers = len(self)
        self.nind = len(self[0].genotype)
        logging.debug(
            "Map contains {0} markers in {1} individuals".format(
                self.nmarkers, self.nind
            )
        )