-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[cudamapper] Add anchor chain output functions to chainer_utils.cuh. #590
base: dev
Are you sure you want to change the base?
[cudamapper] Add anchor chain output functions to chainer_utils.cuh. #590
Conversation
Adds two functions required for retrieving the anchors within an overlap.
…t calculation to output_overlap_chains_by_backtrace.
This adds the functions needed to generate the anchor chains from a list of overlaps, assuming the overlap list has not been previously filtered (though masking using the select_mask is permissible). |
… However, tests fail because the allocator used in testing can't actually allocate memory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a few basic comments. Can you please add more documentation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So far reviewed allocate_anchor_chains()
and left some general comments
cudamapper/src/chainer_utils.cuh
Outdated
/// \param start The first anchor in the chain. | ||
/// \param end The last anchor in the chain. | ||
/// \param num_anchors The total number of anchors in the chain. | ||
__host__ __device__ Overlap create_simple_overlap(const Anchor& start, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is only called by backtrace_anchors_to_overlaps()
. I understand that it cannot be in an anonymous namespace in order be able to call it form unittest, but it could be moved to details
namespace in order to signal the users that they do not have to think about it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think creating an overlap from two anchors and a number of residues is useful and could be a user-facing API function, but the function could be better named.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. That's why I was suggesting moving it closed to Overlap
's definition: #590 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. I've renamed it to create_overlap
in c72e5c9.
…meworks into anchor-backtrace-io
…e) and fix docs issues brought up in review.
… when instantiating device arrays.
… to process backtraced overlaps.
- Use thrust transform_reduce and transform_exclusive_scan (rather than make_transform iterator) whe> - Constify pointers where possible. - Remove unnecessary includes. - Tweak docs for backtrace_anchors_to_overlap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please have a look at still unresolved comments from previous reviews as well (you can ignore comment about create_overlap
)
Primarily, this adds a number of tests for output_overlap_chains_by_RLE, output_overlap_chains_by_backtrace, and backtrace_anchors_to_overlaps. It also fixes a bug where the last anchor position in a chain was not returned from backtrace_anchors_to_overlaps, causing faulty output when later extracting anchor chains.
rerun tests |
/// \param unrolled_anchor_chains An array of int32_t. Will be resided on return. | ||
/// \param anchor_chain_starts An array holding the index in the anchors array of the first | ||
/// anchor in an overlap. | ||
/// \param num_overlaps The number of overlaps in the overlaps array. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
num_overlaps
does not exist anymore
ASSERT_EQ(overlaps_d.size(), 3); | ||
|
||
ASSERT_EQ(overlaps[0].num_residues_, 1); | ||
ASSERT_EQ(overlaps[0].target_read_id_, UINT32_MAX); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better use std::numeric_limits<decltype(overlaps[0].target_read_id_)>::max()
https://en.cppreference.com/w/cpp/types/numeric_limits
#include <algorithm> | ||
|
||
#ifndef NDEBUG |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is algorithm
needed in release mode as well?
/// Launch configuration: any number of blocks/threads, no dynamic shared memory, cuda_stream must be the same in which anchors/overlaps/scores/mask/predecessors/chains/starts were allocated. | ||
/// example: backtrace_anchors_to_overlaps<<<2048, 32, 0, cuda_stream>>>(...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Further descriptions should be placed between \brief
and \param
void allocate_anchor_chains(const device_buffer<Overlap>& overlaps, | ||
device_buffer<int32_t>& unrolled_anchor_chains, | ||
device_buffer<int32_t>& anchor_chain_starts, | ||
int64_t& num_total_anchors, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this necessary? I see it's used to set the size of unrolled_anchor_chains
…meworks into anchor-backtrace-io
Adds the necessary functions for outputting the chains of anchors that represent an overlap.