Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
vidjil
vidjil
Commits
6d7519cf
Commit
6d7519cf
authored
Oct 16, 2015
by
Mathieu Giraud
Browse files
core/fasta.{h,cpp}: stores 'nb_sequences_max' and 'nth_only_sequence' in OnlineFasta
parent
a9c4a9c6
Changes
2
Hide whitespace changes
Inline
Side-by-side
algo/core/fasta.cpp
View file @
6d7519cf
...
...
@@ -107,14 +107,19 @@ const string& Fasta::sequence(int index) const{ return reads[index].sequence; }
// OnlineFasta
OnlineFasta
::
OnlineFasta
(
int
extract_field
,
string
extract_separator
)
:
input
(
NULL
),
extract_field
(
extract_field
),
extract_separator
(
extract_separator
){}
OnlineFasta
::
OnlineFasta
(
int
extract_field
,
string
extract_separator
,
int
nb_sequences_max
,
int
only_nth_sequence
)
:
input
(
NULL
),
extract_field
(
extract_field
),
extract_separator
(
extract_separator
),
nb_sequences_max
(
nb_sequences_max
),
only_nth_sequence
(
only_nth_sequence
){}
OnlineFasta
::
OnlineFasta
(
const
string
&
input
,
int
extract_field
,
string
extract_separator
)
int
extract_field
,
string
extract_separator
,
int
nb_sequences_max
,
int
only_nth_sequence
)
:
input
(
new
igzstream
(
input
.
c_str
())),
extract_field
(
extract_field
),
extract_separator
(
extract_separator
)
extract_separator
(
extract_separator
),
nb_sequences_max
(
nb_sequences_max
),
only_nth_sequence
(
only_nth_sequence
)
{
if
(
this
->
input
->
fail
())
{
delete
this
->
input
;
...
...
@@ -127,9 +132,11 @@ OnlineFasta::OnlineFasta(const string &input,
}
OnlineFasta
::
OnlineFasta
(
istream
&
input
,
int
extract_field
,
string
extract_separator
)
int
extract_field
,
string
extract_separator
,
int
nb_sequences_max
,
int
only_nth_sequence
)
:
input
(
&
input
),
extract_field
(
extract_field
),
extract_separator
(
extract_separator
)
extract_separator
(
extract_separator
),
nb_sequences_max
(
nb_sequences_max
),
only_nth_sequence
(
only_nth_sequence
)
{
input_allocated
=
false
;
init
();
...
...
algo/core/fasta.h
View file @
6d7519cf
...
...
@@ -97,12 +97,16 @@ class OnlineFasta {
size_t
line_nb
;
unsigned
long
long
char_nb
;
int
nb_sequences_max
;
int
only_nth_sequence
;
public:
/**
* Default constructor
*/
OnlineFasta
(
int
extract_field
=
0
,
string
extract_separator
=
"|"
);
OnlineFasta
(
int
extract_field
=
0
,
string
extract_separator
=
"|"
,
int
nb_sequences_max
=
NO_LIMIT_VALUE
,
int
only_nth_sequence
=
1
);
/**
* Open the file. No sequence is read at first.
...
...
@@ -112,10 +116,12 @@ class OnlineFasta {
* well-formed
*/
OnlineFasta
(
const
string
&
input
,
int
extract_field
=
0
,
string
extract_separator
=
"|"
);
int
extract_field
=
0
,
string
extract_separator
=
"|"
,
int
nb_sequences_max
=
NO_LIMIT_VALUE
,
int
only_nth_sequence
=
1
);
OnlineFasta
(
istream
&
input
,
int
extract_field
=
0
,
string
extract_separator
=
"|"
);
int
extract_field
=
0
,
string
extract_separator
=
"|"
,
int
nb_sequences_max
=
NO_LIMIT_VALUE
,
int
only_nth_sequence
=
1
);
~
OnlineFasta
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment