From 94e95c89a91aeebe11c3198adf51850074bc3d99 Mon Sep 17 00:00:00 2001 From: Michael Barton Date: Sat, 11 Oct 2008 17:27:35 +0100 Subject: [PATCH] Created task to print correlations by gene data --- .../004_compare_mutation_and_cost/analysis.rake | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/analysis/004_compare_mutation_and_cost/analysis.rake b/analysis/004_compare_mutation_and_cost/analysis.rake index aaa8f64..ef50001 100644 --- a/analysis/004_compare_mutation_and_cost/analysis.rake +++ b/analysis/004_compare_mutation_and_cost/analysis.rake @@ -10,4 +10,19 @@ namespace '004' do Alignment.each {|align| CorrelationByGene.estimate_for(align)} end + desc 'Print gene correlation data' + task :print_gene_correlation_data do + target = File.join(File.dirname(__FILE__),'r','data','correlation_by_gene.csv') + FasterCSV.open(target,'w') do |csv| + CorrelationByGene.each do |cor| + csv << [ + cor.alignment.gene.name, + cor.condition.name, + cor.cost_type.name, + cor.r + ] + end + end + end + end