File: MultiSequence.h

package info (click to toggle)
proda 1.0-12
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 584 kB
  • sloc: cpp: 8,549; xml: 163; makefile: 109; sh: 12
file content (74 lines) | stat: -rw-r--r-- 2,056 bytes parent folder | download | duplicates (4)
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
62
63
64
65
66
67
68
69
70
71
72
73
74
//////////////////////////////////////////////////////////////////////
// MultiSequence.h
//   
// This file contains the routines needed for the creation, 
// maintenance, and use of a MultiSequence object which contains all 
// of the data associated with a set of sequences.  
//////////////////////////////////////////////////////////////////////

#ifndef MULTISEQUENCE_H
#define MULTISEQUENCE_H

#include "Sequence.h"
#include "Block.h"
#include <stdio.h>

//////////////////////////////////////////////////////////////////////
// MultiSequence object
//////////////////////////////////////////////////////////////////////
class MultiSequence {
  Sequence **sequences;
  int numSequences;
  
  // I/O helper routines
  const int AutoDetectFileFormat (const char *filename) const;
  void LoadMFA (const char *filename, bool compressGaps);
  void LoadPILEUP (const char *filename, bool compressGaps);
  void LoadData (const char *filename, bool compressGaps);
  const char ComputeAnnotation (const char *data, const int size) const;

 public:

  //Block operations
  void FindBlock(Block &block, int &start, int &end, int minlength = 20);
  void AddAlignPosition(Fragment * frag);
  void ClearAlignPosition();
	 
  // constructors
  MultiSequence();
  MultiSequence (const MultiSequence &rhs);

  // assignment operator
  const MultiSequence& operator= (const MultiSequence &rhs);
  
  // destructor
  ~MultiSequence();

  // getters
  const int GetNumSequences() const;
  const int GetLength() const;
  const Sequence &GetSequence (int index) const;
  Sequence * GetSequencePtr(int index);

  // add sequences
  void AddSequence (Sequence *seq);

  // sort sequences by id
  void Sort();

  // input
  void LoadSequences (const char *filename);
  void LoadAlignment (const char *filename);

  // output
  void WriteMFA (FILE *file) const;
  void WriteCLUSTALW (FILE *file) const;

  //Block output
  void WriteFASTA(FILE *file,Block *block, MultiSequence *result, int start, int end);
  void WriteCLUSTALW(FILE *file, int start, int end);

};


#endif