Contains methods for converting between the query sequence and reference.
More...
#include <SamQuerySeqWithRefHelper.h>
|
static void | seqWithEquals (const char *currentSeq, int32_t seq0BasedPos, Cigar &cigar, const char *referenceName, const GenomeSequence &refSequence, std::string &updatedSeq) |
| Gets the sequence with '=' in any position where the sequence matches the reference. More...
|
|
static void | seqWithoutEquals (const char *currentSeq, int32_t seq0BasedPos, Cigar &cigar, const char *referenceName, const GenomeSequence &refSequence, std::string &updatedSeq) |
| Gets the sequence converting '=' to the appropriate base using the reference. More...
|
|
Contains methods for converting between the query sequence and reference.
Definition at line 101 of file SamQuerySeqWithRefHelper.h.
◆ seqWithEquals()
void SamQuerySeqWithRef::seqWithEquals |
( |
const char * |
currentSeq, |
|
|
int32_t |
seq0BasedPos, |
|
|
Cigar & |
cigar, |
|
|
const char * |
referenceName, |
|
|
const GenomeSequence & |
refSequence, |
|
|
std::string & |
updatedSeq |
|
) |
| |
|
static |
Gets the sequence with '=' in any position where the sequence matches the reference.
NOTE: 'N' in both the sequence and the reference is not considered a match.
- Parameters
-
currentSeq | sequence that should be converted |
seq0BasedPos | 0 based start position of currentSeq on the reference. |
cigar | cigar string for currentSeq (used for determining how the sequence aligns to the reference) |
referenceName | reference name associated with this sequence |
refSequence | reference sequence object |
updatedSeq | return parameter that this method sets to the current sequence, replacing any matches to the reference with '='. |
Definition at line 243 of file SamQuerySeqWithRefHelper.cpp.
References BaseUtilities::areEqual(), GenomeSequence::getGenomePosition(), Cigar::getRefOffset(), Cigar::INDEX_NA, and BaseUtilities::isAmbiguous().
Referenced by SamRecord::getSequence().
250 updatedSeq = currentSeq;
252 int32_t seqLength = updatedSeq.length();
253 int32_t queryIndex = 0;
255 uint32_t startOfReadOnRefIndex =
258 if(startOfReadOnRefIndex == INVALID_GENOME_INDEX)
264 startOfReadOnRefIndex += seq0BasedPos;
267 while(queryIndex < seqLength)
276 char readBase = currentSeq[queryIndex];
277 char refBase = refSequence[startOfReadOnRefIndex + refOffset];
286 updatedSeq[queryIndex] =
'=';
static bool areEqual(char base1, char base2)
Returns whether or not two bases are equal (case insensitive), if one of the bases is '='...
static const int32_t INDEX_NA
Value associated with an index that is not applicable/does not exist, used for converting between que...
int32_t getRefOffset(int32_t queryIndex)
Return the reference offset associated with the specified query index or INDEX_NA based on this cigar...
static bool isAmbiguous(char base)
Returns whether or not the specified bases is an indicator for ambiguity.
genomeIndex_t getGenomePosition(const char *chromosomeName, unsigned int chromosomeIndex) const
given a chromosome name and position, return the genome position
◆ seqWithoutEquals()
void SamQuerySeqWithRef::seqWithoutEquals |
( |
const char * |
currentSeq, |
|
|
int32_t |
seq0BasedPos, |
|
|
Cigar & |
cigar, |
|
|
const char * |
referenceName, |
|
|
const GenomeSequence & |
refSequence, |
|
|
std::string & |
updatedSeq |
|
) |
| |
|
static |
Gets the sequence converting '=' to the appropriate base using the reference.
- Parameters
-
currentSeq | sequence that should be converted |
seq0BasedPos | 0 based start position of currentSeq on the reference. |
cigar | cigar string for currentSeq (used for determining how the sequence aligns to the reference) |
referenceName | reference name associated with this sequence |
refSequence | reference sequence object |
updatedSeq | return parameter that this method sets to the current sequence, replacing any '=' with the base from the reference. |
Definition at line 296 of file SamQuerySeqWithRefHelper.cpp.
References BaseUtilities::areEqual(), GenomeSequence::getGenomePosition(), Cigar::getRefOffset(), and Cigar::INDEX_NA.
Referenced by SamRecord::getSequence().
303 updatedSeq = currentSeq;
305 int32_t seqLength = updatedSeq.length();
306 int32_t queryIndex = 0;
308 uint32_t startOfReadOnRefIndex =
311 if(startOfReadOnRefIndex == INVALID_GENOME_INDEX)
317 startOfReadOnRefIndex += seq0BasedPos;
320 while(queryIndex < seqLength)
329 char readBase = currentSeq[queryIndex];
330 char refBase = refSequence[startOfReadOnRefIndex + refOffset];
339 updatedSeq[queryIndex] = refBase;
static bool areEqual(char base1, char base2)
Returns whether or not two bases are equal (case insensitive), if one of the bases is '='...
static const int32_t INDEX_NA
Value associated with an index that is not applicable/does not exist, used for converting between que...
int32_t getRefOffset(int32_t queryIndex)
Return the reference offset associated with the specified query index or INDEX_NA based on this cigar...
genomeIndex_t getGenomePosition(const char *chromosomeName, unsigned int chromosomeIndex) const
given a chromosome name and position, return the genome position
The documentation for this class was generated from the following files: