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
|
//
// protein.hpp
// Mothur
//
// Created by Sarah Westcott on 5/24/21.
// Copyright © 2021 Schloss Lab. All rights reserved.
//
#ifndef protein_hpp
#define protein_hpp
#include "mothurout.h"
#include "utils.hpp"
#include "writer.h"
#include "aminoacid.hpp"
class Sequence;
/**************************************************************************************************/
class Protein {
#ifdef UNIT_TEST
friend class TestProtein;
#endif
public:
Protein();
Protein(string, string);
Protein(string, vector<AminoAcid>);
Protein(ifstream&);
Protein(ifstream&, string&, bool);
Protein(istringstream&);
#ifdef USE_BOOST
Protein(boost::iostreams::filtering_istream&);
#endif
~Protein() = default;
void setName(string);
string getName();
void setUnaligned(vector<AminoAcid>);
vector<AminoAcid> getUnaligned();
string getUnalignedString() { return getProteinString(unaligned); }
void setAligned(vector<AminoAcid>);
void setAligned(string);
vector<AminoAcid> getAligned();
string getAlignedString() { return getProteinString(aligned); }
void setComment(string);
string getComment();
string getInlineProtein();
void setPairwise(vector<AminoAcid>);
vector<AminoAcid> getPairwise();
string getCompressedDNA();
bool isAligned();
int getNumBases();
int getStartPos();
int getEndPos();
void trim(int);
void padToPos(int);
void padFromPos(int);
void filterToPos(int); //any character before the pos is changed to . and aligned and unaligned strings changed
void filterFromPos(int); //any character after the pos is changed to . and aligned and unaligned strings changed
int getAlignLength();
void printProtein(ostream&);
void printProtein(OutputWriter*);
void printUnAlignedProtein(ostream&);
protected:
MothurOut* m;
Utils util;
void initialize();
vector<AminoAcid> getProtein(ifstream&);
vector<AminoAcid> getProtein(istringstream&);
string getCommentString(ifstream&);
string getCommentString(istringstream&);
string getProteinName(ifstream&);
string getProteinName(istringstream&);
string getProteinString(vector<AminoAcid>);
#ifdef USE_BOOST
string getCommentString(boost::iostreams::filtering_istream&);
vector<AminoAcid> getProtein(boost::iostreams::filtering_istream&);
string getSequenceName(boost::iostreams::filtering_istream&);
#endif
string name;
vector<AminoAcid> unaligned;
vector<AminoAcid> aligned;
string comment;
int numBases;
int alignmentLength;
int startPos, endPos;
vector<AminoAcid> pairwise;
};
/**************************************************************************************************/
#endif /* protein_hpp */
|