Commit 43c38d86 authored by Mikaël Salson's avatar Mikaël Salson

algo/core/representative.cpp + tests: Fix issue when window starts or ends with a N

As trimSequence is used on a representative and as the representative should contain the window we now
make sure that the window is not trimmed.

Fix #4263
parent 809bdc1d
......@@ -122,6 +122,7 @@ void KmerRepresentativeComputer::compute(VirtualReadScore &readScorer, bool try_
size_t length_longest_run = 0;
size_t seq_index_longest_run = 1;
size_t length_longest_cover = 0;
size_t pos_required_longest = 0;
Sequence sequence_longest_run;
bool *cover_longest_run = NULL;
int sequence_used_for_quality = 0;
......@@ -203,6 +204,7 @@ void KmerRepresentativeComputer::compute(VirtualReadScore &readScorer, bool try_
sequence_longest_run = sequence;
length_longest_cover = length_cover;
seq_index_longest_run = seq;
pos_required_longest = pos_required;
if (cover_longest_run)
delete [] cover_longest_run;
cover_longest_run = new bool[sequence.sequence.size()];
......@@ -239,7 +241,8 @@ void KmerRepresentativeComputer::compute(VirtualReadScore &readScorer, bool try_
}
// Update length_longest_run with its actual value
length_longest_run = last_pos_covered - pos_longest_run + 1;
trimSequence(representative.sequence, pos_longest_run, length_longest_run);
trimSequence(representative.sequence, pos_longest_run, length_longest_run,
pos_required_longest, required.length());
}
delete [] cover_longest_run;
representative.sequence = representative.sequence.substr(pos_longest_run, length_longest_run);
......
@M03254:27:000000000-J5BG3:1:2104:17375:5379 2:N:0:CGCTCATT+NGCTCTGA
TTGATATGGTCCGNNNNGGATTGTCAGGCGTGGGACAAGTCCACTGCGGTGTTCGGCGGAGGGACCAGATNGACCGTCCTAGGTCAGCCCAAGGCTGCCCCCNCNNNNNCTCNGTTNCCNNCCNNNTNGANNNNN
+
@6<C@GGGGF-FG####==CC<FFFAFFGEF@CDFCFGFD6ECFEGGGGCF@7CFDFC@FGDGEGGFFFF#9:D,=F4FFF?8FFFGGA@DFA@=<FGFE+C#:#####::=#:+B#:B##:B###3#:3#####
@M03254:27:000000000-J5BG3:1:2104:18354:18365 2:N:0:CGCTCATT+NGCTCTGA
CACAATTTTCAAGNNNNGGATTGTCAGGCGTGGGACAAGTCCACTGCGGTGTTCGGCGGAGGGACCAGATNGACCGTCCTAGGTCAGCCCAAGGCTGCCCCCNCNNNNNCTCNGTTNCCNNCCNNNCNCGNNNNN
+
CCCCCCFEGGGAF####=:CCCEGFFGGGGGGGGGGGFGFEFFFC<FFECDFDFCFEFE:F>>FFC<FFE#:C<DGGGGGFGGGGGGGGGGGCFGGGGGGGG#:#####:4B#::A#:B##8:###+#::#####
@M03254:27:000000000-J5BG3:1:2105:22752:5154 2:N:0:CGCTCATT+GGCTCTGA
TTGATATGGTTCGTNNNGGATTGTCAGGCGTGGGACAAGTCCACTGCGGTGTTCGGCGGAGGGACCAGATTNACCGTCCTAGGTCAGACCAAGGCTGCCCCCTCGGTCACTCTGTNCCCNCCCNCCTNGGTGATC
+
CCCCCGFGGGGGG@###::CCFFGGGGGGGGEGGGGFFFGAFGGGFFGGGGGGGGGGGCFECFFF6CFFEG#:CFGGGGFE?E?FBEE?FGGGGGGGGFGFFGGGGGGGGGGGGG#8BD#8AB#:A3#38@+8@=
@M03254:27:000000000-J5BG3:1:2105:12704:9337 2:N:0:CGCTCATT+GGCTCTGA
TTGATATGGTTCGTNNNGGATTGTCAGGCGTGGGACAAGTCCACTGCGGTGTTCGGCGGAGGGACCAGATTNACCGTCCTAGGTCAGCCCAAGGCTGCCCCCTCGGTCACTCTGTNCCCNCCCNCCTNTCGAGAG
+
CCCCCGGGGGGGGG###==CDGFGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGEG,:EDFG#:CFGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGEGGGGGGGG#:DF#:=F#:A<#+8DFGFG
@M03254:27:000000000-J5BG3:1:2107:10217:5054 2:N:0:CGCTCATT+NGCTCTGA
TTGTTCTGGTTTGTNNNGGATTGTCAGGCGTGGGACAAGTCCACTGCGGTGTTCGGCGGAGGGACCAGATTGACCGTCCTAGGTCAGCCCANNNNTGCCCNNNNNGNNNNTNTNTNNNNNNNNNNNTNGNNNNNN
+
-ACCCGGGGGGGGG###==DFGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGFGGGGGGGGGGFGGGGGGG####4:BFG#####:####:#:#:###########:#:######
@M03254:27:000000000-J5BG3:1:2107:19004:10013 2:N:0:CGCTCATT+NGCTCTGA
ATGTTCTGGTTTGTNNNGGATTGTCAGGCGTGGGACAAGTCCACTGCGGTGTTCGGCGGAGGGACCAGATTGACCGTCCTAGGTCAGCCCANNNNTGCCCNNNNNGNNNNTNTNTNNNNNNNNNNNTNANNNNNN
+
CCCCCGGGGGGGGG###==CFGGGFGGGGGGGGGGGGGGGGGGGGGGGGFGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGFGGGGGGGGG####9:9FG#####+####8#8#:###########:#:######
@M03254:27:000000000-J5BG3:1:2107:16334:14197 2:N:0:CGCTCATT+NGCTCTGA
ACACGTTCACGTGTNNNGGATTGTCAGGCGTGGGACAAGTCCACTGCGGTGTTCGGCGGAGGGACCAGATTGACCGTCCTAGGTCAGCCCANNNNTGCCCNNNNNGNNNNTNTNTNNNNNNNNNNNTNGNNNNNN
+
A-@BCFGGFFGE6E###==C-CEFCEGGGGEEEGFFGFGGFCF@EF9CEEGGGGGDGC>C@FGCEECCFEFGGDGGGGGGGDFGGFC@FE@####::449#####:####:#:#:###########+#:######
!LAUNCH: $VIDJIL_DIR/$EXEC $VIDJIL_DEFAULT_OPTIONS -r 1 -g $VIDJIL_DIR/germline/homo-sapiens.g ./bug4263.fastq
$ All the reads are segmented
1: junction detected in 7 reads
$ We have a single clone
1: Clone #001 .* 7 reads
$ We succeed to fine segment it
1: IGLV3.*IGLJ3
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment