From 97bc4dc77aced021d2c22d70b5aa304e86b6c8eb Mon Sep 17 00:00:00 2001 From: kohleman <kohleman> Date: Wed, 14 Mar 2012 10:52:32 +0000 Subject: [PATCH] undetermined files get now the Flow Cell Name in the file Name, otherwise these files are not unique SVN: 24721 --- .../dist/etc/data-set-handler-unaligned.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/deep_sequencing_unit/dist/etc/data-set-handler-unaligned.py b/deep_sequencing_unit/dist/etc/data-set-handler-unaligned.py index 860679da985..c47815e82b4 100755 --- a/deep_sequencing_unit/dist/etc/data-set-handler-unaligned.py +++ b/deep_sequencing_unit/dist/etc/data-set-handler-unaligned.py @@ -10,7 +10,7 @@ import os import glob import shutil import time -from java.lang import RuntimeException +#from java.lang import RuntimeException from ch.systemsx.cisd.openbis.generic.shared.api.v1.dto import SearchCriteria from ch.systemsx.cisd.openbis.generic.shared.api.v1.dto import SearchSubCriteria @@ -30,6 +30,14 @@ def touch_markerfile(filename): except: print('Could not touch ' + filename) +def renameFiles(dir, flowcellName): + print dir + print flowcellName + for root, dirs, files in os.walk(dir): + for file in files: + print root + file + os.rename(root + '/' + file, root + "/" + flowcellName + "_" + file) + # Create a "transaction" -- a way of grouping operations together so they all # happen or none of them do. @@ -56,6 +64,10 @@ laneList.sort() undeterminedList=glob.glob(incomingPath + '/'+ UNALIGNED_FOLDER + REGEX_UNDETERMINED) undeterminedList.sort() + +# add the Flow Cell Name to the Undetermined FASTQ files +[renameFiles(dir, flowcell) for dir in undeterminedList] + # Multiplexing: # First move the Undetermined reads to the other ones [shutil.move(undeterminedLane, laneList[int(undeterminedLane.split('/')[-1][-1])-1] +'/' + undeterminedLane.split('/')[-1]) for undeterminedLane in undeterminedList] @@ -76,6 +88,7 @@ transaction.createNewDirectory(dataSet, UNALIGNED_FOLDER) # move all files is data set [transaction.moveFile(file, dataSet, UNALIGNED_FOLDER) for file in fileList] # move base call stat dir into data set +print("flowcell: "+flowcell) transaction.moveFile(incomingPath + '/' + UNALIGNED_FOLDER + '/' + BASECALL_STATS_FOLDER + flowcell, dataSet, UNALIGNED_FOLDER + '/') # Get the search service -- GitLab