eaa60f59ba268f6bc735be9ace4c9f21c55ad517 hartera Thu Feb 28 10:43:29 2013 -0800 Removed oldScore column as no longer needed and renamed oldIntronCount to alignGapCount in ucscRetroInfo table so change code and variable names to match. diff --git src/hg/lib/ucscRetroInfo.c src/hg/lib/ucscRetroInfo.c index 5724f90..77a3925 100644 --- src/hg/lib/ucscRetroInfo.c +++ src/hg/lib/ucscRetroInfo.c @@ -32,32 +32,32 @@ } void ucscRetroInfoSaveToDb(struct sqlConnection *conn, struct ucscRetroInfo *el, char *tableName, int updateSize) /* Save ucscRetroInfo as a row to the table specified by tableName. * As blob fields may be arbitrary size updateSize specifies the approx size * of a string that would contain the entire query. Arrays of native types are * converted to comma separated strings and loaded as such, User defined types are * inserted as NULL. Note that strings must be escaped to allow insertion into the database. * For example "autosql's features include" --> "autosql\'s features include" * If worried about this use ucscRetroInfoSaveToDbEscaped() */ { struct dyString *update = newDyString(updateSize); char *blockSizesArray, *chromStartsArray; blockSizesArray = sqlSignedArrayToString(el->blockSizes, el->blockCount); chromStartsArray = sqlSignedArrayToString(el->chromStarts, el->blockCount); -dyStringPrintf(update, "insert into %s values ( '%s',%u,%u,'%s',%u,'%s',%u,%u,%u,%d,'%s','%s',%d,%d,'%s','%s',%d,%d,'%s',%u,%u,%u,%d,%d,%u,%u,%u,%u,%u,%u,%u,%d,%u,%u,%d,%d,%d,%d,'%s',%d,%d,'%s',%d,%d,'%s',%d,%d,'%s',%d,%d,'%s',%g,%u)", - tableName, el->chrom, el->chromStart, el->chromEnd, el->name, el->score, el->strand, el->thickStart, el->thickEnd, el->reserved, el->blockCount, blockSizesArray , chromStartsArray , el->retroExonCount, el->axtScore, el->type, el->gChrom, el->gStart, el->gEnd, el->gStrand, el->parentSpliceCount, el->geneOverlap, el->polyA, el->polyAstart, el->exonCover, el->intronCount, el->bestAliCount, el->matches, el->qSize, el->qEnd, el->tReps, el->coverage, el->label, el->milliBad, el->oldScore, el->oldIntronCount, el->processedIntrons, el->conservedSpliceSites, el->maxOverlap, el->refSeq, el->rStart, el->rEnd, el->mgc, el->mStart, el->mEnd, el->kgName, el->kStart, el->kEnd, el->overName, el->overStart, el->overExonCover, el->overStrand, el->posConf, el->polyAlen); +dyStringPrintf(update, "insert into %s values ( '%s',%u,%u,'%s',%u,'%s',%u,%u,%u,%d,'%s','%s',%d,%d,'%s','%s',%d,%d,'%s',%u,%u,%u,%d,%d,%u,%u,%u,%u,%u,%u,%u,%d,%u,%d,%d,%d,%d,'%s',%d,%d,'%s',%d,%d,'%s',%d,%d,'%s',%d,%d,'%s',%g,%u)", + tableName, el->chrom, el->chromStart, el->chromEnd, el->name, el->score, el->strand, el->thickStart, el->thickEnd, el->reserved, el->blockCount, blockSizesArray , chromStartsArray , el->retroExonCount, el->axtScore, el->type, el->gChrom, el->gStart, el->gEnd, el->gStrand, el->parentSpliceCount, el->geneOverlap, el->polyA, el->polyAstart, el->exonCover, el->intronCount, el->bestAliCount, el->matches, el->qSize, el->qEnd, el->tReps, el->coverage, el->label, el->milliBad, el->alignGapCount, el->processedIntrons, el->conservedSpliceSites, el->maxOverlap, el->refSeq, el->rStart, el->rEnd, el->mgc, el->mStart, el->mEnd, el->kgName, el->kStart, el->kEnd, el->overName, el->overStart, el->overExonCover, el->overStrand, el->posConf, el->polyAlen); sqlUpdate(conn, update->string); freeDyString(&update); freez(&blockSizesArray); freez(&chromStartsArray); } void ucscRetroInfoSaveToDbEscaped(struct sqlConnection *conn, struct ucscRetroInfo *el, char *tableName, int updateSize) /* Save ucscRetroInfo as a row to the table specified by tableName. * As blob fields may be arbitrary size updateSize specifies the approx size. * of a string that would contain the entire query. Automatically * escapes all simple strings (not arrays of string) but may be slower than ucscRetroInfoSaveToDb(). * For example automatically copies and converts: * "autosql's features include" --> "autosql\'s features include" * before inserting into database. */ { @@ -65,32 +65,32 @@ char *chrom, *name, *strand, *blockSizesArray, *chromStartsArray, *type, *gChrom, *gStrand, *refSeq, *mgc, *kgName, *overName, *overStrand; chrom = sqlEscapeString(el->chrom); name = sqlEscapeString(el->name); strand = sqlEscapeString(el->strand); type = sqlEscapeString(el->type); gChrom = sqlEscapeString(el->gChrom); gStrand = sqlEscapeString(el->gStrand); refSeq = sqlEscapeString(el->refSeq); mgc = sqlEscapeString(el->mgc); kgName = sqlEscapeString(el->kgName); overName = sqlEscapeString(el->overName); overStrand = sqlEscapeString(el->overStrand); blockSizesArray = sqlSignedArrayToString(el->blockSizes, el->blockCount); chromStartsArray = sqlSignedArrayToString(el->chromStarts, el->blockCount); -dyStringPrintf(update, "insert into %s values ( '%s',%u,%u,'%s',%u,'%s',%u,%u,%u,%d,'%s','%s',%d,%d,'%s','%s',%d,%d,'%s',%u,%u,%u,%d,%d,%u,%u,%u,%u,%u,%u,%u,%d,%u,%u,%d,%d,%d,%d,'%s',%d,%d,'%s',%d,%d,'%s',%d,%d,'%s',%d,%d,'%s',%g,%u)", - tableName, chrom, el->chromStart, el->chromEnd, name, el->score, strand, el->thickStart, el->thickEnd, el->reserved, el->blockCount, blockSizesArray , chromStartsArray , el->retroExonCount, el->axtScore, type, gChrom, el->gStart, el->gEnd, gStrand, el->parentSpliceCount, el->geneOverlap, el->polyA, el->polyAstart, el->exonCover, el->intronCount, el->bestAliCount, el->matches, el->qSize, el->qEnd, el->tReps, el->coverage, el->label, el->milliBad, el->oldScore, el->oldIntronCount, el->processedIntrons, el->conservedSpliceSites, el->maxOverlap, refSeq, el->rStart, el->rEnd, mgc, el->mStart, el->mEnd, kgName, el->kStart, el->kEnd, overName, el->overStart, el->overExonCover, overStrand, el->posConf, el->polyAlen); +dyStringPrintf(update, "insert into %s values ( '%s',%u,%u,'%s',%u,'%s',%u,%u,%u,%d,'%s','%s',%d,%d,'%s','%s',%d,%d,'%s',%u,%u,%u,%d,%d,%u,%u,%u,%u,%u,%u,%u,%d,%u,%d,%d,%d,%d,'%s',%d,%d,'%s',%d,%d,'%s',%d,%d,'%s',%d,%d,'%s',%g,%u)", + tableName, chrom, el->chromStart, el->chromEnd, name, el->score, strand, el->thickStart, el->thickEnd, el->reserved, el->blockCount, blockSizesArray , chromStartsArray , el->retroExonCount, el->axtScore, type, gChrom, el->gStart, el->gEnd, gStrand, el->parentSpliceCount, el->geneOverlap, el->polyA, el->polyAstart, el->exonCover, el->intronCount, el->bestAliCount, el->matches, el->qSize, el->qEnd, el->tReps, el->coverage, el->label, el->milliBad, el->alignGapCount, el->processedIntrons, el->conservedSpliceSites, el->maxOverlap, refSeq, el->rStart, el->rEnd, mgc, el->mStart, el->mEnd, kgName, el->kStart, el->kEnd, overName, el->overStart, el->overExonCover, overStrand, el->posConf, el->polyAlen); sqlUpdate(conn, update->string); freeDyString(&update); freez(&chrom); freez(&name); freez(&strand); freez(&blockSizesArray); freez(&chromStartsArray); freez(&type); freez(&gChrom); freez(&gStrand); freez(&refSeq); freez(&mgc); freez(&kgName); freez(&overName); freez(&overStrand); @@ -132,50 +132,50 @@ safecpy(ret->gStrand, sizeof(ret->gStrand), row[18]); ret->parentSpliceCount = sqlUnsigned(row[19]); ret->geneOverlap = sqlUnsigned(row[20]); ret->polyA = sqlUnsigned(row[21]); ret->polyAstart = sqlSigned(row[22]); ret->exonCover = sqlSigned(row[23]); ret->intronCount = sqlUnsigned(row[24]); ret->bestAliCount = sqlUnsigned(row[25]); ret->matches = sqlUnsigned(row[26]); ret->qSize = sqlUnsigned(row[27]); ret->qEnd = sqlUnsigned(row[28]); ret->tReps = sqlUnsigned(row[29]); ret->coverage = sqlUnsigned(row[30]); ret->label = sqlSigned(row[31]); ret->milliBad = sqlUnsigned(row[32]); -ret->oldScore = sqlUnsigned(row[33]); -ret->oldIntronCount = sqlSigned(row[34]); -ret->processedIntrons = sqlSigned(row[35]); -ret->conservedSpliceSites = sqlSigned(row[36]); -ret->maxOverlap = sqlSigned(row[37]); -ret->refSeq = cloneString(row[38]); -ret->rStart = sqlSigned(row[39]); -ret->rEnd = sqlSigned(row[40]); -ret->mgc = cloneString(row[41]); -ret->mStart = sqlSigned(row[42]); -ret->mEnd = sqlSigned(row[43]); -ret->kgName = cloneString(row[44]); -ret->kStart = sqlSigned(row[45]); -ret->kEnd = sqlSigned(row[46]); -ret->overName = cloneString(row[47]); -ret->overStart = sqlSigned(row[48]); -ret->overExonCover = sqlSigned(row[49]); -safecpy(ret->overStrand, sizeof(ret->overStrand), row[50]); -ret->posConf = sqlFloat(row[51]); -ret->polyAlen = sqlUnsigned(row[52]); +//ret->oldScore = sqlUnsigned(row[33]); +ret->alignGapCount = sqlSigned(row[33]); +ret->processedIntrons = sqlSigned(row[34]); +ret->conservedSpliceSites = sqlSigned(row[35]); +ret->maxOverlap = sqlSigned(row[36]); +ret->refSeq = cloneString(row[37]); +ret->rStart = sqlSigned(row[38]); +ret->rEnd = sqlSigned(row[39]); +ret->mgc = cloneString(row[40]); +ret->mStart = sqlSigned(row[41]); +ret->mEnd = sqlSigned(row[42]); +ret->kgName = cloneString(row[43]); +ret->kStart = sqlSigned(row[44]); +ret->kEnd = sqlSigned(row[45]); +ret->overName = cloneString(row[46]); +ret->overStart = sqlSigned(row[47]); +ret->overExonCover = sqlSigned(row[48]); +safecpy(ret->overStrand, sizeof(ret->overStrand), row[49]); +ret->posConf = sqlFloat(row[50]); +ret->polyAlen = sqlUnsigned(row[51]); return ret; } struct ucscRetroInfo *ucscRetroInfoLoadAll(char *fileName) /* Load all ucscRetroInfo from a whitespace-separated file. * Dispose of this with ucscRetroInfoFreeList(). */ { struct ucscRetroInfo *list = NULL, *el; struct lineFile *lf = lineFileOpen(fileName, TRUE); char *row[53]; while (lineFileRow(lf, row)) { el = ucscRetroInfoLoad(row); slAddHead(&list, el); @@ -253,32 +253,32 @@ sqlFixedStringComma(&s, ret->gStrand, sizeof(ret->gStrand)); ret->parentSpliceCount = sqlUnsignedComma(&s); ret->geneOverlap = sqlUnsignedComma(&s); ret->polyA = sqlUnsignedComma(&s); ret->polyAstart = sqlSignedComma(&s); ret->exonCover = sqlSignedComma(&s); ret->intronCount = sqlUnsignedComma(&s); ret->bestAliCount = sqlUnsignedComma(&s); ret->matches = sqlUnsignedComma(&s); ret->qSize = sqlUnsignedComma(&s); ret->qEnd = sqlUnsignedComma(&s); ret->tReps = sqlUnsignedComma(&s); ret->coverage = sqlUnsignedComma(&s); ret->label = sqlSignedComma(&s); ret->milliBad = sqlUnsignedComma(&s); -ret->oldScore = sqlUnsignedComma(&s); -ret->oldIntronCount = sqlSignedComma(&s); +//ret->oldScore = sqlUnsignedComma(&s); +ret->alignGapCount = sqlSignedComma(&s); ret->processedIntrons = sqlSignedComma(&s); ret->conservedSpliceSites = sqlSignedComma(&s); ret->maxOverlap = sqlSignedComma(&s); ret->refSeq = sqlStringComma(&s); ret->rStart = sqlSignedComma(&s); ret->rEnd = sqlSignedComma(&s); ret->mgc = sqlStringComma(&s); ret->mStart = sqlSignedComma(&s); ret->mEnd = sqlSignedComma(&s); ret->kgName = sqlStringComma(&s); ret->kStart = sqlSignedComma(&s); ret->kEnd = sqlSignedComma(&s); ret->overName = sqlStringComma(&s); ret->overStart = sqlSignedComma(&s); ret->overExonCover = sqlSignedComma(&s); @@ -409,33 +409,33 @@ fputc(sep,f); fprintf(f, "%u", el->matches); fputc(sep,f); fprintf(f, "%u", el->qSize); fputc(sep,f); fprintf(f, "%u", el->qEnd); fputc(sep,f); fprintf(f, "%u", el->tReps); fputc(sep,f); fprintf(f, "%u", el->coverage); fputc(sep,f); fprintf(f, "%d", el->label); fputc(sep,f); fprintf(f, "%u", el->milliBad); fputc(sep,f); -fprintf(f, "%u", el->oldScore); -fputc(sep,f); -fprintf(f, "%d", el->oldIntronCount); +//fprintf(f, "%u", el->oldScore); +//fputc(sep,f); +fprintf(f, "%d", el->alignGapCount); fputc(sep,f); fprintf(f, "%d", el->processedIntrons); fputc(sep,f); fprintf(f, "%d", el->conservedSpliceSites); fputc(sep,f); fprintf(f, "%d", el->maxOverlap); fputc(sep,f); if (sep == ',') fputc('"',f); fprintf(f, "%s", el->refSeq); if (sep == ',') fputc('"',f); fputc(sep,f); fprintf(f, "%d", el->rStart); fputc(sep,f); fprintf(f, "%d", el->rEnd); fputc(sep,f);