示例#1
0
 def validate(self):
     errors = []
     if self.MaskMode=="Binary mask" and not os.path.exists(self.MaskFile):
         errors.append(self.MaskFile+" does not exist")
     if which("nma_diag_arpack")=="":
         errors.append("Cannot find nma_diag_arpack in the PATH")
     if which("nma_diagrtb")=="":
         errors.append("Cannot find nma_diagrtb in the PATH")
     return errors
示例#2
0
    def validate(self):
        errors = []
        md = MetaData()
        md.read(self.ImgMd, 1) # Read only the first object in md
        
        if md.containsLabel(MDL_IMAGE):
            if not getattr(self, 'Is2D', False):
                self._validateInputSize('Ref3D', 'Reference volume', True, md, errors)
            self._validateInputSize('ReferenceMask', 'Reference mask', False, md, errors)
            self._validateInputSize('SolventMask','Solvent mask', False, md, errors)
        else:
            errors.append("Input metadata <%s> doesn't contains image label" % self.ImgMd)
            
        if self.DoCTFCorrection and not self._containsCTF(md):
            errors.append("CTF correction selected and input metadata <%s> doesn't contains CTF information" % self.ImgMd)
            
        # Check relion is installed
        if len(which('relion_refine')) == 0:
            errors.append('<relion_refine> was not found.') 
        if len(which('relion_movie_handler')) == 0:
            errors.append('''program "relion_movie_handler" is missing. 
                             Are you sure you have relion version 1.2?.''') 
        
        if self.DoContinue:
            errors += self.__validateContinue()
            if self.PrevRun:
                errors += self._validateContinue()
        else:
            errors += self._validate()
            
        if not findAcquisitionInfo(self.ImgMd):
            errors.append("""Acquisition file for metadata %s is not available. 
Either import images before using them
or create a file named acquisition_info.xmd 
(see example below) and place it in the same directory than 
the %s file

EXAMPLE:
# XMIPP_STAR_1 *
# change XXXXX by the sampling rate
data_noname
 _sampling_rate XXXXX
""" %(self.ImgMd,self.ImgMd))

        return errors 
示例#3
0
def detectMatlab():
    from protlib_utils import which
    matlab_home = None
    matlab = which('matlab')
    if matlab:
        from os.path import dirname
        from protlib_filesystem import findRealFile
        matlab_home = dirname(dirname(findRealFile(matlab)))
    return matlab_home
示例#4
0
def detectJava():
    from protlib_utils import which
    java_home = None
    javac = which('javac')
    if javac:
        from os.path import dirname
        from protlib_filesystem import findRealFile
        java_home = dirname(dirname(findRealFile(javac)))
    return java_home