Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
vidjil
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1,711
Issues
1,711
List
Boards
Labels
Service Desk
Milestones
Merge Requests
86
Merge Requests
86
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vidjil
vidjil
Commits
68fef14b
Commit
68fef14b
authored
May 20, 2015
by
Mathieu Giraud
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/kmerstore.h: store 'max_indexing_size', the maximal length of the inserted sequence
parent
756df08b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
algo/core/kmerstore.h
algo/core/kmerstore.h
+22
-0
No files found.
algo/core/kmerstore.h
View file @
68fef14b
...
...
@@ -44,6 +44,7 @@ protected:
int
s
;
// span of the seed (s >= k)
string
seed
;
size_t
nb_kmers_inserted
;
int
max_size_indexing
;
public:
...
...
@@ -89,6 +90,12 @@ public:
*/
float
getIndexLoad
()
const
;
/**
* @return the given integer (size of a read),
* but limit this size to max_size_indexing if it was defined
*/
int
atMostMaxSizeIndexing
(
int
n
)
const
;
/**
* @return probability that the number of kmers is 'at_least' or more in a sequence of length 'length'
*/
...
...
@@ -231,6 +238,12 @@ void IKmerStore<T>::insert(const seqtype &sequence,
}
else
if
(
keep_only
<
0
&&
sequence
.
length
()
>
(
size_t
)
-
keep_only
)
{
end_indexing
=
-
keep_only
;
}
size_t
size_indexing
=
end_indexing
-
start_indexing
;
if
(
size_indexing
>
max_size_indexing
)
{
max_size_indexing
=
size_indexing
;
}
for
(
size_t
i
=
start_indexing
;
i
+
s
<
end_indexing
+
1
;
i
++
)
{
seqtype
substr
=
sequence
.
substr
(
i
,
s
);
seqtype
kmer
=
spaced
(
substr
,
seed
);
...
...
@@ -266,6 +279,13 @@ float IKmerStore<T>::getIndexLoad() const {
return
nb_kmers_inserted
*
1.
/
(
1
<<
(
2
*
k
));
}
template
<
class
T
>
int
IKmerStore
<
T
>::
atMostMaxSizeIndexing
(
int
n
)
const
{
if
(
!
max_size_indexing
||
n
<
max_size_indexing
)
return
n
;
return
max_size_indexing
;
}
template
<
class
T
>
double
IKmerStore
<
T
>::
getProbabilityAtLeastOrAbove
(
int
at_least
,
int
length
)
const
{
...
...
@@ -398,6 +418,7 @@ MapKmerStore<T>::MapKmerStore(int k, bool revcomp){
template
<
class
T
>
void
MapKmerStore
<
T
>::
init
()
{
this
->
nb_kmers_inserted
=
0
;
this
->
max_size_indexing
=
0
;
}
template
<
class
T
>
...
...
@@ -440,6 +461,7 @@ ArrayKmerStore<T>::ArrayKmerStore(string seed, bool revcomp){
template
<
class
T
>
void
ArrayKmerStore
<
T
>::
init
()
{
this
->
nb_kmers_inserted
=
0
;
this
->
max_size_indexing
=
0
;
if
((
size_t
)(
this
->
k
<<
1
)
>=
sizeof
(
int
)
*
8
)
throw
std
::
bad_alloc
();
store
=
new
T
[(
unsigned
int
)
1
<<
(
this
->
k
<<
1
)];
...
...
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