5 * Created by Sarah Westcott on 3/25/09.
6 * Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
10 #include "heatmapcommand.h"
13 //**********************************************************************************************************************
15 HeatMapCommand::HeatMapCommand(){
17 globaldata = GlobalData::getInstance();
18 format = globaldata->getFormat();
21 cout << "Standard Error: " << e.what() << " has occurred in the HeatMapCommand class Function HeatMapCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
25 cout << "An unknown error has occurred in the HeatMapCommand class function HeatMapCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
29 //**********************************************************************************************************************
31 HeatMapCommand::~HeatMapCommand(){
36 //**********************************************************************************************************************
38 int HeatMapCommand::execute(){
42 if (format == "sharedfile") {
44 read = new ReadPhilFile(globaldata->inputFileName);
45 read->read(&*globaldata);
47 input = globaldata->ginput;
48 order = input->getSharedOrderVector();
49 }else if (format == "shared") {
50 //you are using a list and a groupfile
51 read = new ReadPhilFile(globaldata->inputFileName);
52 read->read(&*globaldata);
54 input = globaldata->ginput;
55 SharedList = globaldata->gSharedList;
56 order = SharedList->getSharedOrderVector();
57 }else if (format == "list") {
58 //you are using just a list file and have only one group
59 read = new ReadPhilFile(globaldata->inputFileName);
60 read->read(&*globaldata);
62 ordersingle = globaldata->gorder;
63 input = globaldata->ginput;
66 if (format != "list") {
69 if(globaldata->allLines == 1 || globaldata->lines.count(count) == 1 || globaldata->labels.count(order->getLabel()) == 1){
71 cout << order->getLabel() << '\t' << count << endl;
72 //call heatmap class to make file
75 //get next line to process
76 if (format == "sharedfile") {
77 order = input->getSharedOrderVector();
79 //you are using a list and a groupfile
80 SharedList = input->getSharedListVector(); //get new list vector to process
81 if (SharedList != NULL) {
82 order = SharedList->getSharedOrderVector(); //gets new order vector with group info.
90 //reset groups parameter
91 globaldata->Groups.clear(); globaldata->setGroups("");
94 while(ordersingle != NULL){
96 if(globaldata->allLines == 1 || globaldata->lines.count(count) == 1 || globaldata->labels.count(order->getLabel()) == 1){
98 cout << order->getLabel() << '\t' << count << endl;
99 //call heatmap class to make file
102 ordersingle = (input->getOrderVector());
109 catch(exception& e) {
110 cout << "Standard Error: " << e.what() << " has occurred in the HeatMapCommand class Function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
114 cout << "An unknown error has occurred in the HeatMapCommand class function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
119 //**********************************************************************************************************************