0529f8de2a72011dfcea8f9a1221b6d227341743 braney Tue Mar 10 17:34:58 2026 -0700 hgc MAF click: use mafFrag to show only selected species with inserts removed Change the hgc MAF detail page to use hgMafFrag/hgBigMafFrag instead of displaying raw MAF blocks. This stitches alignments into a single continuous display in reference coordinates, filtering to only selected species and removing insertion columns where the reference has gaps. Key changes: - mafClick.c: rewrite mafOrAxtClick2 to build species orderList from trackDb settings (speciesOrder, speciesGroup, speciesUseFile) respecting speciesDefaultOff and cart on/off state via cartUsualBooleanClosestToHome, matching the hgTracks species selection logic in newSpeciesItems(). Add mafStripRefGaps() to remove insertion columns from mafFrag output. Show spaces instead of dots for matching bases in diff mode. - hgMaf.h/hgMaf.c: add hgMafFragFromMafList() public wrapper for pre-loaded mafLists (AXT/custom mafFile support). Change hgMafFragHelper to skip species not in orderList instead of errAbort. Track per-species source coordinates (src, start, end, srcSize, strand) in struct oneOrg so browser/DNA links work correctly in mafFrag output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> diff --git src/hg/inc/hgMaf.h src/hg/inc/hgMaf.h index 7b35382b5b8..9c2d7cf8b93 100644 --- src/hg/inc/hgMaf.h +++ src/hg/inc/hgMaf.h @@ -91,30 +91,44 @@ 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. */ ); /* mafFrag- Extract maf sequences for a region from database. * This creates a somewhat unusual MAF that extends from start * to end whether or not there are actually alignments. Where * there are no alignments (or alignments missing a species) * a . character fills in. The score is always zero, and * the sources just indicate the species. You can mafFree this * as normal. */ +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). */ + 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);