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
1211e00f
Commit
1211e00f
authored
Feb 06, 2015
by
Mikaël Salson
Browse files
WindowsStorage: get the germlines of the most abundant clones
parent
62c605ba
Changes
2
Hide whitespace changes
Inline
Side-by-side
algo/core/windows.cpp
View file @
1211e00f
...
...
@@ -73,6 +73,21 @@ list<Sequence> WindowsStorage::getSample(junction window, size_t nb_sampled,
return
SequenceSampler
(
reads
).
getLongest
(
nb_sampled
,
nb_buckets
);
}
set
<
Germline
*>
WindowsStorage
::
getTopGermlines
(
size_t
top
,
size_t
min_reads
)
{
assert
(
sort_all_windows
.
size
()
==
seqs_by_window
.
size
());
set
<
Germline
*>
top_germlines
;
size_t
count
=
0
;
for
(
list
<
pair
<
junction
,
int
>
>::
const_iterator
it
=
sort_all_windows
.
begin
();
it
!=
sort_all_windows
.
end
()
&&
count
<
top
&&
(
size_t
)
it
->
second
>=
min_reads
;
++
it
,
++
count
)
{
top_germlines
.
insert
(
getGermline
(
it
->
first
));
}
return
top_germlines
;
}
size_t
WindowsStorage
::
size
()
{
return
seqs_by_window
.
size
();
}
...
...
algo/core/windows.h
View file @
1211e00f
...
...
@@ -11,6 +11,7 @@
#include <iostream>
#include <map>
#include <set>
#include <utility>
#include <string>
#include "fasta.h"
...
...
@@ -103,6 +104,16 @@ class WindowsStorage {
*/
string
getLabel
(
junction
window
);
/**
* @pre sort() must have been called.
* @param top: Only the germlines of the top most abundant windows will
* be considered
* @param min_reads: (optional) minimal number (inclusive) of reads the window
* must be supported by.
* @return a set of the most abundant germlines.
*/
set
<
Germline
*>
getTopGermlines
(
size_t
top
,
size_t
min_reads
=
1
);
/**
* Only keep windows that are interesting. Those windows are windows
* supported by at least min_reads_window reads as well as windows that are
...
...
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