def readFromFile(self, infile, format="fasta"):

        self.mMali = {}
        self.mIdentifiers = []

        pattern_parse_ranges = re.compile("(\S+)/(\d+)-(\d+)")

        if isinstance(infile, list) or \
           isinstance(infile, tuple):
            lines = infile
        else:
            lines = infile.readlines()

        if format not in ("stockholm"):
            # save comments
            self.mComments = filter(lambda x: x[0] == "#", lines)
            lines = filter(lambda x: x[0] != "#", lines)
        else:
            self.mComments = []

        def getId(id, s):
            x = pattern_parse_ranges.match(id)
            if x:
                id, fr, to = x.groups()
                fr, to = int(fr) - 1, int(to)
            else:
                fr, to = 0, self.countCharacters(s)
                self.mWriteRanges = False

            return id, fr, to

        #######################################################################
        if format.lower() == "plain":

            for line in lines:
                if not line.strip():
                    continue
                data = line[:-1].split("\t")
                id = data[3]
                xid = id
                x = 0
                while xid in self.mMali:
                    xid = id + "-" + str(x)
                    x += 1

                self.addEntry(
                    AlignedString(xid,
                                  int(data[0]) - 1,
                                  int(data[2]),
                                  data[1]))

        #######################################################################
        elif format.lower() == "fasta":
            pattern_identifier = "\S+"
            id = None
            fragments = []
            for line in lines:
                if line[0] == ">":
                    if id:
                        s = re.sub("\s", "", string.join(fragments, ""))
                        id, fr, to = getId(id, s)
                        self.addEntry(AlignedString(id, fr, to, s))

                    id = re.search(
                        "^(%s)" % pattern_identifier, line[1:-1]).group(0)
                    fragments = []
                    continue
                fragments.append(line[:-1])

            s = re.sub("\s", "", string.join(fragments, ""))
            id, fr, to = getId(id, s)
            self.addEntry(AlignedString(id, fr, to, s))

        #######################################################################
        elif format.lower() == "phylip":
            raise "phylip not implemented"

        #######################################################################
        elif format.lower() == "clustal":
            raise "clustal not implemented"

        elif format.lower() == "stockholm":
            raise "stockholm not implemented"

        if len(self.mMali) == 0:
            self.mLength = 0
        else:
            self.mLength = min(
                map(lambda x: len(x.mString), self.mMali.values()))


###############################################################################
Verify the router prompt is detected correctly.
dataset/ETHPy150Open CGATOxford/cgat/CGAT/Mali.py/SequenceCollection.readFromFile--crossover with--dataset/ETHPy150Open ktbyers/netmiko/tests/test_netmiko_show.py/test_base_prompt