def pickAtoms(ignoreDensity=False): """Prompt the user to pick two atoms to rotamerize a stretch of nucleotides. Alternatively, if we're already waiting for the user to pick atoms, then cancel the pending picks. ARGUMENTS: None OPTIONAL ARGUMENTS: ignoreDensity - ignore the density when performing the minimization defaults to False RETURNS: None """ #create the citation pop-up if necessary createCitationPopup() global waitingForClicks #make sure that we're not waiting on a pending extendChain call extendChain.clearPendingExtendChain() if waitingForClicks: #if we're already in the middle of a rotamerize call, then cancel the pending rotamerize print "Rotamerize cancelled" add_status_bar_text("Rotamerize cancelled") clear_pending_picks( ) #tell Coot to stop waiting for the user to click on atoms __setMenuToRotamerize() waitingForClicks = False else: #if we're not in the middle of a rotamerize call, then start one #make sure that there is a refinement map set if not ignoreDensity and imol_refinement_map() == -1: print "No refinement map set for RCrane rotamerize" selectMapDialog(pickAtoms) return print "Click on 2 atoms (in the same molecule)" add_status_bar_text( "Pick 2 atoms [Ctrl Left-mouse rotates the view]...") __setMenuToCancel() waitingForClicks = True user_defined_click( 2, lambda atomSpec1, atomSpec2: rotamerizeFromAtomSpecs( atomSpec1, atomSpec2, ignoreDensity))
def pickAtoms(ignoreDensity = False): """Prompt the user to pick two atoms to rotamerize a stretch of nucleotides. Alternatively, if we're already waiting for the user to pick atoms, then cancel the pending picks. ARGUMENTS: None OPTIONAL ARGUMENTS: ignoreDensity - ignore the density when performing the minimization defaults to False RETURNS: None """ #create the citation pop-up if necessary createCitationPopup() global waitingForClicks #make sure that we're not waiting on a pending extendChain call extendChain.clearPendingExtendChain() if waitingForClicks: #if we're already in the middle of a rotamerize call, then cancel the pending rotamerize print "Rotamerize cancelled" add_status_bar_text("Rotamerize cancelled") clear_pending_picks() #tell Coot to stop waiting for the user to click on atoms __setMenuToRotamerize() waitingForClicks = False else: #if we're not in the middle of a rotamerize call, then start one #make sure that there is a refinement map set if not ignoreDensity and imol_refinement_map() == -1: print "No refinement map set for RCrane rotamerize" selectMapDialog(pickAtoms) return print "Click on 2 atoms (in the same molecule)" add_status_bar_text("Pick 2 atoms [Ctrl Left-mouse rotates the view]...") __setMenuToCancel() waitingForClicks = True user_defined_click(2, lambda atomSpec1, atomSpec2: rotamerizeFromAtomSpecs(atomSpec1, atomSpec2, ignoreDensity))
def pickAtoms(): """Prompt the user to pick an atoms to extend a stretch of nucleotides. Alternatively, if we're already waiting for the user to pick an atom, then cancel the pending pick. ARGUMENTS: None RETURNS: None """ #create the citation pop-up if necessary createCitationPopup() #make sure that we're not waiting on a pending rotamerize call rotamerize.clearPendingRotamerize() global waitingForClicks if waitingForClicks: #if we're already in the middle of an extend chain call, then cancel the pending call print "Rotamerize cancelled" add_status_bar_text("Extend chain cancelled") clear_pending_picks( ) #tell Coot to stop waiting for the user to click on atoms __setMenuToExtendChain() waitingForClicks = False else: #if we're not in the middle of a extend chain call, then start one #make sure that there is a refinement map set if imol_refinement_map() == -1: print "No refinement map set for RCrane extend chain" selectMapDialog(pickAtoms) return print "Click on a nucleotide to extend" add_status_bar_text( "Pick a nucleotide [Ctrl Left-mouse rotates the view]...") __setMenuToCancel() waitingForClicks = True user_defined_click(1, extendChainFromAtomSpec)
def pickAtoms(): """Prompt the user to pick an atoms to extend a stretch of nucleotides. Alternatively, if we're already waiting for the user to pick an atom, then cancel the pending pick. ARGUMENTS: None RETURNS: None """ #create the citation pop-up if necessary createCitationPopup() #make sure that we're not waiting on a pending rotamerize call rotamerize.clearPendingRotamerize() global waitingForClicks if waitingForClicks: #if we're already in the middle of an extend chain call, then cancel the pending call print "Rotamerize cancelled" add_status_bar_text("Extend chain cancelled") clear_pending_picks() #tell Coot to stop waiting for the user to click on atoms __setMenuToExtendChain() waitingForClicks = False else: #if we're not in the middle of a extend chain call, then start one #make sure that there is a refinement map set if imol_refinement_map() == -1: print "No refinement map set for RCrane extend chain" selectMapDialog(pickAtoms) return print "Click on a nucleotide to extend" add_status_bar_text("Pick a nucleotide [Ctrl Left-mouse rotates the view]...") __setMenuToCancel() waitingForClicks = True user_defined_click(1, extendChainFromAtomSpec)