Example #1
0
 def test_real_redundant_discoverer(self):
     """
     When there aren't redundancy data_discoverer
     """
     path_ = path.join(redundants_dir,
         "redundant_accessions_discoverer.xls")
     p = proteomic_xls.discoverer_parser()
     a_d = dict(fileName=path_)
     self.assertRaises(proteomic_xls.Same_Accession, p.parse, **a_d)
Example #2
0
 def test_file_source_store(self):
     """
     testing the original seq storage
     """
     p = proteomic_xls.discoverer_parser(mode=True)
     for f in self.files:
         try:
             p.parse(path.join(discoverer_dir, f))
         except proteomic_xls.EmptyCell:
             pass
     self.assertListEqual([path.join(discoverer_dir, f)\
         for f in self.files], p.sources)
Example #3
0
 def test_proteins(self):
     """
     proteins occurrence during parsing the five file
     """
     p = proteomic_xls.discoverer_parser()
     msg = "{0}: predicted {1} != counted {2}"
     for i, f in enumerate(self.files):
         try:
             p.parse(path.join(discoverer_dir, f))
         except proteomic_xls.EmptyCell:
             pass
         for acc, occs in self.prots:
             self.assertEqual(occs[i], p.proteins[acc], msg.format(acc, occs[i], p.proteins[acc]))
Example #4
0
 def test_spectral_count_false_discoverer(self):
     """
     Using a data_discoverer file with peptides no-distinct,
     the frequencies must be equal to one.
     """
     chase2 = path.join(redundants_dir, "redundant_discoverer.xls")
     p = proteomic_xls.discoverer_parser()
     try:
         p.parse(chase2)
     except proteomic_xls.EmptyCell:
         pass
     finally:
         for acc, pepts in p.peptides.iteritems():
             for seq, occ in pepts.iteritems():
                 self.assertEqual(occ, 1)
Example #5
0
 def test_peptides_protpept_nored(self):
     """
     peptides occurrence during parsing the five file
     Spectral count False
     """
     p = proteomic_xls.discoverer_parser()
     for i, f in enumerate(self.files):
         try:
             p.parse(path.join(discoverer_dir, f))
         except proteomic_xls.EmptyCell:
             pass
         for acc, pepts in self.pepts:
             for seq, occs_nr, occs_r in pepts:
                 self.assertEqual(occs_nr[i], p.peptides[acc][seq], "{0} - {1}:{2} aspected {3} != retrived {4}".format(
                 f, acc, seq, occs_nr[i], p.peptides[acc][seq]))
Example #6
0
 def test_wrong_peptides_discoverer(self):
     path_ = path.join(wrong_pepts_dir, "wrong_pepts_discoverer.xls")
     p = proteomic_xls.discoverer_parser()
     a_d = dict(fileName=path_)
     self.assertRaises(data_input.bad_format_peptide, p.parse, **a_d)