def setUp(self):
     key = "ConversionResults"
     qc_config = {'name': 'UndeterminedPercentageHandler', 'error': 10, 'warning': 20}
     value = get_stats_json()["ConversionResults"]
     undetermined_handler = UndeterminedPercentageHandler(qc_config)
     undetermined_handler.collect((key, value))
     self.undetermined_handler = undetermined_handler
    def test_no_yield(self):
        key = "ConversionResults"
        value = get_stats_json()["ConversionResults"]
        value[0]["Yield"] = 0
        self.undetermined_handler.collect((key, value))

        errors_and_warnings = list(self.undetermined_handler.check_qc())
        class_names = self.map_errors_and_warnings_to_class_names(errors_and_warnings)
        self.assertListEqual(class_names, ['QCErrorFatal'])
Esempio n. 3
0
 def setUp(self):
     key = "ConversionResults"
     qc_config = {
         'name': 'TotalClustersPF',
         'error': '50',
         'warning': '110'
     }
     value = get_stats_json()["ConversionResults"]
     cluster_pf_handler = ClusterPFHandler(qc_config)
     cluster_pf_handler.collect((key, value))
     self.cluster_pf_handler = cluster_pf_handler
 def setUp(self):
     key = "ConversionResults"
     qc_config = {
         'name': 'ReadsPerSampleHandler',
         'error': 'unknown',
         'warning': '90'
     }
     value = get_stats_json()["ConversionResults"]
     reads_per_sample_handler = ReadsPerSampleHandler(qc_config)
     reads_per_sample_handler.collect((key, value))
     self.reads_per_sample_handler = reads_per_sample_handler
    def setUp(self):

        qc_config = {
            'name': 'UnidentifiedIndexHandler',
            'significance_threshold': 1,
            'white_listed_indexes': ['.*N.*', 'G{8,}']
        }
        self.unidentifiedIndexHandler = UnidentifiedIndexHandler(qc_config)

        conversion_results_key = "ConversionResults"
        conversion_results = get_stats_json()["ConversionResults"]
        samplesheet_key = "samplesheet"
        self.samplesheet = SampleSheet()
        sample_1 = Sample(
            dict(Lane=1,
                 Sample_ID='1823A',
                 Sample_Name='1823A-tissue',
                 index='AAAA'))
        sample_2 = Sample(
            dict(Lane=2,
                 Sample_ID='1823B',
                 Sample_Name='1823B-tissue',
                 index='TTTT'))
        sample_3 = Sample(
            dict(Lane=3,
                 Sample_ID='1823C',
                 Sample_Name='1823C-tissue',
                 index='AAAA',
                 index2='TTTT'))
        sample_4 = Sample(
            dict(Lane=4,
                 Sample_ID='1823D',
                 Sample_Name='1823D-tissue',
                 index='GGGG',
                 index2='CCCC'))
        sample_5 = Sample(
            dict(Lane=6,
                 Sample_ID='1823E',
                 Sample_Name='1823D-tissue',
                 index='ATCG'))
        self.samplesheet.add_sample(sample_1)
        self.samplesheet.add_sample(sample_2)
        self.samplesheet.add_sample(sample_3)
        self.samplesheet.add_sample(sample_4)
        self.samplesheet.add_sample(sample_5)

        self.unidentifiedIndexHandler.collect(
            (conversion_results_key, conversion_results))
        self.unidentifiedIndexHandler.collect(
            (samplesheet_key, self.samplesheet))

        self.samplesheet_searcher = _SamplesheetSearcher(self.samplesheet)
    def setUp(self):
        conversion_key = "ConversionResults"
        qc_config = {
            'name': 'UndeterminedPercentageHandler',
            'error': 10,
            'warning': 20
        }
        conversion_results_value = get_stats_json()["ConversionResults"]
        undetermined_handler = UndeterminedPercentageHandler(qc_config)
        undetermined_handler.collect(
            (conversion_key, conversion_results_value))

        percentage_phix_key = "percent_phix"
        percentage_phix_value_lane_1_read_1 = {
            "lane": 1,
            "read": 1,
            "percent_phix": 1
        }
        percentage_phix_value_lane_1_read_2 = {
            "lane": 1,
            "read": 2,
            "percent_phix": 1
        }
        percentage_phix_value_lane_2_read_1 = {
            "lane": 2,
            "read": 1,
            "percent_phix": 1
        }
        percentage_phix_value_lane_2_read_2 = {
            "lane": 2,
            "read": 2,
            "percent_phix": 1
        }
        undetermined_handler.collect(
            (percentage_phix_key, percentage_phix_value_lane_1_read_1))
        undetermined_handler.collect(
            (percentage_phix_key, percentage_phix_value_lane_1_read_2))
        undetermined_handler.collect(
            (percentage_phix_key, percentage_phix_value_lane_2_read_1))
        undetermined_handler.collect(
            (percentage_phix_key, percentage_phix_value_lane_2_read_2))

        self.undetermined_handler = undetermined_handler
    def test_multiple_sampleIDs_per_sampleName(self):
        key = "ConversionResults"
        qc_config = {
            'name': 'ReadsPerSampleHandler',
            'error': 'unknown',
            'warning': '1000'
        }
        value = get_stats_json(
            "180925_A00001_0001_BABCDEFGXX")["ConversionResults"]
        custom_reads_per_sample_handler = ReadsPerSampleHandler(qc_config)
        custom_reads_per_sample_handler.collect((key, value))
        errors_and_warnings = list(custom_reads_per_sample_handler.check_qc())
        self.assertEqual(len(errors_and_warnings), 4)

        class_names = self.map_errors_and_warnings_to_class_names(
            errors_and_warnings)
        self.assertListEqual(class_names, [
            'QCErrorWarning', 'QCErrorWarning', 'QCErrorWarning',
            'QCErrorWarning'
        ])