void gffIntoDatabase(char *database, char *fileName, char *table, int offset) /* Load a gff file into database. */ { struct gffFile *gff = gffFileNew(""); struct gffGroup *group; struct genePred *gpList = NULL, *gp; FILE *f; char *tabName = "genePred.tab"; /* Load fixed gff and convert it to genePred. */ gffFileAdd(gff, fileName, 0); gffGroupLines(gff); for (group = gff->groupList; group != NULL; group = group->next) { gp = genePredFromGroupedGff(gff, group, group->name, "exon", genePredCdsStatFld|genePredExonFramesFld, genePredGxfDefaults); if (gp != NULL) { slAddHead(&gpList, gp); genePredOffset(gp, offset); } } slSort(&gpList, genePredCmp); /* Create tab-delimited file. */ f = mustOpen(tabName, "w"); for (gp = gpList; gp != NULL; gp = gp->next) genePredTabOut(gp, f); carefulClose(&f); /* Load into database. */ loadIntoDatabase(database, createGenePred, "sanger22", tabName); }
void hgSanger20(char *database, char *gffFile, char *infoFile) /* Process chromosome 20 gff file. */ { struct hash *infoHash = readInfoFile(infoFile); struct sanger22extra *sxList = processGff(gffFile, infoHash), *sx; char *tabName = "extra.tab"; FILE *f = mustOpen(tabName, "w"); for (sx = sxList; sx != NULL; sx = sx->next) sanger22extraTabOut(sx, f); carefulClose(&f); loadIntoDatabase(database, sanger22extraCreate, "sanger20extra", tabName); }
void hgSanger22(char *database, char *txGff, char *cdsGff, char *mrnaFa, char *aaFa, int shortArmSize) /* hgSanger22 - Load up database with Sanger 22 annotations. */ { char *fixedGff = "fixed.gff"; char *extraBed = "extras.bed"; struct hash *extraHash = newHash(0); struct sanger22extra *extraList; extraList = makeFixedGffAndReadExtra(txGff, cdsGff, fixedGff, extraHash); saveExtras(extraBed, extraList); loadIntoDatabase(database, sanger22extraCreate, "sanger22extra", extraBed); gffIntoDatabase(database, fixedGff, "sanger22", shortArmSize); }