static boolean validPsl(struct psl *psl) /* check if a psl is internally consistent */ { static FILE *devNull = NULL; if (devNull == NULL) devNull = mustOpen("/dev/null", "w"); return (pslCheck("", devNull, psl) == 0); }
static void outputPsl(struct blastBlock *bb, unsigned flags, struct psl *psl, FILE* pslFh, FILE* scoreFh) /* output a psl and optional score */ { pslTabOut(psl, pslFh); if (scoreFh != NULL) pslBuildScoresWrite(scoreFh, psl, bb->bitScore, bb->eVal); pslCheck("blastToPsl", stderr, psl); }
static void chkPsl(struct psl* psl, unsigned iRow, char* database, char* table, struct metaDataTbls* metaDataTbls, unsigned typeFlags) /* Validate a PSL of a mrna/est to genome alignment against the metadata. * Also count the number of alignments of a mrna. */ { unsigned chromSize = getChromSize(database, psl->tName); struct metaData* md = metaDataTblsFind(metaDataTbls, psl->qName); char pslDesc[128]; if (gbVerbose >= 3) gbVerbMsg(3, "chkPsl %s:%d %s %s", table, iRow, psl->qName, psl->tName); safef(pslDesc, sizeof(pslDesc), "psl %s.%s row %u", database, table, iRow); /* check that we have sequence info and compare sizes sizes */ if (chromSize == 0) gbError("%s: tName not a valid chromosome: \"%s\"", pslDesc, psl->tName); else if (chromSize != psl->tSize) gbError("%s: tSize %u != chromosome %s size %u", pslDesc, psl->tSize, psl->tName, chromSize); if (md == NULL) gbError("%s: qName not in mrna table as type %s: \"%s\"", pslDesc, gbFmtSelect(typeFlags & GB_TYPE_MASK), psl->qName); else if (md->inSeq) { if (!md->inGbIndex) gbError("%s: qName not in gbIndex as type %s: \"%s\"" " (Note: this can be caused by GenBank entries that were changed from type mRNA to other RNA types)", pslDesc, gbFmtSelect(typeFlags & GB_TYPE_MASK), psl->qName); else { if (typeFlags != md->typeFlags) gbError("%s: alignment for %s type %s doesn't match expected %s", pslDesc, psl->qName, gbFmtSelect(md->typeFlags), gbFmtSelect(typeFlags)); } if (md->seqSize != psl->qSize) gbError("%s: qSize %u != %s size %u", pslDesc, psl->qSize, psl->qName, md->seqSize); md->numAligns++; } /* validate consistency of PSL */ if (pslCheck(pslDesc, stderr, psl)) errorCnt++; }
static void outputPsl(struct psl *psl, FILE* pslFh) /* output a psl */ { pslTabOut(psl, pslFh); pslCheck("blastXmlToPsl", stderr, psl); }