@@ -80,7 +80,7 @@ def createNewExperiment(transaction, space, project):
80
80
newExpID = None
81
81
while expExists :
82
82
run += 1
83
- newExpID = '/' + space + '/' + project + '/' + project + str (run )
83
+ newExpID = '/' + space + '/' + project + '/' + project + 'E' + str (run )
84
84
expExists = newExpID in usedExperimentIdentifiers
85
85
usedExperimentIdentifiers .add (newExpID )
86
86
return transaction .createNewExperiment (newExpID , NANOPORE_EXP_TYPE_CODE )
@@ -103,7 +103,7 @@ def getTimeStamp():
103
103
104
104
def copyLogFilesTo (logFiles , filePath , targetFolderPath ):
105
105
for logFile in logFiles :
106
- src = os .path .join (filePath , logFile )
106
+ src = os .path .join (filePath , logFile . getName () )
107
107
shutil .copy2 (src , targetFolderPath )
108
108
copiedContent = os .listdir (targetFolderPath )
109
109
if len (copiedContent ) != len (logFiles ):
@@ -172,8 +172,15 @@ def createSampleWithData(transaction, space, parentSampleCode, mapWithDataForSam
172
172
"fastqpass": DataFolder
173
173
]
174
174
"""
175
+ search_service = transaction .getSearchService ()
176
+ sc = SearchCriteria ()
177
+ sc .addMatchClause (SearchCriteria .MatchClause .createAttributeMatch (SearchCriteria .MatchClauseAttribute .CODE , parentSampleCode ))
178
+ foundSamples = search_service .searchForSamples (sc )
179
+ parentID = foundSamples [0 ].getSampleIdentifier ()
180
+
175
181
sample = createNewSample (transaction , space , parentSampleCode )
176
182
sample .setExperiment (openbisExperiment )
183
+ sample .setParentSampleIdentifiers ([parentID ])
177
184
178
185
# Aggregate the folders fastqfail and fastqpass under a common folder "<sample code>_fastq"
179
186
topFolderFastq = os .path .join (currentPath , parentSampleCode + "_fastq" )
0 commit comments