Ejemplo n.º 1
0
 def testPlots2HLA3DPlotly(self):
     """
     Make a 3D plot of BLAST bit scores, Z scores, and light matter scores.
     """
     for parameterSet in testArgs.parameterSets:
         affinity = _AFFINITY[parameterSet]
         dirName = makeOutputDir(DATASET, parameterSet, '3d-plotly')
         for subject in SUBJECTS:
             zScores = []
             bitScores = []
             lmScores = []
             labels = []
             for query in QUERIES:
                 if query.id != subject.id:
                     bitScores.append(BIT_SCORES[query.id][subject.id])
                     zScores.append(Z_SCORES[query.id][subject.id])
                     lmScore = getScore(affinity, query.id, subject.id)
                     lmScores.append(lmScore)
                     labels.append(pythonNameToPdbName(query.id))
             plot3DPlotly(bitScores,
                          zScores,
                          lmScores,
                          subject.id,
                          dirName,
                          interactive=testArgs.interactive,
                          labels=labels)
    def testNonMatchingPlots2HLAAgainstPolymerase(self):
        """
        Examine the correlation between light matter scores and BLAST bit
        scores.
        """
        scoreTypeX = 'Light matter score'
        scoreTypeY = 'Bit score'

        for parameterSet in testArgs.parameterSets:
            affinity = _AFFINITY[parameterSet]
            dirName = makeOutputDir(
                DATASET,
                parameterSet,
                '%s-%s' % (FILESYSTEM_NAME[scoreTypeX],
                           FILESYSTEM_NAME[scoreTypeY]))
            for subject in SUBJECTS:
                lmScores = []
                bitScores = []
                for query in QUERIES:
                    if query.id != subject.id:
                        bitScores.append(BIT_SCORES[query.id][subject.id])
                        lmScore = getScore(affinity, query.id, subject.id)
                        lmScores.append(lmScore)
                plot(lmScores, bitScores, subject.id, scoreTypeX, scoreTypeY,
                     dirName)
Ejemplo n.º 3
0
    def testPlotsHA(self):
        """
        Examine the correlation between BLAST bit scores and Z scores.
        """
        scoreTypeX = 'Bit score'
        scoreTypeY = 'Z score'

        for parameterSet in testArgs.parameterSets:
            dirName = makeOutputDir(
                DATASET, parameterSet, '%s-%s' %
                (FILESYSTEM_NAME[scoreTypeX], FILESYSTEM_NAME[scoreTypeY]))

            allZScores = []
            allBitScores = []
            for queryId in BIT_SCORES:
                zScores = []
                bitScores = []
                for subjectId in BIT_SCORES[queryId]:
                    if queryId != subjectId:
                        bitScores.append(BIT_SCORES[queryId][subjectId])
                        zScores.append(Z_SCORES[queryId][subjectId])
                allZScores.extend(zScores)
                allBitScores.extend(bitScores)
                plot(bitScores, zScores, queryId, scoreTypeX, scoreTypeY,
                     dirName)
            plot(allBitScores, allZScores, 'all', scoreTypeX, scoreTypeY,
                 dirName)
Ejemplo n.º 4
0
    def testPlotsHA(self):
        """
        Examine the correlation between our scores and blast bit scores.
        """
        scoreTypeX = 'Light matter score'
        scoreTypeY = 'Bit score'

        for parameterSet in testArgs.parameterSets:
            affinity = _AFFINITY[parameterSet]
            dirName = makeOutputDir(
                DATASET, parameterSet, '%s-%s' %
                (FILESYSTEM_NAME[scoreTypeX], FILESYSTEM_NAME[scoreTypeY]))

            allBitScores = []
            allLmScores = []
            for queryId in BIT_SCORES:
                bitScores = []
                lmScores = []
                for subjectId in BIT_SCORES[queryId]:
                    if queryId != subjectId:
                        lmScore = getScore(affinity, queryId, subjectId)
                        lmScores.append(lmScore)
                        bitScores.append(BIT_SCORES[queryId][subjectId])
                allBitScores.extend(bitScores)
                allLmScores.extend(lmScores)
                plot(lmScores, bitScores, queryId, scoreTypeX, scoreTypeY,
                     dirName)
            plot(allLmScores, allBitScores, 'all', scoreTypeX, scoreTypeY,
                 dirName)
Ejemplo n.º 5
0
    def test3DHA(self):
        """
        Make a 3D plot of BLAST bit scores, Z scores, and light matter scores.
        """
        for parameterSet in testArgs.parameterSets:
            affinity = _AFFINITY[parameterSet]
            dirName = makeOutputDir(DATASET, parameterSet, '3d')
            allZScores = []
            allBitScores = []
            allLmScores = []
            for queryId in sorted(BIT_SCORES):
                zScores = []
                bitScores = []
                lmScores = []
                for subjectId in BIT_SCORES[queryId]:
                    if queryId != subjectId:
                        bitScores.append(BIT_SCORES[queryId][subjectId])
                        zScores.append(Z_SCORES[queryId][subjectId])
                        lmScore = getScore(affinity, queryId, subjectId)
                        lmScores.append(lmScore)
                allZScores.extend(zScores)
                allBitScores.extend(bitScores)
                allLmScores.extend(lmScores)

                plot3D(bitScores, zScores, lmScores, queryId, 'Bit score',
                       'Z score', 'Light matter score', dirName,
                       testArgs.interactive)

            # Plot all scores on one plot.
            plot3D(allBitScores, allZScores, allLmScores, 'all', 'Bit score',
                   'Z score', 'Light matter score', dirName,
                   testArgs.interactive)
Ejemplo n.º 6
0
    def testPlotsHA3DPlotly(self):
        """
        Make a 3D plot of BLAST bit scores, Z scores, and light matter scores.
        """
        for parameterSet in testArgs.parameterSets:
            affinity = _AFFINITY[parameterSet]
            dirName = makeOutputDir(DATASET, parameterSet, '3d-plotly')
            allZScores = []
            allBitScores = []
            allLmScores = []
            allLabels = []
            for queryId in sorted(BIT_SCORES):
                zScores = []
                bitScores = []
                lmScores = []
                labels = []
                for subjectId in BIT_SCORES[queryId]:
                    if queryId != subjectId:
                        bitScores.append(BIT_SCORES[queryId][subjectId])
                        zScores.append(Z_SCORES[queryId][subjectId])
                        lmScore = getScore(affinity, queryId, subjectId)
                        lmScores.append(lmScore)
                        labels.append(pythonNameToPdbName(subjectId))
                        allLabels.append('%s vs. %s' %
                                         (pythonNameToPdbName(queryId),
                                          pythonNameToPdbName(subjectId)))
                allZScores.extend(zScores)
                allBitScores.extend(bitScores)
                allLmScores.extend(lmScores)

                plot3DPlotly(bitScores,
                             zScores,
                             lmScores,
                             queryId,
                             dirName,
                             interactive=testArgs.interactive,
                             labels=labels)

                if testArgs.interactive:
                    response = input('Continue? ')
                    if response and response[0].lower() == 'n':
                        return

            # Plot all scores on one plot.
            plot3DPlotly(allBitScores,
                         allZScores,
                         allLmScores,
                         'all',
                         dirName,
                         interactive=testArgs.interactive,
                         labels=allLabels)

            if testArgs.interactive:
                response = input('Continue? ')
                if response and response[0].lower() == 'n':
                    return
Ejemplo n.º 7
0
 def testPlots2HLA3D(self):
     """
     Make a 3D plot of BLAST bit scores, Z scores, and light matter scores.
     """
     for parameterSet in testArgs.parameterSets:
         affinity = _AFFINITY[parameterSet]
         dirName = makeOutputDir(DATASET, parameterSet, '3d')
         for subject in SUBJECTS:
             zScores = []
             bitScores = []
             lmScores = []
             for query in QUERIES:
                 if query.id != subject.id:
                     bitScores.append(BIT_SCORES[query.id][subject.id])
                     zScores.append(Z_SCORES[query.id][subject.id])
                     lmScore = getScore(affinity, query.id, subject.id)
                     lmScores.append(lmScore)
             plot3D(bitScores, zScores, lmScores, subject.id, 'Bit score',
                    'Z score', 'Light matter score', dirName,
                    testArgs.interactive)
Ejemplo n.º 8
0
    def testPlots2HLA(self):
        """
        Examine the correlation between BLAST bit scores and Z scores.
        """
        scoreTypeX = 'Bit score'
        scoreTypeY = 'Z score'

        for parameterSet in testArgs.parameterSets:
            dirName = makeOutputDir(
                DATASET, parameterSet, '%s-%s' %
                (FILESYSTEM_NAME[scoreTypeX], FILESYSTEM_NAME[scoreTypeY]))
            for subject in SUBJECTS:
                bitScores = []
                zScores = []
                for query in QUERIES:
                    if query.id != subject.id:
                        zScores.append(Z_SCORES[query.id][subject.id])
                        bitScores.append(BIT_SCORES[query.id][subject.id])
                plot(bitScores, zScores, subject.id, scoreTypeX, scoreTypeY,
                     dirName)
Ejemplo n.º 9
0
    def testPlots4PH0(self):
        """
        Examine the correlation between light matter scores and Z scores.
        """
        scoreTypeX = 'Light matter score'
        scoreTypeY = 'Z score'

        for parameterSet in testArgs.parameterSets:
            affinity = _AFFINITY[parameterSet]
            dirName = makeOutputDir(
                DATASET, parameterSet, '%s-%s' %
                (FILESYSTEM_NAME[scoreTypeX], FILESYSTEM_NAME[scoreTypeY]))
            for subject in SUBJECTS:
                lmScores = []
                zScores = []
                for query in QUERIES:
                    if query.id != subject.id:
                        zScores.append(Z_SCORES[query.id][subject.id])
                        lmScore = getScore(affinity, query.id, subject.id)
                        lmScores.append(lmScore)
                plot(lmScores, zScores, subject.id, scoreTypeX, scoreTypeY,
                     dirName)