Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
vidjil
vidjil
Commits
fdbbde92
Commit
fdbbde92
authored
Feb 27, 2016
by
Mathieu Giraud
Browse files
core/fasta.{h,cpp}: Fasta parser, ignore the gaps ('.') and store their number
parent
a914a57e
Changes
2
Hide whitespace changes
Inline
Side-by-side
algo/core/fasta.cpp
View file @
fdbbde92
...
...
@@ -174,6 +174,7 @@ void OnlineFasta::init() {
line_nb
=
0
;
line
=
getInterestingLine
();
current
.
seq
=
NULL
;
current_gaps
=
0
;
}
unsigned
long
long
OnlineFasta
::
getPos
()
{
...
...
@@ -213,7 +214,18 @@ void OnlineFasta::skipToNthSequence() {
void
OnlineFasta
::
addLineToCurrentSequence
(
string
line
)
{
current
.
sequence
+=
line
;
for
(
char
&
c
:
line
)
{
if
(
c
==
' '
)
continue
;
if
(
c
==
'.'
)
{
current_gaps
++
;
continue
;
}
current
.
sequence
+=
c
;
}
}
void
OnlineFasta
::
next
()
{
...
...
@@ -227,6 +239,7 @@ void OnlineFasta::next() {
if
(
current
.
seq
)
{
delete
[]
current
.
seq
;
current
.
seq
=
NULL
;
current_gaps
=
0
;
}
if
(
hasNextData
())
{
...
...
algo/core/fasta.h
View file @
fdbbde92
...
...
@@ -93,6 +93,8 @@ public:
class
OnlineFasta
{
private:
Sequence
current
;
int
current_gaps
;
istream
*
input
;
int
extract_field
;
string
extract_separator
;
...
...
Write
Preview
Supports
Markdown
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