Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

RazorBack::Bioseq_ Class Reference

Bioseq_: the base class for biological sequences. More...

#include <Bioseq.hh>

Inheritance diagram for RazorBack::Bioseq_:

Inheritance graph
[legend]
Collaboration diagram for RazorBack::Bioseq_:

Collaboration graph
[legend]
List of all members.

Public Methods

 Bioseq_ (Monomer_::Type_ Mt=Monomer_::PROT)
 Create a sequence object with the prescribed monomer type (amino acid codes by default). More...

 Bioseq_ (const char *Codes)
 Create a sequence object with the prescribed monomer alphabet given in Codes. More...

 Bioseq_ (const Bioseq_ &B)
 copy ctor.

const string& id () const
 id(), id(I), title(), title(T), annot(), annot(A), nocase(), nocase(N): methods for getting and setting the corresponding members.

string& id ()
void id (const string &I)
const string& title () const
string& title ()
void title (const string &T)
const string& annot () const
string& annot ()
void annot (const string &A)
bool nocase () const
bool nocase (bool N)
const Monomer_monomer () const
 monomer(): const access to the monomer alphabet. More...

const string& seq () const
 seq(): returns the sequence contained in the object. More...

virtual void seq (const string &S)
 seq(S): stores the sequence S in the calling object. More...

size_t length () const
 Returns the length of the sequence in the calling object.

char operator[] (size_t Idx) const
 []: unsafe index operator for the Idx:th char in the sequence.

char& operator[] (size_t Idx)
virtual char at_1 (size_t Idx) const
 at_1(Idx), at_1(Idx, C): safe index operator for the Idx:th char in the sequence. More...

virtual bool at_1 (size_t Idx, char C)
const char* at_3 (size_t Idx) const
 at_3(Idx), at_3(Idx, Ccc): safe index operator for getting and setting a monomer using the 3-letter abbreviations. More...

bool at_3 (size_t Idx, const char *Ccc)
int uppercase ()
 uppercase(), lowercase(): convert the sequence string to all-uppercase or all-lowercase. More...

int lowercase ()
virtual bool is_legal (char C) const
 is_legal(C): returns true if C is a legal character in the calling object under the current monomer alphabet and case-sensitivity setting. More...

virtual bool is_legal (const char *Ccc) const
bool is_legal (const string &S) const
virtual Errtype_ read_seq (istream &Inf, int Type=Monomer_::USER, int Format=ANYFORMAT)
 read_seq(Inf, Type, Format): tries to read a sequence from the input stream Inf. More...

virtual Errtype_ write_seq (ostream &Outf, int Format) const
 write_seq(Outf, Format): writes the contents of the calling object to Outf according to the format specification in Format. More...


Protected Methods

Monomer_chg_monomer ()
virtual bool is_legal (int Mt, char C) const
string& sequence ()

Private Attributes

Monomer_ Monomer
 the monomer alphabet.

bool Nocase
 allows case-independent monomer match when true.

string Seq
 the sequence (1-char abbreviations).

string ID
 the short identification tag of the sequence.

string Title
 the "title" of the sequence (max. one line).

string Annot
 annotation (free format).


Detailed Description

Bioseq_: the base class for biological sequences.

Stores the monomer alphabet, the sequence, its ID, title and some annotation. Uses the I/O methods inherited from Bioseqio_.

Definition at line 49 of file Bioseq.hh.


Constructor & Destructor Documentation

RazorBack::Bioseq_::Bioseq_ ( Monomer_::Type_ Mt = Monomer_::PROT ) [inline, explicit]
 

Create a sequence object with the prescribed monomer type (amino acid codes by default).

Consult "Monomer.hh" for available monomer types.

Definition at line 69 of file Bioseq.hh.

RazorBack::Bioseq_::Bioseq_ ( const char * Codes ) [inline, explicit]
 

Create a sequence object with the prescribed monomer alphabet given in Codes.

Consult "Monomer.hh" for code string syntax.

Definition at line 77 of file Bioseq.hh.

RazorBack::Bioseq_::Bioseq_ ( const Bioseq_ & B ) [inline]
 

copy ctor.

Definition at line 82 of file Bioseq.hh.


Member Function Documentation

const string & RazorBack::Bioseq_::id ( ) const [inline]
 

id(), id(I), title(), title(T), annot(), annot(A), nocase(), nocase(N): methods for getting and setting the corresponding members.

Definition at line 90 of file Bioseq.hh.

string & RazorBack::Bioseq_::id ( ) [inline]
 

Definition at line 91 of file Bioseq.hh.

void RazorBack::Bioseq_::id ( const string & I ) [inline]
 

Definition at line 92 of file Bioseq.hh.

const string & RazorBack::Bioseq_::title ( ) const [inline]
 

Definition at line 93 of file Bioseq.hh.

string & RazorBack::Bioseq_::title ( ) [inline]
 

Definition at line 94 of file Bioseq.hh.

void RazorBack::Bioseq_::title ( const string & T ) [inline]
 

Definition at line 95 of file Bioseq.hh.

const string & RazorBack::Bioseq_::annot ( ) const [inline]
 

Definition at line 96 of file Bioseq.hh.

string & RazorBack::Bioseq_::annot ( ) [inline]
 

Definition at line 97 of file Bioseq.hh.

void RazorBack::Bioseq_::annot ( const string & A ) [inline]
 

Definition at line 98 of file Bioseq.hh.

bool RazorBack::Bioseq_::nocase ( ) const [inline]
 

Definition at line 99 of file Bioseq.hh.

Referenced by RazorBack::Gapseq_::is_legal().

bool RazorBack::Bioseq_::nocase ( bool N ) [inline]
 

Definition at line 100 of file Bioseq.hh.

const Monomer_ & RazorBack::Bioseq_::monomer ( ) const [inline]
 

monomer(): const access to the monomer alphabet.

The monomer type of a sequence object can be changed only through assignment or input.

Definition at line 107 of file Bioseq.hh.

Referenced by RazorBack::Gapseq_::is_legal().

const string & RazorBack::Bioseq_::seq ( ) const [inline]
 

seq(): returns the sequence contained in the object.

See sequence() for hidden non-const access.

Reimplemented in RazorBack::Gapseq_.

Definition at line 113 of file Bioseq.hh.

Referenced by length().

void RazorBack::Bioseq_::seq ( const string & S ) [inline, virtual]
 

seq(S): stores the sequence S in the calling object.

Refuses storage if S does not correspond to calling obj type.

Reimplemented in RazorBack::Gapseq_.

Definition at line 120 of file Bioseq.hh.

size_t RazorBack::Bioseq_::length ( ) const [inline]
 

Returns the length of the sequence in the calling object.

Definition at line 128 of file Bioseq.hh.

char RazorBack::Bioseq_::operator[] ( size_t Idx ) const [inline]
 

[]: unsafe index operator for the Idx:th char in the sequence.

Definition at line 131 of file Bioseq.hh.

char & RazorBack::Bioseq_::operator[] ( size_t Idx ) [inline]
 

Definition at line 132 of file Bioseq.hh.

char RazorBack::Bioseq_::at_1 ( size_t Idx ) const [virtual]
 

at_1(Idx), at_1(Idx, C): safe index operator for the Idx:th char in the sequence.

The non-const version refuses to store characters not corresponding to the current type of the calling object. Throws Indexrangexc_ if Idx is illegal. Returns true on success, false when C was illegal.

Reimplemented in RazorBack::Gapseq_.

virtual bool RazorBack::Bioseq_::at_1 ( size_t Idx,
char C ) [virtual]
 

Reimplemented in RazorBack::Gapseq_.

const char * RazorBack::Bioseq_::at_3 ( size_t Idx ) const
 

at_3(Idx), at_3(Idx, Ccc): safe index operator for getting and setting a monomer using the 3-letter abbreviations.

The non-const version refuses to store abbreviations that are illegal. Throws Indexrangexc_ if Idx is illegal. Returns true on success, false when Ccc was illegal.

Reimplemented in RazorBack::Gapseq_.

bool RazorBack::Bioseq_::at_3 ( size_t Idx,
const char * Ccc )
 

Reimplemented in RazorBack::Gapseq_.

int RazorBack::Bioseq_::uppercase ( )
 

uppercase(), lowercase(): convert the sequence string to all-uppercase or all-lowercase.

Return the number of characters converted.

int RazorBack::Bioseq_::lowercase ( )
 

bool RazorBack::Bioseq_::is_legal ( char C ) const [inline, virtual]
 

is_legal(C): returns true if C is a legal character in the calling object under the current monomer alphabet and case-sensitivity setting.

is_legal(Ccc): does the same for 3-letter abbreviations. is_legal(S): does the same for the complete sequence string S.

Reimplemented in RazorBack::Gapseq_.

Definition at line 177 of file Bioseq.hh.

Referenced by seq().

bool RazorBack::Bioseq_::is_legal ( const char * Ccc ) const [inline, virtual]
 

Reimplemented in RazorBack::Gapseq_.

Definition at line 179 of file Bioseq.hh.

bool RazorBack::Bioseq_::is_legal ( const string & S ) const
 

Reimplemented in RazorBack::Gapseq_.

Errtype_ RazorBack::Bioseq_::read_seq ( istream & Inf,
int Type = Monomer_::USER,
int Format = ANYFORMAT ) [virtual]
 

read_seq(Inf, Type, Format): tries to read a sequence from the input stream Inf.

If Type is set to Monomer_::PROT, then only protein sequences will be read, if it is set to Monomer_::[DEOXY[RIBO]]NUCL, then only the corresponding nucleic acide sequences will be read, if Type is Monomer_::USER (default) or an OR-ed combination of PROT and *NUCL, then all types are considered and a polymer type autodetection is attempted. This is not foolproof. Format can be set to ANYFORMAT (default), in this case automatic file format detection is performed, or to a concrete file format. Type and Format may be incompatible:- PIR, SWISS are for proteins only, EMBL is for nucleic acids only. No read is performed and FORMATERR is returned when incompatible type and format are specified. Return value: OK or an error enum if something went wrong.

Reimplemented in RazorBack::Gapseq_.

Errtype_ RazorBack::Bioseq_::write_seq ( ostream & Outf,
int Format ) const [virtual]
 

write_seq(Outf, Format): writes the contents of the calling object to Outf according to the format specification in Format.

Returns OK or an error enum if something went wrong.

Reimplemented in RazorBack::Gapseq_.

Monomer_ & RazorBack::Bioseq_::chg_monomer ( ) [inline, protected]
 

Definition at line 215 of file Bioseq.hh.

virtual bool RazorBack::Bioseq_::is_legal ( int Mt,
char C ) const [protected, virtual]
 

Reimplemented in RazorBack::Gapseq_.

string & RazorBack::Bioseq_::sequence ( ) [inline, protected]
 

Definition at line 218 of file Bioseq.hh.

Referenced by RazorBack::Gapseq_::seq().


Member Data Documentation

Monomer_ RazorBack::Bioseq_::Monomer [private]
 

the monomer alphabet.

Definition at line 54 of file Bioseq.hh.

bool RazorBack::Bioseq_::Nocase [private]
 

allows case-independent monomer match when true.

Definition at line 55 of file Bioseq.hh.

string RazorBack::Bioseq_::Seq [private]
 

the sequence (1-char abbreviations).

Definition at line 56 of file Bioseq.hh.

string RazorBack::Bioseq_::ID [private]
 

the short identification tag of the sequence.

Definition at line 57 of file Bioseq.hh.

string RazorBack::Bioseq_::Title [private]
 

the "title" of the sequence (max. one line).

Definition at line 58 of file Bioseq.hh.

string RazorBack::Bioseq_::Annot [private]
 

annotation (free format).

Definition at line 59 of file Bioseq.hh.


The documentation for this class was generated from the following file:
Generated at Wed Aug 21 09:33:44 2002 for The Razorback C++ Library: Bioinformatics by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001