d409d8e8e6c09a6a668752d9d811c95da0873dc5
max
  Mon Nov 13 23:07:24 2023 -0800
adding info bubbles to hgLiftOver, refs #32011

diff --git src/hg/hgLiftOver/hgLiftOver.c src/hg/hgLiftOver/hgLiftOver.c
index 9c70358..f27790d 100644
--- src/hg/hgLiftOver/hgLiftOver.c
+++ src/hg/hgLiftOver/hgLiftOver.c
@@ -62,32 +62,32 @@
 {
 char chainS[64];
 safef(chainS, sizeof(chainS), "%s.%s", chain->fromDb, chain->toDb);
 return cloneString(chainS);
 }
 
 void webMain(struct liftOverChain *chain, boolean multiple, boolean keepSettings, int minSizeQ, 
 	     int minChainT, float minBlocks, float minMatch, boolean fudgeThick)
 /* set up page for entering data */
 {
 struct dbDb *dbList;
 char *fromOrg = hOrganism(chain->fromDb), *toOrg = hOrganism(chain->toDb);
 char *chainString = chainStringVal(chain);
 cgiParagraph(
     "This tool converts genome coordinates and annotation files "
-    "between assemblies.  "
-    "The input data can be entered into the text box or uploaded as a file.  "
+    "from the original to the new assembly using an alignment.  "
+    "The input regions can be entered into the text box or uploaded as a file.  "
     "For files over 500Mb, use the command-line tool described in our "
     "<a href=\"../goldenPath/help/hgTracksHelp.html#Liftover\">LiftOver documentation</a>."
     "&nbsp;&nbsp;If a pair of assemblies cannot be selected from the pull-down menus,"
     " a sequential lift may still be possible (e.g., mm9 to mm10 to mm39).&nbsp;&nbsp;"
     "If your desired conversion is still not available, please "
     "<a href=\"../../contacts.html\">contact us</a>."
     "");
 
 /* create HMTL form */
 puts("<FORM ACTION=\"../cgi-bin/hgLiftOver\" METHOD=\"POST\" "
        " ENCTYPE=\"multipart/form-data\" NAME=\"mainForm\">\n");
 cartSaveSession(cart);
 
 /* create HTML table for layout purposes */
 puts("\n<TABLE WIDTH=\"100%\">\n");
@@ -117,91 +117,105 @@
 /* to assembly */
 
 cgiSimpleTableFieldStart();
 dbDbFreeList(&dbList);
 dbList = hGetLiftOverToDatabases(chain->fromDb);
 printLiftOverGenomeList(HGLFT_TOORG_VAR, chain->toDb, dbList, "change", onChange);
 cgiTableFieldEnd();
 
 cgiSimpleTableFieldStart();
 printAllAssemblyListHtmlParm(chain->toDb, dbList, HGLFT_TODB_VAR, TRUE, NULL, NULL);
 cgiTableFieldEnd();
 
 cgiTableRowEnd();
 cgiTableEnd();
 
-cgiParagraph("&nbsp;");
+printf("<br>");
 cgiSimpleTableStart();
 
 cgiSimpleTableRowStart();
 cgiTableField("Minimum ratio of bases that must remap:");
 cgiSimpleTableFieldStart();
 cgiMakeDoubleVar(HGLFT_MINMATCH, (keepSettings) ? minMatch : chain->minMatch,6);
+puts("&nbsp;");
+printInfoIcon("The minimum ratio of basepairs of the input region covered by an alignment. Regions scoring lower than this will not be lifted at all.");
 cgiTableFieldEnd();
 cgiTableRowEnd();
 
 cgiSimpleTableRowStart();
-cgiTableField("&nbsp;");
 cgiTableRowEnd();
 
+
 cgiSimpleTableRowStart();
-cgiTableField("<B>BED 4 to BED 6 Options</B>");
+cgiTableField("<B>Regions defined by chrom:start-end (BED 4 to BED 6)</B>");
 cgiTableRowEnd();
 
 cgiSimpleTableRowStart();
 cgiTableField("Allow multiple output regions:");
 cgiSimpleTableFieldStart();
 cgiMakeCheckBox(HGLFT_MULTIPLE,multiple);
+puts("&nbsp;");
+printInfoIcon("By default, input regions that map to multiple regions will not be lifted at all. When this option is checked, all targets are output.");
 cgiTableFieldEnd();
 cgiTableRowEnd();
 
 cgiSimpleTableRowStart();
 cgiTableField("&nbsp;&nbsp;Minimum hit size in query:");
 cgiSimpleTableFieldStart();
 cgiMakeIntVar(HGLFT_MINSIZEQ,(keepSettings) ? minSizeQ : chain->minSizeQ,4);
+puts("&nbsp;");
+printInfoIcon("In multiple output mode, repeated regions within longer input regions can lead to artefacts. The 'hit size' filter allows to keep only targets with a certain length.");
 cgiTableFieldEnd();
 cgiTableRowEnd();
 
 cgiSimpleTableRowStart();
 cgiTableField("&nbsp;&nbsp;Minimum chain size in target:");
 cgiSimpleTableFieldStart();
 cgiMakeIntVar(HGLFT_MINCHAINT,(keepSettings) ? minChainT : chain->minChainT,4);
+puts("&nbsp;");
+printInfoIcon("In multiple output mode, keeps only targets lifted through alignments of a certain length. At higher phylogenetic distances (e.g. human/mouse), the filters can be useful to keep all copies of the input regions but remove dozens of new small targets introduced by a repeat/transposon within a longer input region.");
 cgiTableFieldEnd();
 cgiTableRowEnd();
 
 cgiSimpleTableRowStart();
-cgiTableField("&nbsp;");
 cgiTableRowEnd();
 
 cgiSimpleTableRowStart();
-cgiTableField("<B>BED 12 Options</B>");
+cgiTableField("<B>Regions with an exon-intron structure (usually transcripts, BED 12)</B>");
 cgiTableRowEnd();
 
 cgiSimpleTableRowStart();
-cgiTableField("Min ratio of alignment blocks or exons that must map:");
+cgiTableField("Minimum ratio of alignment blocks or exons that must map:");
 cgiSimpleTableFieldStart();
 cgiMakeDoubleVar(HGLFT_MINBLOCKS,(keepSettings) ? minBlocks : chain->minBlocks,6);
+puts("&nbsp;");
+printInfoIcon("The minimum ratio of the number of exons (not their bases) covered by the alignment. Transcripts lower than this will not be output at all. If an exon (range thickStart-thickEnd) is not alignable at all, it will be skipped or, if the option below is checked, lifted it to the closest alignable base.");
 cgiTableFieldEnd();
 cgiTableRowEnd();
 
 cgiSimpleTableRowStart();
-cgiTableField("If thickStart/thickEnd is not mapped, use the closest mapped base:");
+cgiTableField("If exon is not mapped, use the closest mapped base:");
 cgiSimpleTableFieldStart();
 cgiMakeCheckBox(HGLFT_FUDGETHICK,(keepSettings) ? fudgeThick : (chain->fudgeThick[0]=='Y'));
+puts("&nbsp;");
+printInfoIcon("If checked, exons that are not covered by an alignment will be lifted to the closest alignable base.");
 cgiTableFieldEnd();
 cgiTableRowEnd();
 
+cgiSimpleTableRowStart();
+cgiTableRowEnd();
+
 cgiTableEnd();
 
 /* text box and two buttons (submit, reset) */
 puts("<p style='margin-left:3px'>Paste in data below, one position per line. You can use the "
         "<a href='../../FAQ/FAQformat.html#format1'>BED format</a> (e.g. \"chr4 100000 100001\", "
         "0-based) or the format of the position box (\"chr4:100,001-100,001\", 1-based). "
         "See the <a href='../goldenPath/help/hgTracksHelp.html#Liftover'>documentation</a>.\n"
         "We do not recommend liftOver for SNPs that have rsIDs. See our "
         "<a href='/FAQ/FAQreleases.html#snpConversion'>FAQ</a> for more information.</p>\n");
 
 cgiSimpleTableStart();
 cgiSimpleTableRowStart();
 
 cgiSimpleTableFieldStart();
 cgiMakeTextArea(HGLFT_USERDATA_VAR, cartCgiUsualString(cart, HGLFT_USERDATA_VAR, NULL), 10, 80);
@@ -242,31 +256,31 @@
                         HGLFT_REFRESHONLY_VAR);
 printf("<input type=\"hidden\" name=\"%s\" value=\"%s\">\n", HGLFT_LAST_CHAIN, chainString);
 
 cartSaveSession(cart);
 puts("</FORM>");
 freeMem(fromOrg);
 freeMem(toOrg);
 }
 
 void webParamsUsed(float minMatch, boolean multiple, int minSizeQ, int minChainT, float minBlocks, boolean fudgeThick)
 {
 webNewSection("Parameters Used");
 cgiSimpleTableStart();
 
 cgiSimpleTableRowStart();
-cgiTableField("Minimum ratio of bases that must remap:");
+cgiTableField("Minimum ratio of bases that must map:");
 cgiSimpleTableFieldStart();
 printf("%.2f",minMatch);
 cgiTableFieldEnd();
 cgiTableRowEnd();
 
 cgiSimpleTableRowStart();
 cgiTableField("&nbsp;");
 cgiTableRowEnd();
 
 cgiSimpleTableRowStart();
 cgiTableField("BED 4 to BED 6 Options");
 cgiTableRowEnd();
 
 cgiSimpleTableRowStart();
 cgiTableField("Allow multiple output regions:");