def fromTable(self, data):

        try:
            (nmatches, nmismatches, nrepmatches, nns,
             query_ngaps_counts, query_ngaps_bases,
             sbjct_ngaps_counts, sbjct_ngaps_bases,
             strand,
             query_id, query_length, query_from, query_to,
             sbjct_id, sbjct_length, sbjct_from, sbjct_to,
             nblocks, block_sizes,
             query_block_starts, sbjct_block_starts) = data[:21]
        except __HOLE__:
            raise ParsingError("parsing error: %i fields" %
                               len(data), "\t".join(data))

        nmatches, nmismatches, nrepmatches, nns = map(
            int,
            (nmatches, nmismatches, nrepmatches, nns))

        self.mNMatches = nmatches
        self.mNMismatches = nmismatches
        self.mNRepMatches = nrepmatches
        self.mNns = nns
        self.mQueryNGapsCounts = int(query_ngaps_counts)
        self.mQueryNGapsBases = int(query_ngaps_bases)
        self.mSbjctNGapsCounts = int(sbjct_ngaps_counts)
        self.mSbjctNGapsBases = int(sbjct_ngaps_bases)
        self.strand = strand
        self.mQueryId = query_id
        self.mQueryLength = int(query_length)
        self.mQueryFrom = int(query_from)
        self.mQueryTo = int(query_to)
        self.mSbjctId = sbjct_id
        self.mSbjctLength = int(sbjct_length)
        self.mSbjctFrom = int(sbjct_from)
        self.mSbjctTo = int(sbjct_to)
        self.mNBlocks = int(nblocks)
        self.mBlockSizes = map(int, block_sizes[:-1].split(","))
        self.mQueryBlockStarts = map(int, query_block_starts[:-1].split(","))
        self.mSbjctBlockStarts = map(int, sbjct_block_starts[:-1].split(","))

        # this makes sure that the block positions are rescaled
        if self.mQueryLength != 0:
            self.mQueryCoverage = 100.0 * \
                (self.mNMismatches + self.mNMatches) / self.mQueryLength
        else:
            self.mQueryCoverage = 0

        if self.mSbjctLength != 0:
            self.mSbjctCoverage = 100.0 * \
                (self.mNMismatches + self.mNMatches) / self.mSbjctLength
        else:
            self.mSbjctCoverage = 0

        if nmatches + nmismatches > 0:
            self.mPid = 100.0 * float(nmatches) / (nmatches + nmismatches)
        else:
            self.mPid = 100.0
dataset/ETHPy150Open CGATOxford/cgat/obsolete/BlatTest.py/Match.fromTable