Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
# Changelog

## Currently in development

* New maintenance task: update missing checksum one, after dss start.
## 1.6.0 2021-01-22

* Fix for workflow result registration: fetch sample by identifier instead of search for robustness against indexing problems
* Retry sample tracking updates twice and log failures that occur

## 1.5.0 2020-11-03

* New maintenance task: update missing checksum once, after dss starts.
* Fix for nanopore registration: rename folders for pooling case
* Fix for experiment update: force identifier into a string to support v3 API objects

## 1.4.1 2020-11-03

* Imgag dropbox: raise an exception, if files of unknown type are part of the transaction

## 1.4.0

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/qbicsoftware/omero-portlet)
![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/qbicsoftware/etl-scripts)
![Python Language](https://img.shields.io/badge/language-python-blue.svg)
![License](https://img.shields.io/github/license/qbicsoftware/etl-scripts)
[![DOI](https://zenodo.org/badge/45912621.svg)](https://zenodo.org/badge/latestdoi/45912621)
Expand Down
15 changes: 14 additions & 1 deletion drop-boxes/register-IdXML-dropbox/register-IdXML-dropbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
sys.path.append('/home-link/qeana10/bin/')

import checksum
import time
import re
import os
import ch.systemsx.cisd.etlserver.registrator.api.v2
Expand Down Expand Up @@ -103,4 +104,16 @@ def process(transaction):
transaction.moveFile(incomingPath, dataSet)

#sample tracking section
SAMPLE_TRACKER.updateSampleLocationToCurrentLocation(identifier)
wait_seconds = 1
max_attempts = 3
for attempt in range(max_attempts):
try:
SAMPLE_TRACKER.updateSampleLocationToCurrentLocation(identifier)
break
except:
print "Updating location for sample "+identifier+" failed on attempt "+str(attempt+1)
if attempt < max_attempts -1:
time.sleep(wait_seconds)
continue
else:
raise
15 changes: 14 additions & 1 deletion drop-boxes/register-archived-ms-raw/register-raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import checksum
import re
import time
import os
import ch.systemsx.cisd.etlserver.registrator.api.v2
from java.io import File
Expand Down Expand Up @@ -104,4 +105,16 @@ def process(transaction):
transaction.moveFile(incomingPath, dataSet)

#sample tracking section
SAMPLE_TRACKER.updateSampleLocationToCurrentLocation(parentCode)
wait_seconds = 1
max_attempts = 3
for attempt in range(max_attempts):
try:
SAMPLE_TRACKER.updateSampleLocationToCurrentLocation(parentCode)
break
except:
print "Updating location for sample "+parentCode+" failed on attempt "+str(attempt+1)
if attempt < max_attempts -1:
time.sleep(wait_seconds)
continue
else:
raise
Binary file not shown.
15 changes: 14 additions & 1 deletion drop-boxes/register-bam-dropbox/register-bam.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import checksum
import re
import time
import os
import ch.systemsx.cisd.etlserver.registrator.api.v2
from java.io import File
Expand Down Expand Up @@ -136,4 +137,16 @@ def process(transaction):
transaction.moveFile(incomingPath, dataSet)

#sample tracking section
SAMPLE_TRACKER.updateSampleLocationToCurrentLocation(parentCode)
wait_seconds = 1
max_attempts = 3
for attempt in range(max_attempts):
try:
SAMPLE_TRACKER.updateSampleLocationToCurrentLocation(parentCode)
break
except:
print "Updating location for sample "+parentCode+" failed on attempt "+str(attempt+1)
if attempt < max_attempts -1:
time.sleep(wait_seconds)
continue
else:
raise
15 changes: 13 additions & 2 deletions drop-boxes/register-convert-ms-vendor-format/etl_msconvert.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,8 +484,19 @@ def __str__(self):
return self.value

def handleSampleTracking(barcode):
#sample tracking section
SAMPLE_TRACKER.updateSampleLocationToCurrentLocation(barcode)
wait_seconds = 1
max_attempts = 3
for attempt in range(max_attempts):
try:
SAMPLE_TRACKER.updateSampleLocationToCurrentLocation(barcode)
break
except:
print "Updating location for sample "+barcode+" failed on attempt "+str(attempt+1)
if attempt < max_attempts -1:
time.sleep(wait_seconds)
continue
else:
raise

def createRawDataSet(transaction, incomingPath, sample, format, time_stamp):
rawDataSet = transaction.createNewDataSet("Q_MS_RAW_DATA")
Expand Down
15 changes: 14 additions & 1 deletion drop-boxes/register-fasta-dropbox/register-fasta.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import checksum
import re
import time
import os
import ch.systemsx.cisd.etlserver.registrator.api.v2
from java.io import File
Expand Down Expand Up @@ -152,4 +153,16 @@ def process(transaction):
transaction.moveFile(new_folder, dataSet)

# Updates the sample location of the extract sample
SAMPLE_TRACKER.updateSampleLocationToCurrentLocation(identifier)
wait_seconds = 1
max_attempts = 3
for attempt in range(max_attempts):
try:
SAMPLE_TRACKER.updateSampleLocationToCurrentLocation(identifier)
break
except:
print "Updating location for sample "+identifier+" failed on attempt "+str(attempt+1)
if attempt < max_attempts -1:
time.sleep(wait_seconds)
continue
else:
raise
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import checksum
import re
import time
import os
import ch.systemsx.cisd.etlserver.registrator.api.v2
from java.io import File
Expand Down Expand Up @@ -167,4 +168,16 @@ def process(transaction):
transaction.moveFile(incomingPath, dataSet)

#sample tracking section
SAMPLE_TRACKER.updateSampleLocationToCurrentLocation(identifier)
wait_seconds = 1
max_attempts = 3
for attempt in range(max_attempts):
try:
SAMPLE_TRACKER.updateSampleLocationToCurrentLocation(identifier)
break
except:
print "Updating location for sample "+identifier+" failed on attempt "+str(attempt+1)
if attempt < max_attempts -1:
time.sleep(wait_seconds)
continue
else:
raise
16 changes: 15 additions & 1 deletion drop-boxes/register-fastq-dropbox/register-fastq-dropbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import checksum
import re
import time
import os
import ch.systemsx.cisd.etlserver.registrator.api.v2
from java.io import File
Expand Down Expand Up @@ -128,4 +129,17 @@ def process(transaction):
nameFile.close()
transaction.moveFile(incomingPath, dataSet)

SAMPLE_TRACKER.updateSampleLocationToCurrentLocation(identifier)
# sample tracking
wait_seconds = 1
max_attempts = 3
for attempt in range(max_attempts):
try:
SAMPLE_TRACKER.updateSampleLocationToCurrentLocation(identifier)
break
except:
print "Updating location for sample "+identifier+" failed on attempt "+str(attempt+1)
if attempt < max_attempts -1:
time.sleep(wait_seconds)
continue
else:
raise
15 changes: 14 additions & 1 deletion drop-boxes/register-featureXML-dropbox/register-fXML-dropbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import checksum
import re
import time
import os
import ch.systemsx.cisd.etlserver.registrator.api.v2
from java.io import File
Expand Down Expand Up @@ -103,4 +104,16 @@ def process(transaction):
transaction.moveFile(incomingPath, dataSet)

#sample tracking section
SAMPLE_TRACKER.updateSampleLocationToCurrentLocation(identifier)
wait_seconds = 1
max_attempts = 3
for attempt in range(max_attempts):
try:
SAMPLE_TRACKER.updateSampleLocationToCurrentLocation(identifier)
break
except:
print "Updating location for sample "+identifier+" failed on attempt "+str(attempt+1)
if attempt < max_attempts -1:
time.sleep(wait_seconds)
continue
else:
raise
15 changes: 14 additions & 1 deletion drop-boxes/register-hlatyping-dropbox/register-hlatyping.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
sys.path.append('/home-link/qeana10/bin/')

import checksum
import time
import re
import os
import ch.systemsx.cisd.etlserver.registrator.api.v2
Expand Down Expand Up @@ -149,4 +150,16 @@ def process(transaction):
transaction.moveFile(resultPath, dataSet)

#sample tracking section
SAMPLE_TRACKER.updateSampleLocationToCurrentLocation(parentCode)
wait_seconds = 1
max_attempts = 3
for attempt in range(max_attempts):
try:
SAMPLE_TRACKER.updateSampleLocationToCurrentLocation(parentCode)
break
except:
print "Updating location for sample "+parentCode+" failed on attempt "+str(attempt+1)
if attempt < max_attempts -1:
time.sleep(wait_seconds)
continue
else:
raise
27 changes: 20 additions & 7 deletions drop-boxes/register-imgag-dropbox/register-imgag.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,13 +596,14 @@ def process(transaction):
print rawFile
if rawFile.endswith("vcf") or rawFile.endswith("vcf.gz"):
vcfs.append(rawFile)
if rawFile.endswith("fastq") or rawFile.endswith("fastq.gz"):
elif rawFile.endswith("fastq") or rawFile.endswith("fastq.gz"):
fastqs.append(rawFile)
if rawFile.endswith("GSvar") or rawFile.endswith("GSvar.gz"):
elif rawFile.endswith("GSvar") or rawFile.endswith("GSvar.gz"):
gsvars.append(rawFile)
if rawFile.endswith("tsv") or rawFile.endswith("tsv.gz"):
elif rawFile.endswith("tsv") or rawFile.endswith("tsv.gz"):
tsvs.append(rawFile)

else:
raise Exception(rawFile + " is of an unsupported format")

#if rawFiles[0].endswith("vcf") or rawFiles[0].endswith("vcf.gz"):
# datasetSample = find_and_register_vcf(transaction, jsonContent)
Expand Down Expand Up @@ -663,7 +664,19 @@ def process(transaction):

transaction.moveFile(vcfFolder, vcfDataSet)
else:
find_and_register_ngs_without_metadata(transaction, parentCodes)
find_and_register_ngs_without_metadata(transaction, parentCodes)
for code in parentCodes:
#sample tracking section
SAMPLE_TRACKER.updateSampleLocationToCurrentLocation(code)
#sample tracking section
wait_seconds = 1
max_attempts = 3
for attempt in range(max_attempts):
try:
SAMPLE_TRACKER.updateSampleLocationToCurrentLocation(code)
break
except:
print "Updating location for sample "+code+" failed on attempt "+str(attempt+1)
if attempt < max_attempts -1:
time.sleep(wait_seconds)
continue
else:
raise
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import checksum
import re
import time
import os
import ch.systemsx.cisd.etlserver.registrator.api.v2
from java.io import File
Expand Down Expand Up @@ -103,4 +104,16 @@ def process(transaction):
transaction.moveFile(incomingPath, dataSet)

#sample tracking section
SAMPLE_TRACKER.updateSampleLocationToCurrentLocation(parentCode)
wait_seconds = 1
max_attempts = 3
for attempt in range(max_attempts):
try:
SAMPLE_TRACKER.updateSampleLocationToCurrentLocation(parentCode)
break
except:
print "Updating location for sample "+parentCode+" failed on attempt "+str(attempt+1)
if attempt < max_attempts -1:
time.sleep(wait_seconds)
continue
else:
raise
15 changes: 14 additions & 1 deletion drop-boxes/register-microarrays-dropbox/register-cel-dropbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import checksum
import re
import time
import os
import ch.systemsx.cisd.etlserver.registrator.api.v2
from java.io import File
Expand Down Expand Up @@ -192,4 +193,16 @@ def process(transaction):
os.remove(os.path.realpath(os.path.join(incomingPath,f)))
#sample tracking section
for code in trackingCodes:
SAMPLE_TRACKER.updateSampleLocationToCurrentLocation(code)
wait_seconds = 1
max_attempts = 3
for attempt in range(max_attempts):
try:
SAMPLE_TRACKER.updateSampleLocationToCurrentLocation(code)
break
except:
print "Updating location for sample "+code+" failed on attempt "+str(attempt+1)
if attempt < max_attempts -1:
time.sleep(wait_seconds)
continue
else:
raise
21 changes: 16 additions & 5 deletions drop-boxes/register-mtb-data-dropbox/register-mtb-data-dropbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,22 @@
#############################################################################

def update_sample_location_to_qbic(sampleId):
"""Calls the sample status service and updates the
location to QBiC and the status 'DATA AT QBiC'.
"""
# Update sample location
SAMPLE_TRACKER.updateSampleLocationToCurrentLocation(sampleId)
"""Calls the sample status service and updates the
location to QBiC and the status 'DATA AT QBiC'.
"""
wait_seconds = 1
max_attempts = 3
for attempt in range(max_attempts):
try:
SAMPLE_TRACKER.updateSampleLocationToCurrentLocation(sampleId)
break
except:
print("Updating location for sample " + sampleId + " failed on attempt "+str(attempt+1))
if attempt < max_attempts -1:
time.sleep(wait_seconds)
continue
else:
raise


def process(transaction):
Expand Down
Loading