Skip to content

Commit 0a9e79a

Browse files
wow-such-codeKochTobisven1103
authored
Prepare release 1.11.0 (#96)
* change ms conversion server * remove some log files dependent on origin lab (#95) Co-authored-by: Tobias Koch <[email protected]> * handle data without unclassified reads * Update CL (#92) Co-authored-by: Tobias Koch <[email protected]> Co-authored-by: Sven F <[email protected]>
1 parent e1cea11 commit 0a9e79a

File tree

3 files changed

+34
-10
lines changed

3 files changed

+34
-10
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
# 1.11.0 2022-05-09
4+
5+
* Nanopore data: allows new result structure with barcode alignment file and 'other reports' folder (requires core-utils-lib 1.11.0 or later)
6+
* Nanopore data: introduces map to remove log files that should not be saved dependent on different datamover origins
7+
* Fix for nanopore: data without unclassified reads does not lead to error upon registration
8+
* Ptx mass spec data: change msconvert server
9+
310
# 1.10.0 2021-07-26
411

512
* Provides new ETL for MTB project data that are not supposed to be stored in QUK17 [(#89)](https://github.com/qbicsoftware/etl-scripts/pull/89)

drop-boxes/register-convert-ms-vendor-format/etl_msconvert.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
DROPBOX_PATH = "/mnt/DSS1/openbis_dss/QBiC-convert-register-ms-vendor-format/"
6868
VENDOR_FORMAT_EXTENSIONS = {'.raw':'RAW_THERMO', '.d':'D_BRUKER'}#,'.wiff':'WIFF_SCIEX'}
6969
WATERS_FORMAT = "RAW_WATERS"
70-
MSCONVERT_HOST = "qmsconvert.am10.uni-tuebingen.de"
70+
MSCONVERT_HOST = "qmsconvert2.am10.uni-tuebingen.de"
7171
MSCONVERT_USER = "qbic"
7272
REMOTE_BASE = "/cygdrive/d/etl-convert"
7373
CONVERSION_TIMEOUT = 7200
@@ -971,4 +971,4 @@ def process(transaction):
971971

972972
for f in os.listdir(incomingPath):
973973
if ".testorig" in f:
974-
os.remove(os.path.realpath(os.path.join(incomingPath, f)))
974+
os.remove(os.path.realpath(os.path.join(incomingPath, f)))

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

+25-8
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@
5858
usedExperimentIdentifiers = set()
5959
checksumMap = {}
6060

61+
# facilities that want us to remove certain log files
62+
blacklistedByFacility = {"qeana03-imgagdna": ["DutyTimeLog", "FinalSummaryLog", "ReportMdLog", "ReportPDFLog", "ThroughputLog", "DriftCorrectionLog", "MuxScanDataLog"]}
63+
6164
def createNewSample(transaction, space, parentSampleCode):
6265
run = 0
6366
sampleExists = True
@@ -100,15 +103,26 @@ def getTimeStamp():
100103
ts = str(now.minute)+str(now.second)+str(now.microsecond)
101104
return ts
102105

106+
def copyFileTo(file, filePath, targetFolderPath):
107+
sourcePath = os.path.join(filePath, file.getName())
108+
shutil.copy2(sourcePath, targetFolderPath)
109+
src = os.path.join(filePath, file.getName())
110+
shutil.copy2(src, targetFolderPath)
111+
103112
# copies log files from a folder that may contain other files to another path
104-
def copyLogFilesTo(logFiles, filePath, targetFolderPath):
113+
# log files that are blacklisted are not copied and thus not registered (after metadata extraction)
114+
def copyLogFilesTo(logFiles, filePath, targetFolderPath, facilityName):
115+
# return list of files to remove for this facility or empty list
116+
blacklist = blacklistedByFacility.get(facilityName, [])
117+
numIgnoredFiles = 0
105118
for logFile in logFiles:
106-
sourcePath = os.path.join(filePath, logFile.getName())
107-
shutil.copy2(sourcePath, targetFolderPath)
108-
src = os.path.join(filePath, logFile.getName())
109-
shutil.copy2(src, targetFolderPath)
119+
fileType = logFile.__class__.__name__
120+
if fileType in blacklist:
121+
numIgnoredFiles += 1
122+
else :
123+
copyFileTo(logFile, filePath, targetFolderPath)
110124
copiedContent = os.listdir(targetFolderPath)
111-
if len(copiedContent) != len(logFiles):
125+
if len(copiedContent) + numIgnoredFiles != len(logFiles):
112126
raise AssertionError("Not all log files have been copied successfully to target log folder.")
113127

114128
def createLogFolder(targetPath):
@@ -117,6 +131,9 @@ def createLogFolder(targetPath):
117131
os.makedirs(newLogFolder)
118132
return newLogFolder
119133

134+
def containsUnclassifiedData(unclassifiedMap):
135+
return not all(v is None for v in unclassifiedMap.values())
136+
120137
def createExperimentFromMeasurement(transaction, currentPath, space, project, measurement, origin, rawDataPerSample):
121138
""" Register the experiment with samples in openBIS.
122139
In order to register the Nanopore experiment with its measurements in openBIS,
@@ -162,10 +179,10 @@ def createExperimentFromMeasurement(transaction, currentPath, space, project, me
162179
datamap = rawDataPerSample.get(barcode)
163180
newLogFolder = createLogFolder(currentPath)
164181
# 3.) Aggregate all log files into an own log folder per measurement
165-
copyLogFilesTo(measurement.getLogFiles(), currentPath, newLogFolder)
182+
copyLogFilesTo(measurement.getLogFiles(), currentPath, newLogFolder, origin)
166183
createSampleWithData(transaction, space, barcode, datamap, runExperiment, currentPath, newLogFolder)
167184
unclassifiedMap = measurement.getUnclassifiedData()
168-
if len(unclassifiedMap) > 0:
185+
if containsUnclassifiedData(unclassifiedMap):
169186
registerUnclassifiedData(transaction, unclassifiedMap, runExperiment, currentPath, measurement.getFlowcellId())
170187

171188
# fills the global dictionary containing all checksums for paths from the global checksum file

0 commit comments

Comments
 (0)