Exemple #1
0
 def test_bad_format_real_protpept(self):
     """
     Should fail with format no protpept using
     wrong protpept analysis files
     """
     p = proteomic_xls.sequest_protpept_parser()
     self.match_format_parser(p.parse, onlypept_dir)
     self.match_format_parser(p.parse, discoverer_dir)
Exemple #2
0
 def test_wrong_peptides_protpept(self):
     """
     When protpept file has wrong peptides
     """
     path_ = path.join(wrong_pepts_dir, "wrong_pepts_protpept.xls")
     p = proteomic_xls.sequest_protpept_parser()
     a_d = dict(fileName=path_)
     self.assertRaises(data_input.bad_format_peptide, p.parse, **a_d)
Exemple #3
0
 def test_real_redundant_protpept(self):
     """
     When there aren't redundancy in proptpept
     """
     path_ = path.join(redundants_dir,
         "redundant_accessions_protpept.xls")
     p = proteomic_xls.sequest_protpept_parser()
     a_d = dict(fileName=path_)
     self.assertRaises(proteomic_xls.Same_Accession, p.parse, **a_d)
Exemple #4
0
 def test_file_source_store_pp(self):
     """
     testing the original seq storage
     """
     p = proteomic_xls.sequest_protpept_parser(mode=True)
     for f in self.files:
         try:
             p.parse(path.join(protpept_dir, f))
         except proteomic_xls.EmptyCell:
             pass
     self.assertListEqual([path.join(protpept_dir, f) for f in self.files],
                          p.sources)
Exemple #5
0
 def test_proteins_protpept(self):
     """
     proteins occurrence during parsing the five file
     """
     p = proteomic_xls.sequest_protpept_parser()
     for i, f in enumerate(self.files):
         try:
             p.parse(path.join(protpept_dir, f))
         except proteomic_xls.EmptyCell:
             pass
         for acc, occs in self.prots:
             self.assertEqual(occs[i], p.proteins[acc])
Exemple #6
0
 def test_peptides_protpept_red(self):
     """
     peptides occurrence during parsing the five file
     Spectral Count True
     """
     p = proteomic_xls.sequest_protpept_parser(mode=True)
     for i, f in enumerate(self.files):
         try:
             p.parse(path.join(protpept_dir, f))
         except proteomic_xls.EmptyCell:
             pass
         for acc, pepts in self.pepts:
             for seq, occs_nr, occs_r in pepts:
                 self.assertEqual(occs_r[i], p.peptides[acc][seq], "%d, %s, %s" %(i, acc, seq))
Exemple #7
0
 def test_spectral_count_false_proppept(self):
     """
     Using a protpept file with peptides no-distinct,
     the frequencies must be equal to one.
     """
     chase1 = path.join(redundants_dir, "redundant_protpept.xls")
     #assert(os.path.isfile(chase1))
     p = proteomic_xls.sequest_protpept_parser()
     try:
         p.parse(chase1)
     except proteomic_xls.EmptyCell:
         pass
     finally:
         for acc, pepts in p.peptides.iteritems():
             for seq, occ in pepts.iteritems():
                 self.assertEqual(occ, 1)