def __init__(self, assy): QDialog.__init__(self) self.setupUi(self) self.connect(self.okPushButton,SIGNAL("clicked()"),self.accept) self.connect(self.cancelPushButton,SIGNAL("clicked()"),self.reject) self.nameLineEdit.setText(assy.name) self.mmpformatLabel.setText("MMP File Format: " + assy.mmpformat) # Get statistics of part and display them in the statView widget. from commands.GroupProperties.GroupProp import Statistics stats = Statistics(assy.tree) stats.display(self.statsView)
def write_qutemol_files(part, excludeFlags = EXCLUDE_HIDDEN_ATOMS): """ Writes a PDB of the current I{part} to the Nanorex temp directory. @param part: the NE1 part. @type part: L{assembly} @param excludeFlags: used to exclude certain atoms from being written to the QuteMolX PDB file, where: WRITE_ALL_ATOMS = 0 (even writes hidden and invisble atoms) EXCLUDE_BONDPOINTS = 1 (excludes bondpoints) EXCLUDE_HIDDEN_ATOMS = 2 (excludes both hidden and invisible atoms) EXCLUDE_DNA_ATOMS = 4 (excludes PAM3 and PAM5 pseudo atoms) EXCLUDE_DNA_AXIS_ATOMS = 8 (excludes PAM3 axis atoms) EXCLUDE_DNA_AXIS_BONDS = 16 (supresses PAM3 axis bonds) @type excludeFlags: int @return: the name of the temp PDB file, or None if no atoms are in I{part}. @rtype: str """ # Is there a better way to get the number of atoms in <part>.? # Mark 2007-06-02 stats = Statistics(part.tree) if 0: stats.num_atoms = stats.natoms - stats.nsinglets print "write_qutemol_files(): natoms =", stats.natoms, \ "nsinglets =", stats.nsinglets, \ "num_atoms =", stats.num_atoms if not stats.natoms: # There are no atoms in the current part. # writepdb() will create an empty file, which causes # QuteMolX to crash at launch. # Mark 2007-06-02 return None pdb_basename = "QuteMolX.pdb" # Make full pathnames for the PDB file (in ~/Nanorex/temp/) tmpdir = find_or_make_Nanorex_subdir('temp') qutemol_pdb_file = os.path.join(tmpdir, pdb_basename) # Write the PDB file. write_qutemol_pdb_file(part, qutemol_pdb_file, excludeFlags) return qutemol_pdb_file
def write_qutemol_files(part, excludeFlags=EXCLUDE_HIDDEN_ATOMS): """ Writes a PDB of the current I{part} to the Nanorex temp directory. @param part: the NE1 part. @type part: L{assembly} @param excludeFlags: used to exclude certain atoms from being written to the QuteMolX PDB file, where: WRITE_ALL_ATOMS = 0 (even writes hidden and invisble atoms) EXCLUDE_BONDPOINTS = 1 (excludes bondpoints) EXCLUDE_HIDDEN_ATOMS = 2 (excludes both hidden and invisible atoms) EXCLUDE_DNA_ATOMS = 4 (excludes PAM3 and PAM5 pseudo atoms) EXCLUDE_DNA_AXIS_ATOMS = 8 (excludes PAM3 axis atoms) EXCLUDE_DNA_AXIS_BONDS = 16 (supresses PAM3 axis bonds) @type excludeFlags: int @return: the name of the temp PDB file, or None if no atoms are in I{part}. @rtype: str """ # Is there a better way to get the number of atoms in <part>.? # Mark 2007-06-02 stats = Statistics(part.tree) if 0: stats.num_atoms = stats.natoms - stats.nsinglets print "write_qutemol_files(): natoms =", stats.natoms, \ "nsinglets =", stats.nsinglets, \ "num_atoms =", stats.num_atoms if not stats.natoms: # There are no atoms in the current part. # writepdb() will create an empty file, which causes # QuteMolX to crash at launch. # Mark 2007-06-02 return None pdb_basename = "QuteMolX.pdb" # Make full pathnames for the PDB file (in ~/Nanorex/temp/) tmpdir = find_or_make_Nanorex_subdir('temp') qutemol_pdb_file = os.path.join(tmpdir, pdb_basename) # Write the PDB file. write_qutemol_pdb_file(part, qutemol_pdb_file, excludeFlags) return qutemol_pdb_file