-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use functions to convert hits to positions.
- Loading branch information
1 parent
4ffcc6a
commit a7bf985
Showing
6 changed files
with
79 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#ifndef HIT_H_ | ||
#define HIT_H_ | ||
|
||
#include "strand.h" | ||
|
||
namespace chromap { | ||
|
||
inline static uint32_t GenerateSequenceIndex(uint64_t seed_hit) { | ||
return (seed_hit >> 33); | ||
} | ||
|
||
inline static uint32_t GenerateSequencePosition(uint64_t seed_hit) { | ||
return (seed_hit >> 1); | ||
} | ||
|
||
inline static Strand GenerateSequenceStrand(uint64_t seed_hit) { | ||
if ((seed_hit & 1) == 0) { | ||
return kPositive; | ||
} | ||
return kNegative; | ||
} | ||
|
||
inline static bool AreTwoHitsOnTheSameStrand(uint64_t seed_hit1, | ||
uint64_t seed_hit2) { | ||
return ((seed_hit1 & 1) == (seed_hit2 & 1)); | ||
} | ||
|
||
} // namespace chromap | ||
|
||
#endif // HIT_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters