def test_merge_unaligned_folder(self): """Merging Unaligned folders and comparing the results with the expected """ self.logger.info("Merging Unaligned folders") merge_demux_results(self.fc_dir) self.logger.info("Testing the merging of Flowcell_demux_summary.xml") self.assertTrue(self._compare_flowcell_demux_summary(), "The resulting file Flowcell_demux_summary.xml is not as expected.") self.logger.info("Testing the merging of Demultiplex_Stats.htm") self.assertTrue(self._compare_demultiplex_stats(), "The resulting file Demultiplex_Stats.htm is not as expected.") self.logger.info("Testing the merging of Undemultiplexed_stats.metrics") self.assertTrue(self._compare_undemultiplexed_stats(), "The resulting file Undemultiplexed_stats.metrics is not as expected")
def process_second_read(*args, **kwargs): """Processing to be performed after all reads have been sequenced """ dname, config = args[0:2] logger2.info("The instrument has finished dumping on directory %s" % dname) utils.touch_indicator_file(os.path.join(dname, "second_read_processing_started.txt")) _update_reported(config["msg_db"], dname) fastq_dir = None # Do bcl -> fastq conversion and demultiplexing using Casava1.8+ if kwargs.get("casava", False): if not kwargs.get("no_casava_processing", False): logger2.info("Generating fastq.gz files for {:s}".format(dname)) _generate_fastq_with_casava(dname, config) # Merge demultiplexing results into a single Unaligned folder utils.merge_demux_results(dname) #Move the demultiplexing results if config.has_key('mfs_dir'): fc_id = os.path.basename(dname) cl = ["rsync", \ "--checksum", \ "--recursive", \ "--links", \ "-D", \ "--partial", \ "--progress", \ "--prune-empty-dirs", \ os.path.join(dname, 'Unaligned'), \ os.path.join(config.get('mfs_dir'), fc_id) ] logger2.info("Synching Unaligned folder to MooseFS for run {}".format(fc_id)) logdir = os.path.join(config.get('log_dir'), os.getcwd()) rsync_out = os.path.join(logdir,"rsync_transfer.out") rsync_err = os.path.join(logdir,"rsync_transfer.err") with open(rsync_out, 'a') as ro: with open(rsync_err, 'a') as re: try: ro.write("-----------\n{}\n".format(" ".join(cl))) re.write("-----------\n{}\n".format(" ".join(cl))) subprocess.check_call(cl, stdout=ro, stderr=re) except subprocess.CalledProcessError, e: logger2.error("rsync transfer of Unaligned results FAILED")
def test_merge_unaligned_folder(self): """Merging Unaligned folders and comparing the results with the expected """ self.logger.info("Merging Unaligned folders") merge_demux_results(self.fc_dir) self.logger.info("Testing the merging of Flowcell_demux_summary.xml") self.assertTrue( self._compare_flowcell_demux_summary(), "The resulting file Flowcell_demux_summary.xml is not as expected." ) self.logger.info("Testing the merging of Demultiplex_Stats.htm") self.assertTrue( self._compare_demultiplex_stats(), "The resulting file Demultiplex_Stats.htm is not as expected.") self.logger.info( "Testing the merging of Undemultiplexed_stats.metrics") self.assertTrue( self._compare_undemultiplexed_stats(), "The resulting file Undemultiplexed_stats.metrics is not as expected" )