def create_cluster(n_start, start, end, n_end, product='a'): cluster = Cluster(FeatureLocation(start, end), FeatureLocation(n_start, n_end), tool="testing", product=product, cutoff=1, neighbourhood_range=0, detection_rule="some rule text") cds = create_cds(start, end, [product]) cluster.add_cds(cds) return cluster
def create_cluster(self, rule_name, start, end): rule = self.rules_by_name[rule_name] core = FeatureLocation(start, end) surrounds = FeatureLocation(max(0, start - rule.extent), end + rule.extent) return Cluster(core, surrounds, tool="testing", cutoff=rule.cutoff, neighbourhood_range=rule.extent, product=rule_name, detection_rule="rule text")
def create_cluster(start, end, product='a'): return Cluster(FeatureLocation(start, end), FeatureLocation(start, end), tool="testing", product=product, cutoff=1, neighbourhood_range=0, detection_rule="some rule text")
def create_cluster(): cluster = Cluster(FeatureLocation(8, 71, strand=1), FeatureLocation(3, 76, strand=1), tool="test", cutoff=17, neighbourhood_range=5, product='a', detection_rule="some rule text") return cluster
def test_biopython_conversion(self): bio = self.cluster.to_biopython() assert len(bio) == 2 assert bio[0].type == "protocluster" and bio[1].type == "proto_core" new = Cluster.from_biopython(bio[0]) assert new is not self.cluster assert new.cutoff == self.cluster.cutoff == 17 assert new.neighbourhood_range == self.cluster.neighbourhood_range == 5 assert new.product == self.cluster.product == 'a' assert new.location.start == self.cluster.location.start == 3 assert new.core_location.start == self.cluster.core_location.start == 8 assert new.detection_rule == self.cluster.detection_rule == "some rule text" assert new.tool == self.cluster.tool == "test" assert new.location.start == self.cluster.location.start == 3 assert new.location.end == self.cluster.location.end == 76 assert new.core_location.start == self.cluster.core_location.start == 8 assert new.core_location.end == self.cluster.core_location.end == 71