06c291fd5322d86575d76d1f0f44a388371b57d7
markd
  Fri Nov 15 12:18:13 2019 -0800
added RNA and CDS lenght to clusterGene output for easy access for post-processing

diff --git src/hg/geneBounds/clusterGenes/clusterGenes.c src/hg/geneBounds/clusterGenes/clusterGenes.c
index 94340e9..9c6b1f6 100644
--- src/hg/geneBounds/clusterGenes/clusterGenes.c
+++ src/hg/geneBounds/clusterGenes/clusterGenes.c
@@ -771,32 +771,32 @@
 void prConflicts(FILE *f, struct slRef* conflicts)
 /* print list of conflicts as comma-seperated list */
 {
 struct slRef* cl;
 fprintf(f, "\t");
 for (cl = conflicts; cl != NULL; cl = cl->next)
     {
     struct clusterGene *cg = cl->val;
     fprintf(f, "%s:%s,", cg->track->name, cg->gp->name);
     }
 }
 
 void prGene(FILE *f, struct cluster *cluster, struct clusterGene *cg)
 /* output info on one gene */
 {
-fprintf(f, "%d\t%s\t%s\t%s\t%d\t%d\t%s", cluster->id, cg->track->name, cg->gp->name, cg->gp->chrom, cg->gp->txStart, cg->gp->txEnd,
-        cg->gp->strand);
+fprintf(f, "%d\t%s\t%s\t%s\t%d\t%d\t%s\t%d\t%d", cluster->id, cg->track->name, cg->gp->name, cg->gp->chrom, cg->gp->txStart, cg->gp->txEnd,
+        cg->gp->strand, genePredBases(cg->gp), genePredCodingBases(cg->gp));
 if (gDetectConflicted)
     {
     fprintf(f, "\t%c\t%c", (cluster->hasExonConflicts ? 'y' : 'n'),
             (cluster->hasCdsConflicts ? 'y' : 'n'));
     prConflicts(f, cg->exonConflicts);
     prConflicts(f, cg->cdsConflicts);
     }
 fprintf(f, "\n");
 }
 
 Bits* mkClusterMap(struct cluster *cluster)
 /* make a bit map of the exons in a cluster */
 {
 int len = (cluster->end - cluster->start);
 Bits *map = bitAlloc(len);
@@ -918,31 +918,33 @@
 genePredFreeList(&gpList);
 clusterFreeList(&clusterList);
 }
 
 FILE *openOutput(char *outFile)
 /* open the output file and write the header */
 {
 FILE *f = mustOpen(outFile, "w");
 fputs("#"
       "cluster\t"
       "table\t"
       "gene\t"
       "chrom\t"
       "txStart\t"
       "txEnd\t"
-      "strand", f);
+      "strand\t"
+      "rnaLength\t"
+      "cdsLength", f);
 if (gDetectConflicted)
     fputs("\thasExonConflicts\t"
           "hasCdsConflicts\t"
           "exonConflicts\t"
           "cdsConflicts", f);
 fputs("\n", f);
 return f;
 }
 
 void clusterGenes(char *outFile, char *database, int specCount, char *specs[])
 /* clusterGenes - Cluster genes from genePred tracks. */
 {
 struct slName *chroms, *chrom;
 struct sqlConnection *conn = NULL;
 struct track *tracks;