BioInt  1.02.00
BioInt: An integrative biological object-oriented application framework and interpreter
BioSequence.h
Go to the documentation of this file.
00001 /****************************************************************************
00002 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00003 The BioBhasha : A Programming Language for Biologist
00004 Version 1.0 (19th December 2001)
00005 Dr. Prasad, B.V.L.S.
00006 Contact: prasadbvls@helixgenomics.com
00007 Version 1.1 (23th January 2003)
00008 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00009 *****************************************************************************/
00010 #ifndef BIOSEQUENCE_H
00011 #define BIOSEQUENCE_H
00012 
00013 
00014 #include <string>
00015 #include <fstream>
00016 #include <vector>
00017 #include <ctime>
00018 #include "BioUtilities.h"
00019 #include "BioPostScript.h"
00020 
00021 using namespace std;
00022 
00023 class BioSequence 
00024 {
00025          friend bool operator >(const BioSequence& , const BioSequence&);
00026          friend bool operator <(const BioSequence& , const BioSequence&);
00027          friend bool operator ==(const BioSequence& , const BioSequence&);
00028 
00029 
00030 protected:
00031 
00032         string seqname_;
00033         string sequence_;
00034 
00035 public:
00036         BioSequence();
00037         BioSequence(const string& filename);
00038 
00039         BioSequence(const string& seqnam, const string& seq);
00040 
00041         void setSequence(const string& seqnam, const string& seq);
00042         void setSequence(const string& seq);
00043         void setSequenceName(const string& seqnam);
00044         bool checkSequence();
00045 
00046         int readFasta(ifstream &);
00047         string getSequenceName() const; 
00048         string getSequence() const ;
00049         long getSequenceLength() const ;
00050 
00051         long getNumberOfOccurrences(const char& ch);
00052         long getNumberOfOccurrences(const string& pattern);
00053         
00054         bool findPattern(const string& pat);
00055         bool find(const string& words);
00056 
00057 
00058         string getSequenceSegment(const long& a, const long& b);
00059 
00060         void showPositionsOfPattern(const string& pat, ostream& os=cout);
00061         void showPositionsOfPattern(const string& pat, BioPostScript& ps,
00062                   const int& xpos = 100, const int& ypos = 650, const int& w =450 ,const int& h = 20);
00063         vector<long> getPositionsOfPattern(const string& pat);
00064 
00065         string getMutatedSequence(const long& , const char& );
00066         string getMutatedSequence(const long&, const string&);
00067         string getMutatedSequence(const char&,const char&);
00068 
00069         string getMutatedSequence(const string&,const string&);
00070         string getMutatedSequence(const long&,const long&,const string&);
00071 
00072 
00073   
00074         string getInsertedSequence(const long& , const string&);
00075 
00076         string getDeletedSequence(const long&,const long&);
00077 
00078         void showInFasta(ostream & = cout);
00079 
00080         // Standard Site-Directed Mutation NOTATION
00081         // P20G, G160A etc...
00082 // string& s1 and NOT const string& s1 because s1 is getting modified inside the function.
00083 // if we declare as const string& , s1 cannot further be modified.
00084 
00085         string getMutatedSequence(string& s1);
00086         // Ex: string getMutatedSequence("P20G");
00087         // Ex: string getMutatedSequence("A120T-C34G");
00088         // A-Single Letter Representation
00089         // 120-The Site Position where MUtation has to take place
00090         // T-Single Letter Representation - To be Substituted With.
00091 
00092         long getNumberOfSSRs(const string& pat, const int& repeats);
00093         vector < long > getPositionsOfSSRs(const string& pat, const int& repeats);
00094 
00095         void showSSRs(const string& pat,const  int& repeats, ostream& os = cout);       
00096         void showSSRs(const string& pat, const int& repeats, BioPostScript& ps,
00097                 const int& xpos = 100, const int& ypos = 650,const int& w =450 ,const int& h = 20);
00098         string getShuffledSequence();
00099         void showShuffledSequence(ostream& os = cout);
00100 };
00101 
00102 
00103 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines