Skip to content
Snippets Groups Projects
Commit 97bc4dc7 authored by kohleman's avatar kohleman
Browse files

undetermined files get now the Flow Cell Name in the file Name, otherwise...

undetermined files get now the Flow Cell Name in the file Name, otherwise these files are not unique

SVN: 24721
parent d0650b7d
No related branches found
No related tags found
No related merge requests found
...@@ -10,7 +10,7 @@ import os ...@@ -10,7 +10,7 @@ import os
import glob import glob
import shutil import shutil
import time 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 SearchCriteria
from ch.systemsx.cisd.openbis.generic.shared.api.v1.dto import SearchSubCriteria from ch.systemsx.cisd.openbis.generic.shared.api.v1.dto import SearchSubCriteria
...@@ -30,6 +30,14 @@ def touch_markerfile(filename): ...@@ -30,6 +30,14 @@ def touch_markerfile(filename):
except: except:
print('Could not touch ' + filename) 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 # Create a "transaction" -- a way of grouping operations together so they all
# happen or none of them do. # happen or none of them do.
...@@ -56,6 +64,10 @@ laneList.sort() ...@@ -56,6 +64,10 @@ laneList.sort()
undeterminedList=glob.glob(incomingPath + '/'+ UNALIGNED_FOLDER + REGEX_UNDETERMINED) undeterminedList=glob.glob(incomingPath + '/'+ UNALIGNED_FOLDER + REGEX_UNDETERMINED)
undeterminedList.sort() undeterminedList.sort()
# add the Flow Cell Name to the Undetermined FASTQ files
[renameFiles(dir, flowcell) for dir in undeterminedList]
# Multiplexing: # Multiplexing:
# First move the Undetermined reads to the other ones # 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] [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) ...@@ -76,6 +88,7 @@ transaction.createNewDirectory(dataSet, UNALIGNED_FOLDER)
# move all files is data set # move all files is data set
[transaction.moveFile(file, dataSet, UNALIGNED_FOLDER) for file in fileList] [transaction.moveFile(file, dataSet, UNALIGNED_FOLDER) for file in fileList]
# move base call stat dir into data set # move base call stat dir into data set
print("flowcell: "+flowcell)
transaction.moveFile(incomingPath + '/' + UNALIGNED_FOLDER + '/' + BASECALL_STATS_FOLDER + flowcell, dataSet, UNALIGNED_FOLDER + '/') transaction.moveFile(incomingPath + '/' + UNALIGNED_FOLDER + '/' + BASECALL_STATS_FOLDER + flowcell, dataSet, UNALIGNED_FOLDER + '/')
# Get the search service # Get the search service
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment