Skip to content

Commit

Permalink
Merge pull request #14 from johandahlberg/samplesheet_naming
Browse files Browse the repository at this point in the history
arteria_samplesheet.csv -> Samplesheet.csv
  • Loading branch information
Johan Hermansson committed Dec 9, 2015
2 parents 908e94d + 5bd73a8 commit b9aa409
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bcl2fastq/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.0.0"
__version__ = "1.1.0"
15 changes: 14 additions & 1 deletion bcl2fastq/lib/bcl2fastq_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import os
from itertools import groupby
import logging
import shutil
import time

from illuminate.metadata import InteropMetadata

Expand Down Expand Up @@ -51,7 +53,11 @@ def __init__(self,
self.samplesheet_file = runfolder_input + "/SampleSheet.csv"
else:
log.debug("Got a new samplesheet. Will use that instead of the one found in the runfolder.")
new_samplesheet_file = runfolder_input + "/arteria_samplesheet.csv"
new_samplesheet_file = runfolder_input + "/SampleSheet.csv"

if os.path.exists(new_samplesheet_file):
Bcl2FastqConfig.copy_old_samplesheet(new_samplesheet_file)

Bcl2FastqConfig.write_samplesheet(samplesheet, new_samplesheet_file)
self.samplesheet_file = new_samplesheet_file

Expand Down Expand Up @@ -83,6 +89,13 @@ def __init__(self,
import multiprocessing
self.nbr_of_cores = multiprocessing.cpu_count()

@staticmethod
def copy_old_samplesheet(new_samplesheet_file):
new_path_for_old_samplesheet = new_samplesheet_file + time.strftime("%Y%m%d-%H%M%S")
log.debug("Original samplesheet: {} copied to: {}. ".
format(new_samplesheet_file, new_path_for_old_samplesheet))
shutil.copy(new_samplesheet_file, new_path_for_old_samplesheet)

@staticmethod
def write_samplesheet(samplesheet_string, new_samplesheet_file):
with open(new_samplesheet_file, "w") as f:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_bcl2fastq_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def test_start_providing_samplesheet(self):
self.assertEqual(json.loads(response.body)["link"], expected_link)
self.assertEqual(json.loads(response.body)["bcl2fastq_version"], "2.15.2")
self.assertEqual(json.loads(response.body)["state"], "started")
ws.assert_called_once_with(TestUtils.DUMMY_SAMPLESHEET_STRING, "/data/biotank3/runfolders/150415_D00457_0091_AC6281ANXX/arteria_samplesheet.csv")
ws.assert_called_once_with(TestUtils.DUMMY_SAMPLESHEET_STRING, "/data/biotank3/runfolders/150415_D00457_0091_AC6281ANXX/SampleSheet.csv")

def test_status_with_id(self):
#TODO Add real tests here!
Expand Down

0 comments on commit b9aa409

Please sign in to comment.