Esempio n. 1
0
 def test_remove_protein(self):
     """tests that remove_protein can accurately remove a  protein with the given id"""
     tester = constool.remove_protein(
         ">PROCA12070 | ENSPCAG00000012030 | HOG:0377891.2a.2a | [Procavia capensis]\n"
         "MKTRQNKDSMSMRSGRKKEAPGPREELRSRGRASPGGVSTSSSDGKAEKSRQTAKKARVEEVSAPKVSKQGRGEEISESE\n"
         ">LOXAF14113 | G3TAL7 | HOG:0377891.2a.2a | [Loxodonta africana]\n"
         "MKTRQNKDSMSMRSGRKKEAPGPREELRSRGRASPGGVSTSSSDGKAEKSRQTA\n"
         ">ECHTE02547 | ENSETEG00000016682 | HOG:0377891.2a.2a | [Echinops telfairi]\n"
         "MKTRQNKDSMSMRSGRKKEAPGPREELRS", "LOXAF14113")
     self.assertEqual(
         tester,
         ">PROCA12070 | ENSPCAG00000012030 | HOG:0377891.2a.2a | [Procavia capensis]\n"
         "MKTRQNKDSMSMRSGRKKEAPGPREELRSRGRASPGGVSTSSSDGKAEKSRQTAKKARVEEVSAPKVSKQGRGEEISESE\n"
         ">ECHTE02547 | ENSETEG00000016682 | HOG:0377891.2a.2a | [Echinops telfairi]\n"
         "MKTRQNKDSMSMRSGRKKEAPGPREELRS")
Esempio n. 2
0
 def test_remove_protein_nothing(self):
     """Tests that remove protein deosnt remove anythign if the entry ID is not in string"""
     tester = constool.remove_protein(
         ">PROCA12070 | ENSPCAG00000012030 | HOG:0377891.2a.2a | [Procavia capensis]\n"
         "MKTRQNKDSMSMRSGRKKEAPGPREELRSRGRASPGGVSTSSSDGKAEKSRQTAKKARVEEVSAPKVSKQGRGEEISESE\n"
         ">LOXAF14113 | G3TAL7 | HOG:0377891.2a.2a | [Loxodonta africana]\n"
         "MKTRQNKDSMSMRSGRKKEAPGPREELRSRGRASPGGVSTSSSDGKAEKSRQTA\n"
         ">ECHTE02547 | ENSETEG00000016682 | HOG:0377891.2a.2a | [Echinops telfairi]\n"
         "MKTRQNKDSMSMRSGRKKEAPGPREELRS", "PROXY90210")
     self.assertEqual(
         tester,
         ">PROCA12070 | ENSPCAG00000012030 | HOG:0377891.2a.2a | [Procavia capensis]\n"
         "MKTRQNKDSMSMRSGRKKEAPGPREELRSRGRASPGGVSTSSSDGKAEKSRQTAKKARVEEVSAPKVSKQGRGEEISESE\n"
         ">LOXAF14113 | G3TAL7 | HOG:0377891.2a.2a | [Loxodonta africana]\n"
         "MKTRQNKDSMSMRSGRKKEAPGPREELRSRGRASPGGVSTSSSDGKAEKSRQTA\n"
         ">ECHTE02547 | ENSETEG00000016682 | HOG:0377891.2a.2a | [Echinops telfairi]\n"
         "MKTRQNKDSMSMRSGRKKEAPGPREELRS")
Esempio n. 3
0
 def get_HOGs(self):
     """
     Retrieves a fasta file containing the sequences of the proteins in the HOG to the input protein, based on the input
     parameters.
     """
     if not self.fasta:
         raise SequenceError("Input sequence is empty!")
     self.sequence = constool.get_fasta_sequence(fasta=self.fasta)
     if self.has_run_hogs:
         output = self.HOGs
     else:
         self.retrieve_OMAid()
         self.retrieve_HOG_level()
         output = self.HOG_to_fasta()
         output = constool.remove_protein(output, self.id)
         self.has_run_hogs = True
     return output