Skip to content

Commit

Permalink
v1.3.8.11 (04/09/2019) - added few changes to enable parsing of DLS v…
Browse files Browse the repository at this point in the history
…isit directories transfered to other file system (#255)
  • Loading branch information
Tobias Krojer committed Sep 4, 2019
1 parent 8281f44 commit ab70bae
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gui_scripts/settings_preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def set_xce_logfile(self, xce_object):

def settings(self, xce_object):
# set XCE version
xce_object.xce_version = 'v1.3.8.10'
xce_object.xce_version = 'v1.3.8.11'

# general settings
xce_object.allowed_unitcell_difference_percent = 12
Expand Down
2 changes: 1 addition & 1 deletion lib/XChemLog.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def create_logfile(self,version):
' # #\n'
' # Version: %s #\n' %pasteVersion+
' # #\n'
' # Date: 14/08/2019 #\n'
' # Date: 04/09/2019 #\n'
' # #\n'
' # Authors: Tobias Krojer, Structural Genomics Consortium, Oxford, UK #\n'
' # [email protected] #\n'
Expand Down
7 changes: 6 additions & 1 deletion lib/XChemMain.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,12 @@ def getVisitAndBeamline(visitDirectory):
except IndexError:
pass
if not visitDirectory.startswith('/dls'):
visit = 'unknown'
# this is all a bit of a fudge in case someone transfers a DLS visit directory back home
# does most certainly not catch all possible scenarios
if visitDirectory.split('/')[len(visitDirectory.split('/')) - 2] == 'processed':
visit = visitDirectory.split('/')[len(visitDirectory.split('/')) - 3]
else:
visit = visitDirectory.split('/')[len(visitDirectory.split('/'))-1]
beamline = 'unknown'
return visit,beamline

Expand Down
14 changes: 13 additions & 1 deletion lib/XChemThread.py
Original file line number Diff line number Diff line change
Expand Up @@ -1991,6 +1991,7 @@ def __init__(self,
self.allSamples.append(e)
else:
self.allSamples = self.db.collected_xtals_during_visit_for_scoring(visit)
print 'here', self.allSamples
# self.allSamples = self.db.collected_xtals_during_visit_for_scoring(visit,rescore)


Expand Down Expand Up @@ -2178,6 +2179,7 @@ def __init__(self,
# self.target = target
self.processedDir = processedDir
self.visit,self.beamline = XChemMain.getVisitAndBeamline(self.processedDir)
print 'visit'
self.projectDir = projectDir
self.Logfile = XChemLog.updateLog(xce_logfile)
self.target = target
Expand Down Expand Up @@ -2285,9 +2287,18 @@ def makeJPGdir(self,xtal,run):
def copyJPGs(self,xtal,run):
# for img in glob.glob(os.path.join(self.processedDir.replace('processed','jpegs'),xtal,run+'*t.png')):
# for img in glob.glob(os.path.join(self.processedDir.replace('processed', 'jpegs'), run + '*t.png')):
self.Logfile.insert('%s: trying to copy crystal snapshots...' %xtal)
found = False
for img in glob.glob(os.path.join(self.processedDir.replace('processed', 'jpegs'), run + '*.0.png')):
found = True
if not os.path.isfile(os.path.join(self.projectDir,xtal,'jpg', self.visit +'-'+ run,img[img.rfind('/')+1:])):
self.Logfile.insert('%s: copying %s' % (xtal, img))
os.system('/bin/cp %s %s' %(img,os.path.join(self.projectDir,xtal,'jpg', self.visit + '-' + run)))
if not found:
for img in glob.glob(os.path.join(self.processedDir.replace('processed', 'jpegs'), xtal, run + '*.0.png')):
if not os.path.isfile(os.path.join(self.projectDir, xtal, 'jpg', self.visit + '-' + run, img[img.rfind('/') + 1:])):
self.Logfile.insert('%s: copying %s' % (xtal, img))
os.system('/bin/cp %s %s' % (img, os.path.join(self.projectDir, xtal, 'jpg', self.visit + '-' + run)))

def findJPGs(self,xtal,run):
jpgDict={}
Expand Down Expand Up @@ -2371,7 +2382,8 @@ def parse_file_system(self):

runList = []
for collected_xtals in sorted(glob.glob(os.path.join(self.processedDir,'*'))):
self.visit = collected_xtals.split('/')[5]
# why is this here? self.visit is derived in init function through XChemMain.getVisitAndBeamline
# self.visit = collected_xtals.split('/')[5]
if 'tmp' in collected_xtals or 'results' in collected_xtals or 'scre' in collected_xtals:
continue
if not os.path.isdir(collected_xtals):
Expand Down

0 comments on commit ab70bae

Please sign in to comment.