Exemplo n.º 1
0
 def test_full_coverage(self):
     g = Gene('rep5.1_rep(pMW2)_NC005011', 10, 0)
     self.assertTrue(g.is_full_coverage())
     self.assertEqual(str(
         g),
         'rep5.1	Full	100	NC005011	plasmidfinder'
         '	rep5.1_rep(pMW2)_NC005011')
Exemplo n.º 2
0
	def full_gene_coverage(self, counter):
		self.logger.info("Check the coverage of a sequence")
		alleles = []
		
		for (gene_name, kmers_dict) in self.fasta_obj.sequences_to_kmers.items():
			kv = kmers_dict.values()
			kv_total_length = len(kmers_dict)
			kz = len([x for x in kv if x == 0])
			kl  = kv_total_length - kz

			if kl > kz:
				alleles.append(Gene(gene_name, kl, kz))
				
		self.print_out_alleles(self.filter_contained_alleles(alleles))
		self.identify_alleles_with_100_percent(alleles)
		
		return alleles
Exemplo n.º 3
0
 def test_inc_double_dash_name(self):
     g = Gene('IncFII(S).1__CP000851', 5, 5)
     self.assertEqual(g.short_name(), "IncFII(S).1")
     self.assertEqual(g.accession(), "CP000851")
Exemplo n.º 4
0
 def test_rep_with_slash_name(self):
     g = Gene('rep6.1_repA(p703/5)_AF109375', 5, 5)
     self.assertEqual(g.short_name(), "rep6.1")
     self.assertEqual(g.accession(), "AF109375")
Exemplo n.º 5
0
 def test_rep_name(self):
     g = Gene('rep5.1_rep(pMW2)_NC005011', 5, 5)
     self.assertEqual(g.short_name(), "rep5.1")
     self.assertEqual(g.accession(), "NC005011")
Exemplo n.º 6
0
 def test_nc_name(self):
     g = Gene('Col(BS512).1__NC_010656.2', 5, 5)
     self.assertEqual(g.accession(), "NC_010656.2")
     self.assertEqual(g.short_name(), "Col(BS512).1")
Exemplo n.º 7
0
 def test_medium_coverage(self):
     g = Gene('rep5.1_rep(pMW2)_NC005011', 5, 5)
     self.assertFalse(g.is_full_coverage())
     self.assertEqual(str(
         g), 'rep5.1	Partial	50	NC005011	plasmidfinder'
         '	rep5.1_rep(pMW2)_NC005011')
Exemplo n.º 8
0
	def test_no_coverage(self):
		g = Gene('rep5.1_rep(pMW2)_NC005011', 0, 10)
		self.assertFalse(g.is_full_coverage())
		self.assertEqual(str(g), 'rep5.1	Partial	0	NC005011	plasmidfinder	rep5.1_rep(pMW2)_NC005011')