/** * Author: Mark Larkin * * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson. */ /* * The class AlignmentOutput is used to output the Alignment in all the different * formats that have been selected. It will output all the different file types if * these have been selected from the menu or the commandline. * To use this class we must call openAlignmentOutput first. Then we call the function * createAlignmentOutput with an Alignment to be output and the first and last sequence * to be output as well. */ #ifndef ALIGNMENTOUTPUT_H #define ALIGNMENTOUTPUT_H #include #include #include #include #include #include #include #include "Alignment.h" namespace clustalw { typedef struct rangeNum { int start; int end; } rangeNum; typedef struct outputRegion { int _firstSeq; int _lastSeq; int _firstRes; int _lastRes; } outputRegion; class AlignmentOutput { public: /* Functions */ AlignmentOutput(); bool openAlignmentOutput(string path); bool QTOpenFilesForOutput(AlignmentFileNames fileNames); void createAlignmentOutput(Alignment* alignPtr, int firstSeq, int lastSeq); void printSecStructMask(int prfLength, vector* mask, vector* structMask); /* Attributes */ private: /* Functions */ void fastaOut(Alignment* alignPtr, outputRegion partToOutput); void clustalOut(Alignment* alignPtr, outputRegion partToOutput); void gcgOut(Alignment* alignPtr, outputRegion partToOutput); void nexusOut(Alignment* alignPtr, outputRegion partToOutput); void phylipOut(Alignment* alignPtr, outputRegion partToOutput); void nbrfOut(Alignment* alignPtr, outputRegion partToOutput); void gdeOut(Alignment* alignPtr, outputRegion partToOutput); string nameonly(string s); void findRangeValues(Alignment* alignPtr, rangeNum *rnum, int firstRes, int lastRes, int firstSeq); bool openExplicitFile(auto_ptr& outFile, string fileName); string openOutputFile(auto_ptr& outFile, string prompt, string path, string fileExtension); int SeqGCGCheckSum(vector* sequence, int length); void showAlign(); /* Attributes */ auto_ptr clustalOutFile; auto_ptr gcgOutFile; auto_ptr nbrfOutFile; auto_ptr phylipOutFile; auto_ptr gdeOutFile; auto_ptr nexusOutFile; auto_ptr fastaOutFile; string clustalOutName; string gcgOutName; string phylipOutName; string nbrfOutName; string gdeOutName; string nexusOutName; string fastaOutName; vector strongGroup; vector weakGroup; int clusSecStructOffset; int clusSequenceOffset; }; } #endif