Exemplo n.º 1
0
def checkCootAndReportErrors():
    """Run both pre-launch checks (Coot version and monomer library) and report any errors that occur
    
    ARGUMENTS:
        None
    RETURNS:
        True if the Coot version is recent enough to run RCrane and Coot is using an appropriate monomer library
        False otherwise
    EFFECTS:
        If Coot fails a pre-launch check, an error will be printed to standard output and a pop-up
        will appear explaining the error
    """

    if not checkVersion():
        #if this version of Coot isn't new enough for RCrane, print an error message to the terminal and pop up an error dialog
        print "RCrane requires Coot version 0.6.2 or newer."
        print "Current Coot version is " + str(coot_version())
        print "RCrane not launched."

        errorDialog = gtk.MessageDialog(type=gtk.MESSAGE_ERROR,
                                        buttons=gtk.BUTTONS_OK)
        errorDialog.set_title("RCrane Error")
        errorDialog.set_markup(
            "RCrane requires Coot version 0.6.2 or newer.  RCrane not launched."
        )
        errorDialog.run()
        errorDialog.destroy()
        return False

    elif not checkMonomerLibrary():
        #if Coot's monomer library isn't correct, print an error message to the terminal and pop up an error dialog
        print "Monomer library is out of date.  RCrane not launched."

        errorDialog = gtk.MessageDialog(type=gtk.MESSAGE_ERROR,
                                        buttons=gtk.BUTTONS_OK)
        errorDialog.set_title("RCrane Error")
        errorDialog.set_markup(
            """RCrane was not launched because Coot appears to be using an out-of-date monomer library.  Coot cannot refine RNA unless the monomer library is updated.

This problem is typically caused by running Coot on a computer with an old version of CCP4 (<6.2) installed.  If this is the case, there are two solutions:

1) Set $COOT_REFMAC_LIB_DIR to
/path/to/Coot/share/coot/lib before running Coot.
Under Bash, this can be done with the command:
  export COOT_REFMAC_LIB_DIR=/path/to/coot/share/coot/lib
with /path/to/coot replaced by the appropriate Coot directory.

2) Upgrade your CCP4 installation to 6.2 or newer.""")

        errorDialog.run()
        errorDialog.destroy()
        return False

    else:
        return True
Exemplo n.º 2
0
def checkCootAndReportErrors():
    """Run both pre-launch checks (Coot version and monomer library) and report any errors that occur
    
    ARGUMENTS:
        None
    RETURNS:
        True if the Coot version is recent enough to run RCrane and Coot is using an appropriate monomer library
        False otherwise
    EFFECTS:
        If Coot fails a pre-launch check, an error will be printed to standard output and a pop-up
        will appear explaining the error
    """
    
    if not checkVersion():
        #if this version of Coot isn't new enough for RCrane, print an error message to the terminal and pop up an error dialog
        print "RCrane requires Coot version 0.6.2 or newer."
        print "Current Coot version is " + str(coot_version())
        print "RCrane not launched."
        
        errorDialog = gtk.MessageDialog(type = gtk.MESSAGE_ERROR, buttons = gtk.BUTTONS_OK)
        errorDialog.set_title("RCrane Error")
        errorDialog.set_markup("RCrane requires Coot version 0.6.2 or newer.  RCrane not launched.")    
        errorDialog.run()
        errorDialog.destroy()
        return False
        
    elif not checkMonomerLibrary():
        #if Coot's monomer library isn't correct, print an error message to the terminal and pop up an error dialog
        print "Monomer library is out of date.  RCrane not launched."
        
        errorDialog = gtk.MessageDialog(type = gtk.MESSAGE_ERROR, buttons = gtk.BUTTONS_OK)
        errorDialog.set_title("RCrane Error")
        errorDialog.set_markup("""RCrane was not launched because Coot appears to be using an out-of-date monomer library.  Coot cannot refine RNA unless the monomer library is updated.

This problem is typically caused by running Coot on a computer with an old version of CCP4 (<6.2) installed.  If this is the case, there are two solutions:

1) Set $COOT_REFMAC_LIB_DIR to
/path/to/Coot/share/coot/lib before running Coot.
Under Bash, this can be done with the command:
  export COOT_REFMAC_LIB_DIR=/path/to/coot/share/coot/lib
with /path/to/coot replaced by the appropriate Coot directory.

2) Upgrade your CCP4 installation to 6.2 or newer.""")
        
        errorDialog.run()
        errorDialog.destroy()
        return False
        
    else:
        return True
Exemplo n.º 3
0
# License. You may obtain a copy of the License at
#
# http://www.osedu.org/licenses/ECL-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an "AS IS"
# BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing
# permissions and limitations under the License.

from coot import coot_version

LONG_BOND_DIST_CUTOFF = 2.16

#Coot 0.6.2 and 0.7 have different distance cut-offs for deciding whether or not to draw a bond
if coot_version()[0:3] == "0.6":
    BOND_DIST_CUTOFF = 1.64  #value for the Coot's 0.6.2 branch
else:
    BOND_DIST_CUTOFF = 1.71  #value for the Coot trunk (i.e. 0.7 and newer)

BOND_LIST = [
    (" P  ", " OP1", LONG_BOND_DIST_CUTOFF
     ),  #the P-OP1 and P-OP2 bonds must be the first two elements of this list
    (" P  ", " OP2", LONG_BOND_DIST_CUTOFF
     ),  #since we use BOND_LIST[0:2] as the bond list for the last nucleotide
    (" P  ", " O5'", LONG_BOND_DIST_CUTOFF),
    (" C1'", " C2'", BOND_DIST_CUTOFF),
    (" C2'", " C3'", BOND_DIST_CUTOFF),
    (" C3'", " C4'", BOND_DIST_CUTOFF),
    (" C3'", " O3'", BOND_DIST_CUTOFF),
    (" C4'", " C5'", BOND_DIST_CUTOFF),
Exemplo n.º 4
0
# License. You may obtain a copy of the License at
# 
# http://www.osedu.org/licenses/ECL-2.0
# 
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an "AS IS"
# BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing
# permissions and limitations under the License.

from coot import coot_version

LONG_BOND_DIST_CUTOFF = 2.16

#Coot 0.6.2 and 0.7 have different distance cut-offs for deciding whether or not to draw a bond
if coot_version()[0:3] == "0.6":
    BOND_DIST_CUTOFF  = 1.64 #value for the Coot's 0.6.2 branch
else:
    BOND_DIST_CUTOFF  = 1.71 #value for the Coot trunk (i.e. 0.7 and newer)

BOND_LIST = [(" P  ", " OP1", LONG_BOND_DIST_CUTOFF),   #the P-OP1 and P-OP2 bonds must be the first two elements of this list
             (" P  ", " OP2", LONG_BOND_DIST_CUTOFF),   #since we use BOND_LIST[0:2] as the bond list for the last nucleotide
             (" P  ", " O5'", LONG_BOND_DIST_CUTOFF),
             (" C1'", " C2'", BOND_DIST_CUTOFF),
             (" C2'", " C3'", BOND_DIST_CUTOFF),
             (" C3'", " C4'", BOND_DIST_CUTOFF),
             (" C3'", " O3'", BOND_DIST_CUTOFF),
             (" C4'", " C5'", BOND_DIST_CUTOFF),
             (" C4'", " O4'", BOND_DIST_CUTOFF),
             (" O4'", " C1'", BOND_DIST_CUTOFF),
             (" C5'", " O5'", BOND_DIST_CUTOFF),