int3 BehaviorTor::correct(AtomsVector3d *atomsVector, const int3 &coords) const
{
    assert(coords.z >= 0);
    assert(coords.z < (int)atomsVector->sizes().z);

    int3 result = coords;
    result.x = correctOne(coords.x, atomsVector->sizes().x);
    result.y = correctOne(coords.y, atomsVector->sizes().y);
    return result;
}
Example #2
0
void correctEst(char *oldFa, char *pslFile, char *nibDir, char *outFa)
/* correctEst - Correct ESTs by passing them through genome. */
{
struct hash *pslHash = hashPsls(pslFile);
struct lineFile *lf = lineFileOpen(oldFa, FALSE);
FILE *f = mustOpen(outFa, "w");
static struct dnaSeq est;
struct hashEl *hel;
struct psl *psl;
struct hash *nibHash = newHash(8);

while (faSpeedReadNext(lf, &est.dna, &est.size, &est.name))
    {
    if ((psl = hashFindVal(pslHash, est.name)) != NULL)
        {
	correctOne(&est, psl, nibDir, nibHash, f);
	}
    else
        {
	faWriteNext(f, est.name, est.dna, est.size);
	}
    }
}