Пример #1
0
    def test_sample_sheet_path(self):
        fc = BaseFlowcell.init_flowcell(self.original_flowcell)
        sample_sheet = os.path.join(fc.path, 'SampleSheet.csv')
        sample_sheet_renamed = os.path.join(fc.path, 'SamapleSheet.csv.bckp')
        os.rename(sample_sheet, sample_sheet_renamed)
        sample_sheet_path = os.path.join("tests/test_data/sample_sheets/hiseqx", fc.name, 'SampleSheet.csv')
        sample_sheet_parser = SampleSheetParser(sample_sheet_path)
        self.assertEqual(fc.sample_sheet, sample_sheet_parser.data)

        os.rename(sample_sheet_renamed, sample_sheet)
Пример #2
0
    def test_sample_sheet_path(self):
        fc = BaseFlowcell.init_flowcell(self.original_flowcell)
        sample_sheet = os.path.join(fc.path, 'SampleSheet.csv')
        sample_sheet_renamed = os.path.join(fc.path, 'SamapleSheet.csv.bckp')
        os.rename(sample_sheet, sample_sheet_renamed)
        sample_sheet_path = os.path.join(
            "tests/test_data/sample_sheets/hiseqx", fc.name, 'SampleSheet.csv')
        sample_sheet_parser = SampleSheetParser(sample_sheet_path)
        self.assertEqual(fc.sample_sheet, sample_sheet_parser.data)

        os.rename(sample_sheet_renamed, sample_sheet)
Пример #3
0
	def get_running_flowcells(self):
		flowcells = []
		for data_folder in self.config.get('data_folders', []):
			# go through subfolders
			subfolders = filter(os.path.isdir, [os.path.join(data_folder, fc_path) for fc_path in os.listdir(data_folder)])
			for flowcell_path in subfolders:
				# skip non-flowcell foldersd
				if not re.match(FC_NAME_RE, os.path.basename(flowcell_path)):
					logging.warning("Flowcell name doesn't match regex: {}".format(flowcell_path))
					continue

				# depending on the type, return instance of related class (hiseq, hiseqx, miseq, etc)
				flowcell = BaseFlowcell.init_flowcell(path=flowcell_path)
				flowcells.append(flowcell)
		return flowcells
Пример #4
0
	def get_nosync_flowcells(self):
		flowcells = []
		# check nosync folder
		for data_folder in self.config.get('data_folders', []):
			nosync_folder = os.path.join(data_folder, 'nosync')
			if os.path.exists(nosync_folder):
				# move flowcell to nosync list
				for flowcell_name in os.listdir(nosync_folder):
					flowcell_path = os.path.join(nosync_folder, flowcell_name)
					# skip non-flowcell folders
					if not re.match(FC_NAME_RE, os.path.basename(flowcell_path)):
						logging.warning("Flowcell name doesn't match regex: {}".format(flowcell_path))
						continue
					flowcell = BaseFlowcell.init_flowcell(flowcell_path)
					flowcells.append(flowcell)
		return flowcells
Пример #5
0
    def test_transferring(self):
        fc = BaseFlowcell.init_flowcell(self.original_flowcell)
        self.assertIsNotNone(fc.transfering_started)
        # to make sure it's a datetime and nothing else

        transfering = {
               'hiseqx': {
                  'url': 'localhost',
                  'username': '******',
                  'path': os.path.join(os.path.abspath('tests/test_data/hiseqx')) #)'/Users/ekaterinastepanova/work/hugin/tests/test_data/hiseqx'
               }

        }

        config.update({'transfering': transfering})
        self.assertGreater(datetime.datetime.now(), fc.transfering_started)
Пример #6
0
    def test_transferring(self):
        fc = BaseFlowcell.init_flowcell(self.original_flowcell)
        self.assertIsNotNone(fc.transfering_started)
        # to make sure it's a datetime and nothing else

        transfering = {
            'hiseqx': {
                'url': 'localhost',
                'username': '******',
                'path': os.path.join(
                    os.path.abspath('tests/test_data/hiseqx')
                )  #)'/Users/ekaterinastepanova/work/hugin/tests/test_data/hiseqx'
            }
        }

        config.update({'transfering': transfering})
        self.assertGreater(datetime.datetime.now(), fc.transfering_started)
Пример #7
0
    def test_seq_demux_started_done(self):
        fc = BaseFlowcell(self.original_flowcell)
        self.assertIsNotNone(fc.sequencing_started)
        # self.assertEqual(type(fc.sequencing_started), type(datetime.datetime))
        self.assertIsNotNone(fc.sequencing_done)
        # self.assertEqual(type(fc.sequencing_done), type(datetime.datetime))
        self.assertIsNotNone(fc.demultiplexing_started)
        # self.assertEqual(type(fc.demultiplexing_started), type(datetime))
        self.assertIsNotNone(fc.demultiplexing_done)

        datetime_set = {
            type(fc.sequencing_started),
            type(fc.sequencing_done),
            type(fc.demultiplexing_started),
            type(fc.demultiplexing_done)
        }

        self.assertSetEqual({type(datetime.datetime.now())}, datetime_set)
Пример #8
0
 def get_nosync_flowcells(self):
     flowcells = []
     # check nosync folder
     for data_folder in self.config.get('data_folders', []):
         nosync_folder = os.path.join(data_folder, 'nosync')
         if os.path.exists(nosync_folder):
             # move flowcell to nosync list
             for flowcell_name in os.listdir(nosync_folder):
                 flowcell_path = os.path.join(nosync_folder, flowcell_name)
                 # skip non-flowcell folders
                 if not re.match(FC_NAME_RE,
                                 os.path.basename(flowcell_path)):
                     logging.warning(
                         "Flowcell name doesn't match regex: {}".format(
                             flowcell_path))
                     continue
                 flowcell = BaseFlowcell.init_flowcell(flowcell_path)
                 flowcells.append(flowcell)
     return flowcells
Пример #9
0
    def get_running_flowcells(self):
        flowcells = []
        for data_folder in self.config.get('data_folders', []):
            # go through subfolders
            subfolders = filter(os.path.isdir, [
                os.path.join(data_folder, fc_path)
                for fc_path in os.listdir(data_folder)
            ])
            for flowcell_path in subfolders:
                # skip non-flowcell foldersd
                if not re.match(FC_NAME_RE, os.path.basename(flowcell_path)):
                    logging.warning(
                        "Flowcell name doesn't match regex: {}".format(
                            flowcell_path))
                    continue

                # depending on the type, return instance of related class (hiseq, hiseqx, miseq, etc)
                flowcell = BaseFlowcell.init_flowcell(path=flowcell_path)
                flowcells.append(flowcell)
        return flowcells
Пример #10
0
 def test_check_status(self):
     fc = BaseFlowcell.init_flowcell(self.original_flowcell)
     self.assertEqual(fc.status, FC_STATUSES['CHECKSTATUS'])
     self.assertIsNotNone(fc.check_status)
Пример #11
0
 def test_due_date(self):
     fc = BaseFlowcell.init_flowcell(self.original_flowcell)
     self.assertGreater(datetime.datetime.now(), fc.due_date)
Пример #12
0
 def test_sequencing_started(self):
     fc = BaseFlowcell.init_flowcell(self.original_flowcell)
     self.assertIsNotNone(fc.sequencing_started)
Пример #13
0
 def test_init_flowcell(self):
     fc = BaseFlowcell.init_flowcell(self.original_flowcell)
     self.assertIsInstance(fc, HiseqxFlowcell)
Пример #14
0
 def test_run_info_present(self):
     fc = BaseFlowcell(path=self.original_flowcell)
     self.assertIsNotNone(fc.run_info)
     self.assertIsNotNone(fc.run_parameters)
     self.assertIsNotNone(fc.cycle_times)
     self.assertIsNotNone(fc.sample_sheet)
Пример #15
0
 def test_path(self):
     fc = BaseFlowcell(self.original_flowcell)
     self.assertEqual(self.original_flowcell, fc.path)
Пример #16
0
 def test_init_flowcell(self):
     fc = BaseFlowcell.init_flowcell(self.original_flowcell)
     self.assertIsInstance(fc, HiseqFlowcell)
Пример #17
0
 def test_sequencing_started(self):
     fc = BaseFlowcell.init_flowcell(self.original_flowcell)
     self.assertIsNotNone(fc.sequencing_started)
Пример #18
0
 def test_due_date(self):
     fc = BaseFlowcell.init_flowcell(self.original_flowcell)
     self.assertGreater(datetime.datetime.now(), fc.due_date)
Пример #19
0
 def test_check_status(self):
     fc = BaseFlowcell.init_flowcell(self.original_flowcell)
     self.assertEqual(fc.status, FC_STATUSES['CHECKSTATUS'])
     self.assertIsNotNone(fc.check_status)