Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
BigString Class Reference

concatenates Proteins given as FASTAEntry to one big string separated by a unique character (by default $) More...

#include <OpenMS/DATASTRUCTURES/BigString.h>

Public Types

typedef std::pair< String, StringFASTAEntry
 

Public Member Functions

 BigString ()
 constructor More...
 
 BigString (const BigString &bs)
 copy constructor More...
 
virtual ~BigString ()
 destructor More...
 
void add (FASTAEntry const &new_entry)
 add new string to bigString More...
 
void setSeparator (const char sep)
 setter for separator character by default $ More...
 
char getSeparator ()
 getter for separator character More...
 
Size size ()
 returns the number of strings More...
 
Size length ()
 length of bigString More...
 
void getPeptide (FASTAEntry &entry, Size start, Size length)
 getPeptide from start position with given length this includes FASTAHeader More...
 
const StringgetBigString () const
 returns bigString More...
 

Protected Member Functions

Size getIndex_ (Size index, Size start, Size end)
 private function to implement binary search More...
 
Size getIndex_ (Size index)
 retrieves index of inserted protein by bigStringPosition More...
 

Protected Attributes

String big_string_
 concatenated String More...
 
char separator_
 separator sign More...
 
Size count_
 number of Strings added to big_string More...
 
Size len_
 length of the big_string More...
 
std::vector< Sizesep_indices_
 indices of separators More...
 
std::vector< StringFASTA_header_
 vector with headers of FASTAEntry More...
 

Detailed Description

concatenates Proteins given as FASTAEntry to one big string separated by a unique character (by default $)

Concatenates the strings given as FASTAEntry separating them with a unique character and storing the headers of FASTAEntry as well as the position of separator characters. So a substring can be accessed easily and the corresponding header can be found fast by using binary search.

Member Typedef Documentation

◆ FASTAEntry

typedef std::pair<String, String> FASTAEntry

Constructor & Destructor Documentation

◆ BigString() [1/2]

BigString ( )

constructor

◆ BigString() [2/2]

BigString ( const BigString bs)

copy constructor

◆ ~BigString()

virtual ~BigString ( )
virtual

destructor

Member Function Documentation

◆ add()

void add ( FASTAEntry const &  new_entry)

add new string to bigString

Parameters
new_entryFASTAEntry to be added to big_string

◆ getBigString()

const String& getBigString ( ) const

returns bigString

Returns
const reference to bigString

◆ getIndex_() [1/2]

Size getIndex_ ( Size  index,
Size  start,
Size  end 
)
protected

private function to implement binary search

Parameters
index
startstart index
endend index
Returns
int with index

◆ getIndex_() [2/2]

Size getIndex_ ( Size  index)
protected

retrieves index of inserted protein by bigStringPosition

Parameters
index
Returns
int with index

◆ getPeptide()

void getPeptide ( FASTAEntry entry,
Size  start,
Size  length 
)

getPeptide from start position with given length this includes FASTAHeader

Parameters
entrycontains the entry of the given range after calling
startstart index
lengthlength of desired substring
Returns
FASTAEntry describing the protein
Exceptions
InvalidValueif a peptide is part of two different fasta entrys

◆ getSeparator()

char getSeparator ( )

getter for separator character

Returns
separator character

◆ length()

Size length ( )

length of bigString

Returns
int with length of the created bigString

◆ setSeparator()

void setSeparator ( const char  sep)

setter for separator character by default $

Parameters
sepseparator character

◆ size()

Size size ( )

returns the number of strings

Returns
int with number of strings

Member Data Documentation

◆ big_string_

String big_string_
protected

concatenated String

◆ count_

Size count_
protected

number of Strings added to big_string

◆ FASTA_header_

std::vector<String> FASTA_header_
protected

vector with headers of FASTAEntry

◆ len_

Size len_
protected

length of the big_string

◆ sep_indices_

std::vector<Size> sep_indices_
protected

indices of separators

◆ separator_

char separator_
protected

separator sign


OpenMS / TOPP release 2.3.0 Documentation generated on Tue Jan 9 2018 18:22:07 using doxygen 1.8.13