void setBitsN(DNA *dna, int size, Bits *bits) /* Set bits in bitmap where there are N's in DNA. */ { int i; for (i=0; i<size; ++i) { if (dna[i] == 'n' || dna[i] == 'N') bitSetOne(bits, i); } }
void axtSetBits(struct axt *axt, int chromSize, Bits *aliBits, Bits *matchBits) /* Set bits where there are alignments and matches. */ { char q, t, *qSym = axt->qSym, *tSym = axt->tSym; int i, symCount = axt->symCount; int tPos = axt->tStart; assert(axt->tStrand == '+'); for (i=0; i<symCount; ++i) { assert(tPos < chromSize); q = qSym[i]; t = tSym[i]; if (q != '-' && t != '-') { bitSetOne(aliBits, tPos); if (ntChars[(int)q] == ntChars[(int)t]) bitSetOne(matchBits, tPos); } if (t != '-') ++tPos; } }
Bits *maskFromUpperCaseSeq(bioSeq *seq) /* Allocate a mask for sequence and fill it in based on * sequence case. */ { int size = seq->size, i; char *poly = seq->dna; Bits *b = bitAlloc(size); for (i=0; i<size; ++i) { if (isupper(poly[i])) bitSetOne(b, i); } return b; }
static void rMarkUsed(struct cnFill *fillList, Bits *bits, int maxId) /* Recursively mark bits that are used. */ { struct cnFill *fill; for (fill = fillList; fill != NULL; fill = fill->next) { if (fill->chainId != 0) { if (fill->chainId >= maxId) errAbort("chainId %d, can only handle up to %d", fill->chainId, maxId); bitSetOne(bits, fill->chainId); } if (fill->children != NULL) rMarkUsed(fill->children, bits, maxId); } }