Пример #1
0
    def showResults(self, score, proteinSeqList):
        """
        Display the rosetta simulation results in a pop up dialog at the end
        of a successful simulation

        @param score: Score from the most optimized sequence
        @type score: str

        @param proteinSeqList: list of size 2, with (protein, sequence) tuple,
                                containing the input protein and its sequence
                                and the output protein and its corresponding
                                sequence
        @type proteinSeqList: list
        """
        html = "Score of this fixed backbone sequence design using starting"
        html = html + " structure " + self.sim_input_file
        html = html + " and residue file " + self.resFile
        html = html + " is " + "<font face=Courier New color=red>" + score + "</font>"
        html = html + "<p>The original protein sequence and the designed sequence"
        html = html + " are shown below with differences in designed sequence "
        html = html + "shown in red: <br>"
        #highlight the differences in sequence between the original protein
        #and the new protein
        modSeqList, similarity = highlightDifferencesInSequence(proteinSeqList)
        for i in range(len(proteinSeqList)):
            html = html + "<font face=Courier New>" + proteinSeqList[i][0] + "</font> "+ "<br>"
            html = html + "<font face=Courier New>" + modSeqList[i] + "</font>" + "<br>"
        html = html + "</p>"
        html = html + "<p>Sequence Similarity = " + similarity + "</p>"
        w = WikiHelpBrowser(html, parent = self.win, caption = "Rosetta Sequence Design Results", size = 2)
        w.show()
        return
Пример #2
0
def showRosettaScore(tmp_file_prefix, scorefile, win):
    """
    Show the rosetta score of the current protein sequence

    @param tmp_file_prefix: file prefix from which directory of the score file
                            could be extracted
    @type tmp_file_prefix: str

    @param scorefile: name of the rosetta score file
    @type scorefile: str

    @param win: NE-1 window
    @type win: L{gl_pane}

    """
    dir1 = os.path.dirname(tmp_file_prefix)
    scorefile = scorefile + '.sc'
    scoreFilePath = os.path.join(dir1, scorefile)
    fileObject1 = open(scoreFilePath, 'r')
    if fileObject1:
        doc = fileObject1.readlines()
        copied_lines = []
        for line in doc:
            #put a comma after each word
            i = 0
            firstSpace = True
            for c in line:
                if i > 0 and c == ' ' and firstSpace == True:
                    line = line[0:i] + ',' + line[i+1:]
                    firstSpace = False
                if c != ' ' and firstSpace == False:
                    firstSpace = True
                i = i + 1
                if i == len(line):
                    copied_lines.append(line)

        array_Name = copied_lines[0].split(',')
        array_Score = copied_lines[1].split(',')
        i = 0
        for i in range(len(array_Name)):
            array_Name[i] = array_Name[i].strip()
            array_Score[i] = array_Score[i].strip()
        i = 0
        html = ""
        for i in range(len(array_Name)):
            html = html + "<p><b>" + array_Name[i].upper() + "</b> = "
            html = html + "<font color = red> " + array_Score[i] + "</font></p>"
        w = WikiHelpBrowser(html, parent = win, caption = "Rosetta Scoring Results", size = 1)
        w.show()
    return
Пример #3
0
 def showResults(self, score, proteinSeqList):
     
     from foundation.wiki_help import WikiHelpBrowser
     html = "Score of this fixed backbone sequence design using starting"
     html = html + " structure " + self.sim_input_file
     html = html + " and residue file " + self.resFile
     html = html + " is " + "<font face=Courier New color=red>" + score + "</font>"
     html = html + "<p>The original protein sequence and the designed sequence"
     html = html + " are shown below with differences in designed sequence "
     html = html + "shown in red: <br>"
     modSeqList, similarity = highlightDifferencesInSequence(proteinSeqList)
     for i in range(len(proteinSeqList)):
         html = html + "<font face=Courier New>" + proteinSeqList[i][0] + "</font> "+ "<br>"
         html = html + "<font face=Courier New>" + modSeqList[i] + "</font>" + "<br>"
     html = html + "</p>"
     html = html + "<p>Sequence Similarity = " + similarity + "</p>"
     w = WikiHelpBrowser(html, parent = self.win, caption = "Rosetta Results")
     w.show()
     return
Пример #4
0
 def wikiHelp(self):
     parent = env.mainwindow()
     w = WikiHelpBrowser(self.text,parent,caption=self.name)
     w.show()
Пример #5
0
 def wikiHelp(self):
     parent = env.mainwindow()
     w = WikiHelpBrowser(self.text, parent, caption=self.name)
     w.show()