cpp_scripts/Mapping_tools/removeUnmapped.c
/**
 * Parse CIGAR string and check for "junction" spanning read
 * @return bool
 */
Parse CIGAR string and check for "junction" spanning read
@return bool
Parse CIGAR string and check for " junction " spanning read @return bool
bool isJunction(const bam1_t *entry)
{
  int32_t pos = entry->core.pos;
  uint32_t cLen = entry->core.n_cigar;
  for (uint32_t k = 0; k<cLen; ++k) {
    int op = bam1_cigar(entry)[k] & BAM_CIGAR_MASK; 
    int l = bam1_cigar(entry)[k] >> BAM_CIGAR_SHIFT; 
    if (op != BAM_CMATCH) {
      if (l>1000) {
	return true;
      }
    }
  }
  return false;
}
bool isJunction ( const bam1_t * entry ) { int32_t pos = entry -> core . pos ; uint32_t cLen = entry -> core . n_cigar ; for ( uint32_t k = 0 ; k < cLen ; ++ k ) { int op = bam1_cigar ( entry ) [ k ] & BAM_CIGAR_MASK ; int l = bam1_cigar ( entry ) [ k ] >> BAM_CIGAR_SHIFT ; if ( op != BAM_CMATCH ) { if ( l > 1000 ) { return true ; } } } return false ; }
Parse CIGAR string and check for "junction" spanning read
 @return bool
Parse CIGAR string and check for " junction " spanning read @return bool
//operation //length  //This is not a match!