Commit a41c7ffe authored by Mathieu Giraud's avatar Mathieu Giraud

core/fasta.{h,cpp}: Fasta.mark_pos

parent 2b23d6cc
......@@ -39,10 +39,11 @@ unsigned long long filesize(const char* filename)
return in.tellg();
}
void Fasta::init(int extract_field, string extract_separator)
void Fasta::init(int extract_field, string extract_separator, int mark_pos)
{
this -> extract_field = extract_field ;
this -> extract_separator = extract_separator ;
this -> mark_pos = mark_pos;
total_size = 0;
name = "";
basename = "";
......@@ -55,9 +56,9 @@ Fasta::Fasta(bool virtualfasta, string name)
basename = extract_basename(name);
}
Fasta::Fasta(int extract_field, string extract_separator)
Fasta::Fasta(int extract_field, string extract_separator, int mark_pos)
{
init(extract_field, extract_separator);
init(extract_field, extract_separator, mark_pos);
}
Fasta::Fasta(const string &input,
......@@ -343,6 +344,7 @@ istream& operator>>(istream& in, Fasta& fasta){
string line;
Sequence read;
OnlineFasta of(in, fasta.extract_field, fasta.extract_separator);
of.setMarkPos(fasta.mark_pos);
while (of.hasNext()) {
of.next();
......
......@@ -32,7 +32,7 @@ unsigned long long filesize(const char* filename);
class Fasta
{
void init(int extract_field, string extract_separator);
void init(int extract_field, string extract_separator, int mark_pos=0);
int total_size;
int extract_field;
......@@ -43,7 +43,7 @@ class Fasta
// ostream *oout ;
public:
Fasta(int extract_field=0, string extract_separator="|");
Fasta(int extract_field=0, string extract_separator="|", int mark_pos=0);
/**
* Read all the sequences in the input filename and record them in the object.
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment