5c34b9229866a9c0033003e2c21509b8de55f87e markd Tue Nov 29 09:39:18 2022 -0800 include some of the GFF3 positional value in the attributes output file diff --git src/hg/utils/gff3ToGenePred/gff3ToGenePred.c src/hg/utils/gff3ToGenePred/gff3ToGenePred.c index bd96af9..ec1b8c0 100644 --- src/hg/utils/gff3ToGenePred/gff3ToGenePred.c +++ src/hg/utils/gff3ToGenePred/gff3ToGenePred.c @@ -367,30 +367,39 @@ /* Write attributes for -attrsOut */ { struct gff3Attr *attr; for(attr=ann->attrs; attr; attr=attr->next) { fprintf(outAttrsFp, "%s\t%s\t", name, attr->tag); struct slName *val; for (val = attr->vals; val; val = val->next) { if (val != attr->vals) fputc(',', outAttrsFp); fprintf(outAttrsFp, "%s", val->name); } fputc('\n', outAttrsFp); } +// include some basic info from GFF3 fixed fields, capitalize +// to prevent any conflicts with attributes, capitalize attributes +// are reserved +fprintf(outAttrsFp, "Seqid\t%s\n", ann->seqid); +fprintf(outAttrsFp, "Source\t%s\n", ann->source); +fprintf(outAttrsFp, "Type\t%s\n", ann->type); +fprintf(outAttrsFp, "Start\t%u\n", ann->start); +fprintf(outAttrsFp, "End\t%u\n", ann->end); +fprintf(outAttrsFp, "Strand\t%s\n", ann->strand); } static void outputGenePred(struct gff3Ann *mrna, FILE *gpFh, struct genePred *gp) /* validate and output a genePred */ { if (gp->name == NULL) gp->name=cloneString("no_name"); char description[PATH_LEN]; safef(description, sizeof(description), "genePred from GFF3: %s:%d", ((mrna->file != NULL) ? mrna->file->fileName : ""), mrna->lineNum); int ret = genePredCheck(description, stderr, -1, gp); if (ret == 0) {