1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
|
//////////////////////////////////////////////////////////////////////
// Sequence.h
//
// Class for manipulating single sequences.
//////////////////////////////////////////////////////////////////////
#ifndef SEQUENCE_H
#define SEQUENCE_H
#include <map>
#include "AlignedFragment.h"
//////////////////////////////////////////////////////////////////////
// Sequence object
//////////////////////////////////////////////////////////////////////
class Sequence {
char *data;
char *name;
int length;
int id;
int *align; //number of sequences aligned to a given position
int *position; //original position used for tracking after erasing fragments
public:
void ClearAlignPosition();
int GetAlign(int i) const;
void SubStr(int begin, int end);
int SetID(int newid);
void Clip(int begin, int end);
void PrintAlign(FILE *f);
void EraseCluster(int start, int end, int n);
int OriginPosition(int current);
void EraseFragment(int begin, int end);
void AddAlignPosition(int begin, int end);
// constructors
Sequence (char *data, char *name, int length, int id);
Sequence (const Sequence &rhs);
// assignment operator
const Sequence& operator= (const Sequence &rhs);
// destructor
~Sequence ();
// getters
const char *GetData () const;
const char *GetName () const;
const int GetLength () const;
const int GetID () const;
// setters
void SetData (char *data);
// compute mapping from letter to positions in sequence
int *ComputeMapping () const;
};
#endif
|