Skip to content

Commit 4ff27d5

Browse files
committed
fix: moved unclassified folders now have unique names
1 parent 03fa68c commit 4ff27d5

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

drop-boxes/register-nanopore-dropbox/register-nanopore.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,11 @@ def createChecksumFileForFolder(incomingPath, folderPath):
196196
def prepareUnclassifiedData(transaction, unclassifiedDataObject, currentPath, destinationPath):
197197
incomingPath = transaction.getIncoming().getAbsolutePath()
198198
relativePath = unclassifiedDataObject.getRelativePath()
199-
destination = os.path.join(destinationPath, unclassifiedDataObject.getName())
200199
# the source path of the currently handled data object (e.g. unclassified fast5_fail folder)
201200
unclassifiedSourcePath = os.path.join(os.path.dirname(currentPath), relativePath)
202201
unclassifiedChecksumFile = createChecksumFileForFolder(incomingPath, unclassifiedSourcePath)
203202
# we move the unclassified object to its destination (e.g. the unclassified fast5 top folder)
204-
os.rename(unclassifiedSourcePath, destination)
203+
os.rename(unclassifiedSourcePath, destinationPath)
205204

206205
# attaches unclassified data to the run experiment without sample
207206
def registerUnclassifiedData(transaction, unclassifiedDataMap, runExperiment, currentPath, flowcellBarcode):
@@ -211,11 +210,11 @@ def registerUnclassifiedData(transaction, unclassifiedDataMap, runExperiment, cu
211210
os.makedirs(topFolderFast5)
212211

213212
#create checksum files and move unclassified folders to their top folder
214-
prepareUnclassifiedData(transaction, unclassifiedDataMap.get("fastqfail"), currentPath, topFolderFastq)
215-
prepareUnclassifiedData(transaction, unclassifiedDataMap.get("fastqpass"), currentPath, topFolderFastq)
213+
prepareUnclassifiedData(transaction, unclassifiedDataMap.get("fastqfail"), currentPath, os.path.join(topFolderFastq, "fastq_fail"))
214+
prepareUnclassifiedData(transaction, unclassifiedDataMap.get("fastqpass"), currentPath, os.path.join(topFolderFastq, "fastq_pass"))
216215

217-
prepareUnclassifiedData(transaction, unclassifiedDataMap.get("fast5fail"), currentPath, topFolderFast5)
218-
prepareUnclassifiedData(transaction, unclassifiedDataMap.get("fast5pass"), currentPath, topFolderFast5)
216+
prepareUnclassifiedData(transaction, unclassifiedDataMap.get("fast5fail"), currentPath, os.path.join(topFolderFast5, "fast5_fail"))
217+
prepareUnclassifiedData(transaction, unclassifiedDataMap.get("fast5pass"), currentPath, os.path.join(topFolderFast5, "fast5_pass"))
219218

220219
fast5DataSet = transaction.createNewDataSet(NANOPORE_FAST5_CODE)
221220
fastQDataSet = transaction.createNewDataSet(NANOPORE_FASTQ_CODE)

0 commit comments

Comments
 (0)