You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How splitcode prioritizes matches beyond position and length of match: edit distance and order of tags in the config file #56
When 2 config entries with the same name and same tag sequence length match a read subsequence with the same edit distance at the same position, which entry does splitcode determine to match?
Splitcode's documentation currently does not address this question. The FAQ only notes that splitcode prioritizes matches based on:
position (left to right)
length of match
My understanding based on the source code is that splitcode additionally prioritizes based on the following:
if (!found_curr || (found_curr && error_prev > x.second)) {
error_prev = x.second;
tag_id_curr = tag_id_; // if tags have same name but different mismatch errors: choose the tag w/ smallest error
}
order in which the entry appeared in the config file (earlier is higher priority)
The iteration order is over it->second — the vector stored in the tags hash map for the key corresponding to the current k-mer subsequence of the read being check. This vector is populated by addToMap in the order the tags were processed during config file loading.
This understanding matches the results from the example below.
@Yenaled would you mind confirming my understanding? If so, I'm happy to submit a pull request to update the documentation.
Example
Both tagA entries match read1 with 1 mismatch. How does splitcode choose which tagA entry (the one with sequence ATGT or ACGT) matches read1, and which tagB entry (TCGG or TCAG) matches read2? Is it based on the order in which the entries appear in the config file? The choice should be reflected in whether splitcode trims the sequence or not.
input.fasta
>read1
AGGT
>read2
TCTG
config.txt
ids tags distance left
tagA ATGT 1 1
tagA ACGT 1 -
tagB TCGG 1 -
tagB TCAG 1 1
* Using a list of 4 tags (vector size: 4; map size: 56; num elements in map: 68)
* will process sample 1: input.fasta
* processing the reads ...
done
* processed 2 reads
>read1 LX:Z:tagA:0,0-4
>read2 LX:Z:tagB:0,0-4
TCTG
Activity