Example #1
0
 def test_exists(self):
     f = open(self.unique, 'w')
     f.close()
     p = functions.get_new_path(self.unique)
     new_p = self.unique + '-0'
     self.assertEqual(p, new_p)
     self.assertTrue(os.path.exists(p))
Example #2
0
 def write_result_summaries(self,
                            prior_indices=None,
                            sep='\t',
                            include_tau_exclusion_info=False):
     if not prior_indices:
         prior_indices = self.prior_index_to_config.keys()
         if self.combined_prior_index:
             prior_indices.append(self.combined_prior_index)
     for prior_idx in prior_indices:
         for observed_idx in self.observed_index_to_path.iterkeys():
             out_path = self.get_result_summary_path(
                 observed_idx, prior_idx)
             out_path = functions.get_new_path(out_path)
             out, close = process_file_arg(out_path,
                                           'w',
                                           compresslevel=self.compresslevel)
             keys = []
             for i, r in enumerate(
                     self.flat_result_iter(observed_idx, prior_idx,
                                           include_tau_exclusion_info)):
                 if i == 0:
                     keys = r.keys()
                     out.write('{0}\n'.format(sep.join(keys)))
                 out.write('{0}\n'.format(
                     sep.join([str(r[k]) for k in keys])))
             out.close()
Example #3
0
 def test_exists(self):
     f = open(self.unique, 'w')
     f.close()
     p = functions.get_new_path(self.unique)
     new_p = self.unique + '-0'
     self.assertEqual(p, new_p)
     self.assertTrue(os.path.exists(p))
Example #4
0
 def write_result_summaries(self, prior_indices = None, sep = '\t',
         include_tau_exclusion_info = False):
     if not prior_indices:
         prior_indices = self.prior_index_to_config.keys()
         if self.combined_prior_index:
             prior_indices.append(self.combined_prior_index)
     for prior_idx in prior_indices:
         for observed_idx in self.observed_index_to_path.iterkeys():
             out_path = self.get_result_summary_path(observed_idx, prior_idx)
             out_path = functions.get_new_path(out_path)
             out, close = process_file_arg(out_path, 'w',
                     compresslevel = self.compresslevel)
             keys = []
             for i, r in enumerate(self.flat_result_iter(observed_idx,
                     prior_idx, include_tau_exclusion_info)):
                 if i == 0:
                     keys = r.keys()
                     out.write('{0}\n'.format(sep.join(keys)))
                 out.write('{0}\n'.format(sep.join([str(r[k
                         ]) for k in keys])))
             out.close()
Example #5
0
 def test_unique(self):
     p = functions.get_new_path(self.unique)
     self.assertEqual(p, self.unique)
     self.assertTrue(os.path.exists(p))
Example #6
0
 def test_unique(self):
     p = functions.get_new_path(self.unique)
     self.assertEqual(p, self.unique)
     self.assertTrue(os.path.exists(p))