if not pseudoMol.connectedToNextFromIndex(curIndex): print "Nucleotides " + pseudoMol.resNumFull( curIndex) + " and " + pseudoMol.resNumFull( curIndex + 1) + " are not connected. Cannot rotamerize." add_status_bar_text("Nucleotides " + pseudoMol.resNumFull(curIndex) + " and " + pseudoMol.resNumFull(curIndex + 1) + " are not connected. Cannot rotamerize.") return False #note that this loop does not check to see if the last nucleotide is connectedToNext, since that's not required for curIndex in range(startIndex, endIndex + 1): #make sure that the selected residues aren't modified nucleotides curResType = pseudoMol.resTypeFromIndex(curIndex) if curResType not in STANDARD_BASES: reportModifiedNucError(pseudoMol.resNumFull(curIndex), curResType) return False #make sure that all selected residues have phosphates and glycosidic bonds missingAtom = pseudoMol.checkPhosAndGlycosidicFromIndex(curIndex) if missingAtom is not None: print "Nucleotide " + pseudoMol.resNumFull( curIndex ) + " is missing " + missingAtom + " atom. Cannot rotamerize without phosphate and glycosidic bond coordinates." add_status_bar_text( "Nucleotide " + pseudoMol.resNumFull(curIndex) + " is missing " + missingAtom + " atom. Cannot rotamerize without phosphate and glycosidic bond coordinates." ) return False
if connectedToPrev and pseudoMol.resNum(resIndex - 1)[1] != "": reportInsCodeError(pseudoMol.resNumFull(resIndex - 1)) return False #figure out which residue we should be checking for PDB2 naming and missing glycosidic bond atoms if curResIsPhosOnly: resIndexToCheck = resIndex - 1 resNumFullToCheck = pseudoMol.resNumFull(resIndex - 1) else: resIndexToCheck = resIndex resNumFullToCheck = resNumFull #make sure that this nucleotide isn't mdofied resType = pseudoMol.resTypeFromIndex(resIndexToCheck) if resType not in STANDARD_BASES: reportModifiedNucError(resNumFullToCheck, resType) return False #make sure that the molecule (or at least the end of it we're going to be building on) uses PDB3 atom naming if pseudoMol.checkPDB2FromIndex(resIndexToCheck): reportPDB2Error(resNumFullToCheck) return False #the current residue must have a glycosidic bond baseType = pseudoMol.resTypeFromIndex(resIndexToCheck) if baseType == "A" or baseType == "G": glyN = "N9" else: #we already know that the base isn't modified because we checked above glyN = "N1"
if connectedToPrev and pseudoMol.resNum(resIndex-1)[1] != "": reportInsCodeError(pseudoMol.resNumFull(resIndex-1)) return False #figure out which residue we should be checking for PDB2 naming and missing glycosidic bond atoms if curResIsPhosOnly: resIndexToCheck = resIndex - 1 resNumFullToCheck = pseudoMol.resNumFull(resIndex - 1) else: resIndexToCheck = resIndex resNumFullToCheck = resNumFull #make sure that this nucleotide isn't mdofied resType = pseudoMol.resTypeFromIndex(resIndexToCheck) if resType not in STANDARD_BASES: reportModifiedNucError(resNumFullToCheck, resType) return False #make sure that the molecule (or at least the end of it we're going to be building on) uses PDB3 atom naming if pseudoMol.checkPDB2FromIndex(resIndexToCheck): reportPDB2Error(resNumFullToCheck) return False #the current residue must have a glycosidic bond baseType = pseudoMol.resTypeFromIndex(resIndexToCheck) if baseType == "A" or baseType== "G": glyN = "N9" else: #we already know that the base isn't modified because we checked above glyN = "N1"
return False #make sure that the selected residues are all connected for curIndex in range(startIndex, endIndex): if not pseudoMol.connectedToNextFromIndex(curIndex): print "Nucleotides " + pseudoMol.resNumFull(curIndex) + " and " + pseudoMol.resNumFull(curIndex+1) + " are not connected. Cannot rotamerize." add_status_bar_text("Nucleotides " + pseudoMol.resNumFull(curIndex) + " and " + pseudoMol.resNumFull(curIndex+1) + " are not connected. Cannot rotamerize.") return False #note that this loop does not check to see if the last nucleotide is connectedToNext, since that's not required for curIndex in range(startIndex, endIndex+1): #make sure that the selected residues aren't modified nucleotides curResType = pseudoMol.resTypeFromIndex(curIndex) if curResType not in STANDARD_BASES: reportModifiedNucError(pseudoMol.resNumFull(curIndex), curResType) return False #make sure that all selected residues have phosphates and glycosidic bonds missingAtom = pseudoMol.checkPhosAndGlycosidicFromIndex(curIndex) if missingAtom is not None: print "Nucleotide " + pseudoMol.resNumFull(curIndex) + " is missing " + missingAtom + " atom. Cannot rotamerize without phosphate and glycosidic bond coordinates." add_status_bar_text("Nucleotide " + pseudoMol.resNumFull(curIndex) + " is missing " + missingAtom + " atom. Cannot rotamerize without phosphate and glycosidic bond coordinates.") return False #if the ending res is the last residue of the chain, then change it to the second to last residue #since we need a terminal 3' phosphate #(Note that createPartialChainObject will then add the extra 3' phosphate) if (endIndex + 1) >= pseudoMol.getNumNts() or not pseudoMol.connectedToNextFromIndex(endIndex): endIndex -= 1 endResFull = pseudoMol.resNumFull(endIndex)