[go: nahoru, domu]

Skip to content

Commit

Permalink
move SingleKmerExactMatch function to AwFmIndex.h to expose the funct…
Browse files Browse the repository at this point in the history
…ion publicly.
  • Loading branch information
Sawwave committed Feb 3, 2024
1 parent 6b37742 commit 7c6bb61
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 25 deletions.
26 changes: 26 additions & 0 deletions src/AwFmIndex.h
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,32 @@ enum AwFmReturnCode awFmReadIndexFromFile(
struct AwFmIndex *_RESTRICT_ *_RESTRICT_ index, const char *fileSrc, const bool keepSuffixArrayInMemory);


/*
* Function: awFmDatabaseSingleKmerExactMatch
* --------------------
* Queries the FM-Index for the range of BWT positions that represent instances
* of the given Kmer found in the database.
*
* If the given kmer is not found, the AwFmSearch Range will result in a false value
* when given to the awFmSearchRangeIsValid function.
*
* Inputs:
* index: Pointer to the valid AwFmIndex struct.
* kmer: Pointer to the kmer character string.
* kmer MUST point to valid data, otherwise, undefined behavior may occur, including
* creating potential segfauts.
* kmerLength: Length of the kmer to be queried. Undefined behavior may occur if
* the function is given a kmerLength of 0.
*
* Returns:
* AwFmSearchRange representing the range of BWT positions where the given
* kmer may be found, as long as startPtr < endPtr. Otherwise (startPtr >= endPtr),
* the given kmer does not exist in the database sequence.
*/
struct AwFmSearchRange awFmDatabaseSingleKmerExactMatch(
const struct AwFmIndex *_RESTRICT_ const index, const char *_RESTRICT_ const kmer, const uint16_t kmerLength);


/*
* Function: awFmCreateKmerSearchList
* --------------------
Expand Down
25 changes: 0 additions & 25 deletions src/AwFmSearch.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,6 @@
#include "AwFmIndexStruct.h"


/*
* Function: awFmDatabaseSingleKmerExactMatch
* --------------------
* Queries the FM-Index for the range of BWT positions that represent instances
* of the given Kmer found in the database.
*
* If the given kmer is not found, the AwFmSearch Range will result in a false value
* when given to the awFmSearchRangeIsValid function.
*
* Inputs:
* index: Pointer to the valid AwFmIndex struct.
* kmer: Pointer to the kmer character string.
* kmer MUST point to valid data, otherwise, undefined behavior may occur, including
* creating potential segfauts.
* kmerLength: Length of the kmer to be queried. Undefined behavior may occur if
* the function is given a kmerLength of 0.
*
* Returns:
* AwFmSearchRange representing the range of BWT positions where the given
* kmer may be found, as long as startPtr < endPtr. Otherwise (startPtr >= endPtr),
* the given kmer does not exist in the database sequence.
*/
struct AwFmSearchRange awFmDatabaseSingleKmerExactMatch(
const struct AwFmIndex *_RESTRICT_ const index, const char *_RESTRICT_ const kmer, const uint16_t kmerLength);


/*
* Function: awFmBacktraceBwtPosition
Expand Down

0 comments on commit 7c6bb61

Please sign in to comment.