18 #include "SamRecordHelper.h" 31 throw std::runtime_error(
"Failed to get Cigar.");
34 int32_t readStartIndex =
45 readSeq += readStartIndex;
46 if(strncmp(readSeq, sequence, strlen(sequence)) == 0)
49 return(readStartIndex);
68 bool firstEntry =
true;
69 bool returnStatus =
true;
74 returnString += delim;
87 void* value,
String& returnString)
91 returnString += vtype;
95 returnString += (int)*(
int*)value;
99 returnString.appendFullFloat(*(
float*)value);
103 returnString += (char)*(
char*)value;
bool getNextSamTag(char *tag, char &vtype, void **value)
Get the next tag from the record.
static bool isStringType(char vtype)
Returns whether or not the specified vtype is a string type.
static bool genSamTagsString(SamRecord &record, String &returnString, char delim='\t')
Helper to append the SAM string representation of all the tags to the specified string.
static bool genSamTagString(const char *tag, char vtype, void *value, String &returnString)
Helper to append the SAM string representation of the specified tag to the specified string...
Cigar * getCigarInfo()
Returns a pointer to the Cigar object associated with this record.
static const int32_t INDEX_NA
Value associated with an index that is not applicable/does not exist, used for converting between que...
static bool isCharType(char vtype)
Returns whether or not the specified vtype is a char type.
const char * getSequence()
Returns the SAM formatted sequence string (SEQ), translating the base as specified by setSequenceTran...
static bool isFloatType(char vtype)
Returns whether or not the specified vtype is a float type.
This class represents the CIGAR without any methods to set the cigar (see CigarRoller for that)...
void resetTagIter()
Reset the tag iterator to the beginning of the tags.
int32_t getQueryIndex(int32_t refOffset)
Return the query index associated with the specified reference offset or INDEX_NA based on this cigar...
static bool isIntegerType(char vtype)
Returns whether or not the specified vtype is an integer type.
static int checkSequence(SamRecord &record, int32_t pos0Based, const char *sequence)
Helper method that checks if the record's read sequence starting at the specified 0-based reference p...
Class providing an easy to use interface to get/set/operate on the fields in a SAM/BAM record...
int32_t get0BasedPosition()
Get the 0-based(BAM) leftmost position of the record.