From 94a8bb4bfe6c88c26a7dc3acd295e13545c42c03 Mon Sep 17 00:00:00 2001
From: kohleman <kohleman>
Date: Wed, 4 Feb 2015 13:06:35 +0000
Subject: [PATCH] check if file fastq is empty

SVN: 33383
---
 .../register-lane-nextseq/register-lane-nextseq.py   | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/deep_sequencing_unit/sourceTest/core-plugins/illumina-qgf/1/dss/drop-boxes/register-lane-nextseq/register-lane-nextseq.py b/deep_sequencing_unit/sourceTest/core-plugins/illumina-qgf/1/dss/drop-boxes/register-lane-nextseq/register-lane-nextseq.py
index 4b6a2ce3456..0aa2807a577 100644
--- a/deep_sequencing_unit/sourceTest/core-plugins/illumina-qgf/1/dss/drop-boxes/register-lane-nextseq/register-lane-nextseq.py
+++ b/deep_sequencing_unit/sourceTest/core-plugins/illumina-qgf/1/dss/drop-boxes/register-lane-nextseq/register-lane-nextseq.py
@@ -19,6 +19,7 @@ import subprocess
 from time import *
 from datetime import *
 from ch.systemsx.cisd.openbis.generic.shared.api.v1.dto import SearchCriteria
+from __builtin__ import file
 
 FASTQ_GZ_PATTERN = "*.fastq.gz"
 METADATA_FILE_SUFFIX = "_metadata.tsv"
@@ -51,7 +52,14 @@ def getThreadProperties(transaction):
       pass
   return threadPropertyDict
 
+def checkOnFileSize(file):
+    return os.stat(file).st_size == 0
+
 def CRC32_from_file(filename, transaction):
+    
+    if checkOnFileSize(filename):
+        raise Exception("FILE " + filename + " IS EMPTY!")
+    
     threadPropertyDict = getThreadProperties(transaction)
     absolutePath = os.path.dirname(os.path.realpath(threadPropertyDict['script-path']))
     fullPathCrc32 = (os.path.join(absolutePath, CRC32_PATH))
@@ -170,8 +178,8 @@ def extraCopySciCore (affiliation_name, filePath, destinationFolder=""):
     Handles the extra copies of the data for transfer with datamover for SCICORE
     '''
     
-    #dropBoxFolder = '/tmp/scicore'
-    dropBoxFolder = '/links/shared/dsu/dss/customers/biozentrum_scicore/drop-box'
+    dropBoxFolder = '/tmp/scicore'
+#     dropBoxFolder = '/links/shared/dsu/dss/customers/biozentrum_scicore/drop-box'
     basename = os.path.basename(filePath)
     
     print("extraCopySciCore")
-- 
GitLab