#!/usr/bin/perl

use strict;

use warnings;

use Expression;


my $expression_file = "data/all-aml-dataset.txt";


my ($expression_data, $expression_data2);

$expression_data = Expression::new();
$expression_data2 = Expression::new();
print("Expression data is a reference to a ", ref($expression_data),
      "\n");

# perl automatically converts the next line into 
# Expression::read($expression_data, $expression_file);
$expression_data->read($expression_file);
#$expression_data2->read($expression_file);

print("Read ", $expression_data->get_num_genes(), " genes and ",
      $expression_data->get_num_samples(), " samples.\n");

my ($gene_id, $sample_id);
#$gene_id = "L49218_f_at";
$gene_id = "AFFX-BioB-5_at";
$gene_id = "AFFX-BioB-M_at";
$sample_id = "1-ALL";

print("Index of gene $gene_id is ", $expression_data->get_gene_index($gene_id),
      "\n");
print("Index of sample $sample_id is ", 
      $expression_data->get_sample_index($sample_id),
      "\n");

print("Expression value for gene $gene_id and sample $sample_id is ",
      $expression_data->get_expression_value($gene_id, $sample_id), "\n");


$sample_id = "64-AML";

print("Index of sample $sample_id is ", 
      $expression_data->get_sample_index($sample_id), "\n");

print("Expression value for gene $gene_id and sample $sample_id is ",
      $expression_data->get_expression_value($gene_id, $sample_id), "\n");

# read sample-condition pairs.
my $conditions_file = "all-aml-conditions.txt";
$expression_data->read_sample_conditions($conditions_file);
