Esempio n. 1
0
 def test_wrong_peptides_onlypept(self):
     """
     When onlypept file has wrong peptides
     """
     path_ = path.join(wrong_pepts_dir, "wrong_pepts_onlypept.xls")
     p = proteomic_xls.sequest_onlypept_parser()
     a_d = dict(fileName=path_)
     self.assertRaises(data_input.bad_format_peptide, p.parse, **a_d)
Esempio n. 2
0
 def test_bad_format_real_discoverer(self):
     """
     Should fail with format no data_discoverer using
     wrong data_discoverer analysis files
     """
     p = proteomic_xls.sequest_onlypept_parser()
     self.match_format_parser(p.parse, protpept_dir)
     self.match_format_parser(p.parse, discoverer_dir)
Esempio n. 3
0
 def test_file_source_store_op(self):
     """
     testing the original seq storage
     """
     p = proteomic_xls.sequest_onlypept_parser(mode=True)
     for f in self.files:
         try:
             p.parse(path.join(onlypept_dir, f))
         except proteomic_xls.EmptyCell:
             pass
     self.assertListEqual([path.join(onlypept_dir, f) for f in self.files],
                          p.sources)
Esempio n. 4
0
 def test_proteins_onlypept(self):
     """
     proteins occurrence during parsing the five file
     """
     p = proteomic_xls.sequest_onlypept_parser()
     for i, f in enumerate(self.files):
         try:
             p.parse(path.join(onlypept_dir, f))
         except proteomic_xls.EmptyCell:
             pass
         for acc, occs in self.prots:
             self.assertEqual(occs[i], p.proteins[acc], "%d != %d @prot: %s, @time: %d"\
                 %(occs[i], p.proteins[acc], acc, i))
Esempio n. 5
0
 def test_peptides_onlypept_red(self):
     """
     peptides occurrence during parsing the five file
     Spectral Count True
     """
     p = proteomic_xls.sequest_onlypept_parser(mode=True)
     for i, f in enumerate(self.files):
         try:
             p.parse(path.join(onlypept_dir, f))
         except proteomic_xls.EmptyCell:
             pass
         for acc, pepts in self.onlypepts:
             for seq, occs_nr, occs_r in pepts:
                 self.assertEqual(occs_r[i], p.peptides[acc][seq], "%d, %s, %s" %(i, acc, seq))
Esempio n. 6
0
 def test_spectral_count_false_onlypept(self):
     """
     Using a onlypept file with peptides no-distinct,
     the frequencies must be equal to one.
     """
     chase2 = path.join(redundants_dir, "redundant_onlypept.xls")
     p = proteomic_xls.sequest_onlypept_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)