예제 #1
0
    def test_options(self):
        options = Namespace()
        for threshold in [0., 0.5, 1.0]:
            options.tta_threshold = threshold
            assert not tta.check_options(options)

        options.tta_threshold = 1.01
        assert tta.check_options(options) == [
            "Supplied threshold is out of range 0 to 1: 1.01"
        ]
        options.tta_threshold = -0.01
        assert tta.check_options(options) == [
            "Supplied threshold is out of range 0 to 1: -0.01"
        ]
예제 #2
0
    def test_nisin(self):
        record = parse_input_sequence(helpers.get_path_to_nisin_with_detection())[0]
        clusters = record.get_clusters()
        assert clusters
        for cluster in clusters:
            assert cluster.cds_children
        assert record.get_cds_features_within_clusters()
        before_count = record.get_feature_count()

        assert tta.check_prereqs() == []
        assert tta.check_options(self.options) == []
        assert tta.is_enabled(self.options)
        prior_results = None
        results = tta.run_on_record(record, prior_results, self.options)
        assert isinstance(results, ModuleResults)
        assert len(results.features) == 174
        assert record.get_feature_count() == before_count
        results.add_to_record(record)
        assert record.get_feature_count() == before_count + 174
예제 #3
0
    def test_nisin(self):
        record = Record.from_genbank(
            helpers.get_path_to_nisin_with_detection(), taxon="bacteria")[0]
        regions = record.get_regions()
        assert regions
        for region in regions:
            assert region.cds_children
        assert record.get_cds_features_within_regions()
        before_count = record.get_feature_count()

        assert tta.check_prereqs() == []
        assert tta.check_options(self.options) == []
        assert tta.is_enabled(self.options)
        prior_results = None
        results = tta.run_on_record(record, prior_results, self.options)
        assert isinstance(results, ModuleResults)
        assert len(results.features) == 174
        assert record.get_feature_count() == before_count
        results.add_to_record(record)
        assert record.get_feature_count() == before_count + 174