Skip to content

Commit

Permalink
store overall bins summary into a TAB-delimited matrix file. related #…
Browse files Browse the repository at this point in the history
  • Loading branch information
meren committed Oct 9, 2015
1 parent c72d4c0 commit 0641220
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions anvio/summarizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,16 @@ def process(self):
self.summary['meta']['percent_profile_nts_described_by_collection'] = '%.2f' % (self.summary['meta']['total_nts_in_collection'] * 100.0 / int(self.p_meta['total_length']))
self.summary['meta']['bins'] = self.get_bins_ordered_by_completeness_and_size()

# generate a TAB-delimited text output file for bin summaries
summary_of_bins_matrix_output = {}
properties = ['taxon', 'total_length', 'num_contigs', 'N50', 'GC_content', 'percent_complete', 'percent_redundancy']

for bin_name in self.summary['collection']:
summary_of_bins_matrix_output[bin_name] = dict([(prop, self.summary['collection'][bin_name][prop]) for prop in properties])

output_file_obj = self.get_output_file_handle(prefix = 'general_bins_summary.txt')
utils.store_dict_as_TAB_delimited_file(summary_of_bins_matrix_output, None, headers = ['bins'] + properties, file_obj = output_file_obj)

# save merged matrices for bins x samples
for table_name in self.collection_profile.values()[0].keys():
d = {}
Expand Down

0 comments on commit 0641220

Please sign in to comment.