File: gnGenomeSpec.h

package info (click to toggle)
libgenome 1.3.11%2Bsvn20110227.4616-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 916 kB
  • sloc: cpp: 11,120; makefile: 79; sh: 31
file content (131 lines) | stat: -rw-r--r-- 3,924 bytes parent folder | download | duplicates (8)
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
/////////////////////////////////////////////////////////////////////////////
// File:            gnGenomeSpec.h
// Purpose:         abstract Spec class
// Description:     Genome level spec class
// Changes:        
// Version:         libGenome 0.5.1 
// Author:          Aaron Darling 
// Modified by:     
// Copyright:       (c) Aaron Darling 
// Licenses:        See COPYING file for details 
/////////////////////////////////////////////////////////////////////////////
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#ifndef _gnGenomeSpec_h_
#define _gnGenomeSpec_h_

#include "libGenome/gnDefs.h"

#include <vector>
#include <string>

#include "libGenome/gnClone.h"
#include "libGenome/gnBaseFeature.h"
#include "libGenome/gnBaseHeader.h"
#include "libGenome/gnMultiSpec.h"
#include "libGenome/gnFragmentSpec.h"
#include "libGenome/gnException.h"


namespace genome {

/**
 * This class contains references to the sequence data, annotation,
 * and other related header data for an organism's genome.  The genome
 * is organized into a list of sequence fragments (specs), a list of
 * features, and a list of headers.
 */
class GNDLLEXPORT gnGenomeSpec : public gnMultiSpec< gnFragmentSpec >
{
public:
	gnGenomeSpec();
	/**
	 * Copy constructor.
	 * @param s the gnGenomeSpec to copy.
	 */
	gnGenomeSpec( const gnGenomeSpec& s);
	/**
	 * Destructor, frees memory.
	 */
	virtual ~gnGenomeSpec();
// Clone
	virtual gnGenomeSpec* Clone() const;
	virtual void Clear();
// Base Spec stuff
	virtual void SetReverseComplement( const boolean value );

//Multispec stuff
/*	virtual uint32 GetSpecListLength() const;
	virtual gnFragmentSpec* GetSpec( const uint32 i ) const;
	virtual gnFragmentSpec* GetSpecByBase( const gnSeqI baseI ) const;
	virtual void AddSpec( gnBaseSpec* spec, const uint32 i = UINT32_MAX );
	virtual void RemoveSpec( uint32 i );
*/
	virtual void MergeFragments( const uint32 startC, const uint32 endC);

	virtual uint32 AddFeature( gnBaseFeature* feat );
	virtual uint32 GetFeatureListLength() const;
	virtual gnBaseFeature* GetFeature( const uint32 i ) const;
	virtual void GetContainedFeatures(const gnLocation& lt, std::vector<gnBaseFeature*>& feature_vector, std::vector<uint32>& index_vector) const;
	virtual void GetIntersectingFeatures(const gnLocation& lt, std::vector<gnBaseFeature*>& feature_vector, std::vector<uint32>& index_vector) const;
	virtual void GetBrokenFeatures(const gnLocation& lt, std::vector<gnBaseFeature*>& feature_vector) const;
	virtual void RemoveFeature( const uint32 i );
	/**
	 * Copies a specified range of bases and returns a pointer to
	 * the resulting gnGenomeSpec.  You must delete the copy when you
	 * are finished with it.
	 * @param startI The first base pair to copy
	 * @param len The length of the piece to copy
	 * @return A copy of the gnGenomeSpec containing only the specified bases
	 */
	virtual gnGenomeSpec* CloneRange( const gnSeqI startI, const gnSeqI len ) const;

protected:
//	std::vector <gnFragmentSpec*> m_SpecList;
	
}; // class gnGenomeSpec

inline
gnGenomeSpec* gnGenomeSpec::Clone() const{
	return new gnGenomeSpec(*this);
}
/*
inline
uint32 gnGenomeSpec::GetSpecListLength() const{
	return m_SpecList.size();
}

inline
gnFragmentSpec* gnGenomeSpec::GetSpec( const uint32 i ) const{
	if(i < m_SpecList.size())
		return m_SpecList[i];
	Throw_gnEx(FragmentIndexOutOfBounds());
}

inline
gnFragmentSpec* gnGenomeSpec::GetSpecByBase( const gnSeqI baseI ) const{
	return m_SpecList[GetSpecIndexByBase(baseI)];
}

inline
void gnGenomeSpec::AddSpec( gnBaseSpec* spec, const uint32 i ){
	uint32 index = i == UINT32_MAX ? m_SpecList.size() : i;
	if(index <= m_SpecList.size()){
		m_SpecList.insert(m_SpecList.begin() + index, (gnFragmentSpec*)spec);
	}
}

inline
void gnGenomeSpec::RemoveSpec( uint32 i ){
	if(i < GetSpecListLength()){
		m_SpecList.erase(m_SpecList.begin() + i);
	}
}
*/

}	// end namespace genome

#endif
	// _gnGenomeSpec_h_