Skip to content

Commit

Permalink
[chainerutils] Rename create_simple_overlap to create_overlap
Browse files Browse the repository at this point in the history
  • Loading branch information
edawson committed Nov 2, 2020
1 parent 9f75411 commit c72e5c9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions cudamapper/src/chainer_utils.cu
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct OverlapToNumResiduesOp
}
};

__host__ __device__ Overlap create_simple_overlap(const Anchor& start, const Anchor& end, const int32_t num_anchors)
__host__ __device__ Overlap create_overlap(const Anchor& start, const Anchor& end, const int32_t num_anchors)
{
Overlap overlap;
overlap.num_residues_ = num_anchors;
Expand Down Expand Up @@ -96,7 +96,7 @@ __global__ void backtrace_anchors_to_overlaps(const Anchor* const anchors,
index = predecessors[index];
}
Anchor first_anchor = anchors[first_index];
overlaps[i] = create_simple_overlap(first_anchor, final_anchor, num_anchors_in_chain);
overlaps[i] = create_overlap(first_anchor, final_anchor, num_anchors_in_chain);
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion cudamapper/src/chainer_utils.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace chainerutils
/// \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,
__host__ __device__ Overlap create_overlap(const Anchor& start,
const Anchor& end,
const int32_t num_anchors);

Expand Down
10 changes: 5 additions & 5 deletions cudamapper/tests/Test_CudamapperChainerUtils.cu
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace genomeworks
namespace cudamapper
{

TEST(TestChainerUtils, Create_Simple_Overlap_Tests)
TEST(TestChainerUtils, Create_Overlap_Tests)
{
Anchor a;
a.query_read_id_ = 12;
Expand All @@ -46,7 +46,7 @@ TEST(TestChainerUtils, Create_Simple_Overlap_Tests)
b.target_read_id_ = 46;
b.target_position_in_read_ = 20400;

Overlap p_ab = chainerutils::create_simple_overlap(a, b, 12);
Overlap p_ab = chainerutils::create_overlap(a, b, 12);
ASSERT_EQ(p_ab.query_read_id_, static_cast<uint32_t>(12));
ASSERT_EQ(p_ab.target_read_id_, 46);
ASSERT_EQ(p_ab.query_start_position_in_read_, 130);
Expand All @@ -61,7 +61,7 @@ TEST(TestChainerUtils, Create_Simple_Overlap_Tests)
c.target_read_id_ = 46;
c.target_position_in_read_ = 16000;

Overlap p_bc = chainerutils::create_simple_overlap(b, c, 22);
Overlap p_bc = chainerutils::create_overlap(b, c, 22);
ASSERT_EQ(p_bc.target_start_position_in_read_, 16000);
ASSERT_EQ(p_bc.target_end_position_in_read_, 20400);
ASSERT_EQ(static_cast<char>(p_bc.relative_strand), static_cast<char>(RelativeStrand::Reverse));
Expand All @@ -86,15 +86,15 @@ TEST(TestChainerUtils, Anchor_Chain_Extraction_Tests)
b.target_read_id_ = 46;
b.target_position_in_read_ = 20400;

Overlap p_ab = chainerutils::create_simple_overlap(a, b, 2);
Overlap p_ab = chainerutils::create_overlap(a, b, 2);

Anchor c;
c.query_read_id_ = 12;
c.query_position_in_read_ = 15000;
c.target_read_id_ = 46;
c.target_position_in_read_ = 16000;

Overlap p_bc = chainerutils::create_simple_overlap(b, c, 2);
Overlap p_bc = chainerutils::create_overlap(b, c, 2);

std::vector<Anchor> anchors;
anchors.push_back(a);
Expand Down

0 comments on commit c72e5c9

Please sign in to comment.