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
a2353af4
Commit
a2353af4
authored
Apr 14, 2014
by
Mikaël Salson
Browse files
KmerSegmenter: Use CountKmerAffectAnalyser instead of KmerAffectAnalyser
parent
571c9826
Changes
2
Hide whitespace changes
Inline
Side-by-side
algo/core/segment.cpp
View file @
a2353af4
...
...
@@ -181,7 +181,7 @@ KmerSegmenter::KmerSegmenter(Sequence seq, IKmerStore<KmerAffect> *index,
return
;
}
kaa
=
new
KmerAffectAnalyser
<
KmerAffect
>
(
*
index
,
sequence
);
kaa
=
new
Count
KmerAffectAnalyser
<
KmerAffect
>
(
*
index
,
sequence
);
// Check strand consistency among the affectations.
int
strand
;
...
...
@@ -246,38 +246,40 @@ void KmerSegmenter::checkUnsegmentationCause(int strand, int delta_min, int delt
else
if
(
strand
==
1
)
{
// Strand +
Vend
=
kaa
->
last
(
AFFECT_V
);
Jstart
=
kaa
->
first
(
AFFECT_J
);
Vend
=
kaa
->
firstMax
(
AFFECT_V
,
AFFECT_J
);
Jstart
=
kaa
->
lastMax
(
AFFECT_V
,
AFFECT_J
);
if
(
Vend
==
(
int
)
string
::
npos
)
if
(
Vend
==
0
)
{
because
=
UNSEG_TOO_FEW_V
;
}
if
(
Jstart
==
(
int
)
string
::
npos
)
if
(
Jstart
==
kaa
->
count
()
-
1
)
{
because
=
UNSEG_TOO_FEW_J
;
}
Vend
+=
s
;
Vend
+=
s
-
1
;
Jstart
++
;
}
else
if
(
strand
==
-
1
)
{
// Strand -
int
first
=
kaa
->
first
(
AFFECT_V_BWD
),
last
=
kaa
->
last
(
AFFECT_J_BWD
);
Jstart
=
kaa
->
firstMax
(
AFFECT_J_BWD
,
AFFECT_V_BWD
);
Vend
=
kaa
->
lastMax
(
AFFECT_J_BWD
,
AFFECT_V_BWD
);
if
(
first
==
(
int
)
string
::
npos
)
if
(
Vend
==
kaa
->
count
()
-
1
)
{
because
=
UNSEG_TOO_FEW_V
;
}
if
(
last
==
(
int
)
string
::
npos
)
if
(
Jstart
==
0
)
{
because
=
UNSEG_TOO_FEW_J
;
}
Vend
=
sequence
.
size
()
-
first
;
Jstart
=
sequence
.
size
()
-
(
las
t
+
s
)
;
Vend
=
sequence
.
size
()
-
(
Vend
+
1
)
;
Jstart
=
sequence
.
size
()
-
(
Jstar
t
+
s
-
1
)
;
}
if
(
!
because
)
...
...
@@ -298,7 +300,7 @@ void KmerSegmenter::checkUnsegmentationCause(int strand, int delta_min, int delt
segmented
=
false
;
}
KmerAffectAnalyser
<
KmerAffect
>
*
KmerSegmenter
::
getKmerAffectAnalyser
()
const
{
Count
KmerAffectAnalyser
<
KmerAffect
>
*
KmerSegmenter
::
getKmerAffectAnalyser
()
const
{
return
kaa
;
}
...
...
algo/core/segment.h
View file @
a2353af4
...
...
@@ -127,7 +127,7 @@ class KmerSegmenter : public Segmenter
{
private:
int
because
;
KmerAffectAnalyser
<
KmerAffect
>
*
kaa
;
Count
KmerAffectAnalyser
<
KmerAffect
>
*
kaa
;
protected:
string
affects
;
...
...
@@ -151,7 +151,7 @@ class KmerSegmenter : public Segmenter
/**
* @return the KmerAffectAnalyser of the current sequence.
*/
KmerAffectAnalyser
<
KmerAffect
>
*
getKmerAffectAnalyser
()
const
;
Count
KmerAffectAnalyser
<
KmerAffect
>
*
getKmerAffectAnalyser
()
const
;
/**
* @return the status of the segmentation. Tells if the Sequence has been segmented
...
...
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