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

- clean up

- call the master data export

SVN: 33386
parent 94a326ba
No related branches found
No related tags found
No related merge requests found
...@@ -29,68 +29,33 @@ Manuel Kohler ...@@ -29,68 +29,33 @@ Manuel Kohler
''' '''
import os import os
import shutil import subprocess
import glob
import xml.etree.ElementTree as etree
from ch.systemsx.cisd.openbis.generic.shared.api.v1.dto import SearchCriteria from ch.systemsx.cisd.openbis.generic.shared.api.v1.dto import SearchCriteria
IS_HISEQ_RUN=False
RUNINFO_FOLDER='/links/shared/dsu/dss/register-runstatistics/'
REGEX_RUNINFO_SAMPLE = '/Data/Status*'
REGEX_RUNINFO_REPORTS = '/Data/reports'
MARKER_STRING='.MARKER_is_finished_'
def touch_markerfile(filename):
try:
# do a touch
open(filename, 'w').close()
except:
print('Could not touch ' + filename)
def process(transaction): def process(transaction):
incomingPath = transaction.getIncoming().getPath() args = ['/links/application/dsu/export_QGF_master_data/export_QGF_master_data.sh']
name = transaction.getIncoming().getName()
folders=[] try:
folders=os.listdir(incomingPath) p = subprocess.Popen(args, stdout=subprocess.PIPE)
print(p.communicate()[0])
except:
print("Could not run: " + str(args))
split=name.split("_") incomingPath = transaction.getIncoming().getPath()
if (len(split) == 4): name = transaction.getIncoming().getName()
dataSet = transaction.createNewDataSet("ILLUMINA_HISEQ_OUTPUT")
IS_HISEQ_RUN=True
if (len(split) == 2):
dataSet = transaction.createNewDataSet("ILLUMINA_GA_OUTPUT")
#move RunInfo into a different drop box split=name.split("_")
#runInfoSample=glob.glob(incomingPath + REGEX_RUNINFO_SAMPLE) if (len(split) == 4):
#runInfoReport=glob.glob(incomingPath + REGEX_RUNINFO_REPORTS) dataSet = transaction.createNewDataSet("ILLUMINA_HISEQ_OUTPUT")
#runInfoList = runInfoSample + runInfoReport
#os.makedirs(RUNINFO_FOLDER + name + '/Data/')
#for runInfo in runInfoList:
# try:
# if os.path.isdir(runInfo):
# shutil.copytree(runInfo, RUNINFO_FOLDER + name + '/Data/' + os.path.basename(runInfo))
# else:
# shutil.copy2(runInfo, RUNINFO_FOLDER + name + '/Data/')
# except (IOError, os.error), why:
# print (runInfo, RUNINFO_FOLDER + name, str(why))
# touch_markerfile(RUNINFO_FOLDER+MARKER_STRING+name) dataSet.setMeasuredData(False)
# Create a data set and set type search_service = transaction.getSearchService()
dataSet.setMeasuredData(False) sc = SearchCriteria()
sc.addMatchClause(SearchCriteria.MatchClause.createAttributeMatch(SearchCriteria.MatchClauseAttribute.CODE, name));
# Get the search service foundSamples = search_service.searchForSamples(sc)
search_service = transaction.getSearchService()
# Search for the sample
sc = SearchCriteria()
sc.addMatchClause(SearchCriteria.MatchClause.createAttributeMatch(SearchCriteria.MatchClauseAttribute.CODE, name));
foundSamples = search_service.searchForSamples(sc)
if foundSamples.size() > 0: if foundSamples.size() > 0:
# Add the incoming file into the data set transaction.moveFile(incomingPath, dataSet)
transaction.moveFile(incomingPath, dataSet) dataSet.setSample(foundSamples[0])
dataSet.setSample(foundSamples[0]) \ No newline at end of file
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