Imagine I have a reference sequence and some query sequences align to it
end < start the query sequence has aligned to the negative strand
query start stop query1 100 120 query2 50 99 query3 130 110
I want to know the total coverage of the reference sequence, ignoring overlaps, so the number of reference bases covered by one or more alignments.
In this case it is 21+50+10=81
Any language is fine. Assume the input is tab delimited.
Note:This is not an invitation to recommend your favorite third-party alignment tool - you must deal with the data as I have presented it.