Commit 07adde3c authored by Mikaël Salson's avatar Mikaël Salson

kmerstore.h: Insert properly the revcomp kmers with unsymmetrical seeds.

If the seed is not symmetrical (as with TRA and VdJa), we can't just reverse the seed.
We need to take back the original substring, reverse it and then take the seed.
parent b8750e88
......@@ -208,7 +208,8 @@ void IKmerStore<T>::insert(const seqtype &sequence,
const string &label,
bool ignore_extended_nucleotides){
for(size_t i = 0 ; i + s < sequence.length() + 1 ; i++) {
seqtype kmer = spaced(sequence.substr(i, s), seed);
seqtype substr = sequence.substr(i, s);
seqtype kmer = spaced(substr, seed);
if (ignore_extended_nucleotides && has_extended_nucleotides(kmer))
continue;
......@@ -227,7 +228,7 @@ void IKmerStore<T>::insert(const seqtype &sequence,
}
this_kmer += T(label, strand);
if (revcomp_indexed && ! T::hasRevcompSymetry()) {
seqtype rc_kmer = revcomp(kmer);
seqtype rc_kmer = spaced(revcomp(substr), seed);
T &this_rc_kmer = this->get(rc_kmer);
if (this_rc_kmer.isNull())
nb_kmers_inserted++;
......
!LAUNCH: ../../vidjil -i -g ../../germline/ -r 1 -c clones ../../data/revcomp-VdJa.fa
$ Just one window found
f1:==> found 1 ..-windows
1:==> found 1 ..-windows
$ Just one clone found
f1:==> 1 clones
1:==> 1 clones
$ Two reads segmented in VdJa
1:VdJa -> 2
$ segmentation for the main clone
f1:TRDV1.01 5//3 TRDD2.01 1//7 TRAJ29
1:TRDV1.01 5//3 TRDD2.01 1//7 TRAJ29
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