715e2acf2dd9ef6106cc42ce79c724e1e52ad62e
braney
  Thu Mar 12 09:14:28 2026 -0700
NoDots MAF alignment display for hgc mafClick, with i-row preservation and mafFrag -noDots flag

hgMaf.c: add hgMafFragHelperNoDots and public wrappers (hgMafFragNoDots,
hgBigMafFragNoDots, hgMafFragFromMafListNoDots) that return a list of maf
blocks containing only species with actual sequence — no dot-filled rows.
Blocks are broken when the species set changes; gaps between same-species
blocks are filled with native sequence for the reference and dashes for
others.  Preserve i-row data (leftStatus/rightStatus/leftLen/rightLen)
through the NoDots path so insert annotations appear in emitted blocks.
hgMaf.h: declare the new NoDots public functions.
mafClick.c: use NoDots path when mafClickMafFrag is enabled.  Fix block
numbering (aliIx was never incremented in useMafFrag path).  Use full
textSize for NoDots line width.  Use dots instead of spaces in diff mode
for both paths.  Fix species label width computation to check labelHash
consistently so long assembly names don't misalign sequences.  Strip
ref gap columns where no other species has sequence.
mafFrag: add -noDots option to invoke hgMafFragNoDots from the command line,
with 4 new tests (noDots, noDotsRev, noDotsOutName, noDotsLarger).
refs #21477

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

diff --git src/hg/inc/hgMaf.h src/hg/inc/hgMaf.h
index 9c2d7cf8b93..ada43160c5e 100644
--- src/hg/inc/hgMaf.h
+++ src/hg/inc/hgMaf.h
@@ -105,30 +105,70 @@
 
 struct mafAli *hgMafFragFromMafList(
 	char *database,     /* Database, must already have hSetDb to this */
 	char *chrom, 	    /* Chromosome (in database genome) */
 	int start, int end, /* start/end in chromosome */
 	char strand, 	    /* Chromosome strand. */
 	struct mafAli *mafList, /* Pre-loaded list of maf alignments */
 	char *outName, 	    /* Optional name to use in first component */
 	struct slName *orderList /* Optional order of organisms. */
 	);
 /* Extract maf sequences for a region from a pre-loaded mafList.
  * Same behavior as hgMafFrag but takes mafList directly instead
  * of loading from database.  Caller should not free mafList
  * afterwards (it is consumed). */
 
+struct mafAli *hgBigMafFragNoDots(
+	char *database,     /* Database, must already have hSetDb to this */
+        struct bbiFile *bbi,
+	char *chrom, 	    /* Chromosome (in database genome) */
+	int start, int end, /* start/end in chromosome */
+	char strand, 	    /* Chromosome strand. */
+	char *outName, 	    /* Optional name to use in first component */
+	struct slName *orderList /* Optional order of organisms. */
+	);
+/* hgBigMafFragNoDots - Extract maf sequences for a region from a bigMaf.
+ * Returns a list of maf blocks with no dots - each block only contains
+ * assemblies that have actual sequence. */
+
+struct mafAli *hgMafFragNoDots(
+	char *database,     /* Database, must already have hSetDb to this */
+	char *track, 	    /* Name of MAF track */
+	char *chrom, 	    /* Chromosome (in database genome) */
+	int start, int end, /* start/end in chromosome */
+	char strand, 	    /* Chromosome strand. */
+	char *outName, 	    /* Optional name to use in first component */
+	struct slName *orderList /* Optional order of organisms. */
+	);
+/* hgMafFragNoDots - Extract maf sequences for a region from database.
+ * Returns a list of maf blocks with no dots - each block only contains
+ * assemblies that have actual sequence. */
+
+struct mafAli *hgMafFragFromMafListNoDots(
+	char *database,     /* Database, must already have hSetDb to this */
+	char *chrom, 	    /* Chromosome (in database genome) */
+	int start, int end, /* start/end in chromosome */
+	char strand, 	    /* Chromosome strand. */
+	struct mafAli *mafList, /* Pre-loaded list of maf alignments */
+	char *outName, 	    /* Optional name to use in first component */
+	struct slName *orderList /* Optional order of organisms. */
+	);
+/* Extract maf sequences for a region from a pre-loaded mafList.
+ * Returns a list of maf blocks with no dots - each block only contains
+ * assemblies that have actual sequence.  Caller should not free mafList
+ * afterwards (it is consumed). */
+
 int mafCmp(const void *va, const void *vb);
 /* Compare to sort based on start of first component. */
 
 struct consWiggle {
     struct consWiggle *next;    /* Next in list */
     char *table;                /* phastCons table */
     char *leftLabel;            /* Left label for hgTracks */
     char *uiLabel;              /* Label to print on trackUi */
 };
 
 struct consWiggle *wigMafWiggles(char *db, struct trackDb *tdb);
 /* get conservation wiggle table names and labels from trackDb setting,
    ignoring those where table doesn't exist */
 
 char *wigMafWiggleVar(char *prefix, struct consWiggle *wig,char **suffix);