extract_sv_reads/samblaster: explain this code please.
1
0
Entering edit mode
6.9 years ago

https://github.com/hall-lab/extract_sv_reads is a tools extracting splitter or discordant reads from a BAM or CRAM file. It's output can be used by lumy-sv to dected structural variant.

I'm trying to adapt it for my need. But I don't understand the lines 56 to 63 where it looks for spliced reads: https://github.com/hall-lab/extract_sv_reads/blob/master/src/exe/extract_sv_reads/extract_sv_reads.cpp#L56

if (mno(*left, *right) < opts.min_non_overlap) 
    continue;

if (should_check(*left, *right)) {
    if ((abs(insert_size(*left, *right)) < opts.min_indel_size)
            || ((desert(*left, *right) > 0)
                && (desert(*left, *right) - (int) std::max(0, insert_size(*left, *right))) > opts.max_unmapped_bases)) {
        continue;

The code is inspired from samblaster (SAM version) https://github.com/GregoryFaust/samblaster/blob/master/samblaster.cpp#L1119

As far as I understand, the current read is checked to it's supplementary alignements ("SA:Z:" tag). if the read and its suppl align have the same contig and the same strand then things(?) are checked. The code is a mix of variables with (un)clipped/start/end but I don't understand the real meaning of the code.

samblaster c cpp spliced-read • 1.9k views
ADD COMMENT
0
Entering edit mode

If the master does not understand the code then do others have a chance :-)

Dare I suggest creating an issue on GitHub in case this person does not use Biostars.

ADD REPLY
0
Entering edit mode

I'm not a master, but I'm too lazy to try to understand :-)

ADD REPLY
1
Entering edit mode

Spoken like a true programmer.

ADD REPLY
0
Entering edit mode
ADD REPLY
2
Entering edit mode
6.9 years ago
gf4ea ▴ 30

I have posted a reply here: https://github.com/GregoryFaust/samblaster/issues/33

ADD COMMENT

Login before adding your answer.

Traffic: 2209 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6