[Seqan-dev] AlignedReadStore
- From: Ruolin Liu <rliu0606@gmail.com>
- To: seqan-dev@lists.fu-berlin.de
- Date: Sun, 30 Apr 2017 01:09:11 -0700
- Reply-to: SeqAn Development <seqan-dev@lists.fu-berlin.de>
- Subject: [Seqan-dev] AlignedReadStore
Dear seqan developers,
Below is a copy of the code from the example. I commented on some lines.
Ruolin
void countReadsPerGene(String<unsigned> & readsPerGene, String<TIntervalTree> const & intervalTrees, TStore const & store) { resize(readsPerGene, length(store.annotationStore), 0); String<TId> result; int numAlignments = length(store.alignedReadStore); // iterate aligned reads and get search their begin and end positions SEQAN_OMP_PRAGMA(parallel for private (result)) for (int i = 0; i < numAlignments; ++i) { TAlignedRead const & ar = store.alignedReadStore[i]; TPos queryBegin = _min(ar.beginPos, ar.endPos); // In gapped space TPos queryEnd = _max(ar.beginPos, ar.endPos); // In gapped space // search read-overlapping genes findIntervals(result, intervalTrees[ar.contigId] /*Ungapped space*/, queryBegin, queryEnd); // increase read counter for each overlapping annotation given the id in the interval tree for (unsigned j = 0; j < length(result); ++j) { SEQAN_OMP_PRAGMA(atomic) readsPerGene[result[j]] += 1; } } }
Best,
Ruolin
-
seqan-dev - April 2017 - Archives indexes sorted by:
[ thread ] [ subject ] [ author ] [ date ] - Complete archive of the seqan-dev mailing list
- More info on this list...