def parseInfo(self, attributes, line):
        """parse attributes.

        This method will set the gene_id and transcript_id attributes
        if present.
        """

        # remove comments
        attributes = attributes.split("#")[0]

        # separate into fields
        # Fields might contain a ";", for example in ENSEMBL GTF file
        # for mouse, v78:
        # ...; transcript_name "TXNRD2;-001"; ....
        # The current heuristic is to split on a semicolon followed by a
        # space, which seems to be part of the specification, see
        # http://mblab.wustl.edu/GTF22.html
        fields = map(lambda x: x.strip(), attributes.split("; ")[:-1])
        self.attributes = {}

        for f in fields:

            d = map(lambda x: x.strip(), f.split(" "))

            n, v = d[0], " ".join(d[1:])
            if len(d) > 2:
                v = d[1:]

            if v[0] == '"' and v[-1] == '"':
                v = v[1:-1]
            else:
                # try to convert to a value
                try:
                    v = float(v)
                    v = int(v)
                except ValueError:
                    pass
                except __HOLE__:
                    pass

            if n == "gene_id":
                self.gene_id = v
            elif n == "transcript_id":
                self.transcript_id = v
            else:
                self.attributes[n] = v

        if not self.gene_id:
            raise ParsingError("missing attribute 'gene_id' in line %s" % line)
        if not self.transcript_id:
            raise ParsingError(
                "missing attribute 'transcript_id' in line %s" % line)
dataset/ETHPy150Open CGATOxford/cgat/CGAT/GTF.py/Entry.parseInfo