예제 #1
0
    def show(self, fmt='S'):
        output = []
        output.append(cl.g + 'Topology, # of residue: %d' %
                      (len(self.getreses())) + cl.n + '\n')
        output.append(cl.g + '-' * 80 + cl.n + '\n')

        if self.norm:
            reses = reduce(add, self.norm.values())
            reses.sort(key=lambda x: (x.cat, x.name))
            output.append('>>> Normal residues, %d in total\n' % len(reses))
            for res in reses:
                output += res.show(fmt, disp=False)

        if self.nter:
            reses = reduce(add, self.nter.values())
            reses.sort(key=lambda x: x.name)
            output.append('>>> N-terminal residues, %d in total\n' %
                          len(reses))
            for res in reses:
                output += res.show(fmt, disp=False)

        if self.cter:
            reses = reduce(add, self.cter.values())
            reses.sort(key=lambda x: x.name)
            output.append('>>> C-terminal residues, %d in total\n' %
                          len(reses))
            for res in reses:
                output += res.show(fmt, disp=False)

        pager(output)
예제 #2
0
 def show(self, fmt='S'):
     output = []
     output.append(cl.y + 'PDB file, # of model: %d' % len(self.mds) +
                   cl.n + '\n')
     output.append(cl.y + '+' * 80 + cl.n + '\n')
     for md in self.mds:
         output += md.show(fmt, disp=False)
     pager(output)
예제 #3
0
    def show(self, fmt='S', disp=True):
        output = []
        output.append(('Model %d,' % self.mdid if self.mdid else 'Mol,') +
                      ' # of segment: %d\n' % len(self.segs))
        output.append('=' * 80 + '\n')
        for seg in self.segs:
            output += seg.show(fmt, disp=False)

        if disp:
            pager(output)
        else:
            return output
예제 #4
0
    def show(self, fmt='S', disp=True):
        output = ['']
        output.append(cl.g + 'Segment ' + self.sgid +
                      ', # of residue: %d' % len(self.reses) + cl.n + '\n')
        output.append(cl.g + '-' * 80 + cl.n + '\n')
        if not self.reses:
            output.append('No residue exists!\n')
        else:
            for res in self.reses:
                output += res.show(fmt, disp=False)

        if disp:
            pager(output)
        else:
            return output