0781f49ccdacd52dd75b0f12dab183e4b4cd25fc
hiram
  Tue Mar 21 15:04:48 2023 -0700
extend the chromAlias function to the getSequence operation refs #30544

diff --git src/hg/hubApi/tests/makefile src/hg/hubApi/tests/makefile
index 1778251..9658baa 100644
--- src/hg/hubApi/tests/makefile
+++ src/hg/hubApi/tests/makefile
@@ -969,63 +969,78 @@
 ##############################################################################
 ### search - test search function
 ##############################################################################
 
 # basic search just to see if it works:
 search01: setOutput
 	@ printf "### $@ 'https://${SERVERNAME}/search/?search=brca;genome=hg38'\n"
 	@ curl -L "${SERVERNAME}/search?search=brca;genome=hg38" 2> /dev/null | python -mjson.tool | egrep -c -n "\[|\]" | awk -v t="$@" '{if (($$1 < 25) || ($$1 > 35)) {printf "test %s failed, count %d not in range 25-35\n", t, $$1; exit 255;}}'
 
 ##############################################################################
 ### chrAlias - test chrom alias
 ##############################################################################
 
 # testing /getData/track?genome=ce11&track=gold&chrom=MT
 chrAlias01: setOutput
-	@ printf "### $@ 'https://${SERVERNAME}/getData/track?genome=ce11;track=gold;chrom=MT'\n"
+	@ printf "### $@ '${SERVERNAME}/getData/track?genome=ce11;track=gold;chrom=MT'\n"
 	@./jsonConsumer.pl -serverName="${SERVERNAME}" -endpoint="/getData/track" -genome="ce11" -track="gold" -chrom="MT" 2>&1 | egrep -v "${excludeLines}"  | sed -e 's#https://.*/getData#/getData#;' | gzip -c > testOutput/$@.gz
 	@zdiff expected/$@.gz testOutput/$@.gz
 
 # testing /getData/track?genome=ce11&track=gold&chrom=NC_001328.1
 chrAlias02: setOutput
-	@ printf "### $@ 'https://${SERVERNAME}/getData/track?genome=ce11;track=gold;chrom=NC_001328.1'\n"
+	@ printf "### $@ '${SERVERNAME}/getData/track?genome=ce11;track=gold;chrom=NC_001328.1'\n"
 	@./jsonConsumer.pl -serverName="${SERVERNAME}" -endpoint="/getData/track" -genome="ce11" -track="gold" -chrom="NC_001328.1" 2>&1 | egrep -v "${excludeLines}" | sed -e 's#https://.*/getData#/getData#;' | gzip -c > testOutput/$@.gz
 	@zdiff expected/$@.gz testOutput/$@.gz
 
 # testing /getData/track?genome=ce11&track=gold&chrom=X54252.1
 chrAlias03: setOutput
-	@ printf "### $@ 'https://${SERVERNAME}/getData/track?genome=ce11;track=gold;chrom=X54252.1'\n"
+	@ printf "### $@ '${SERVERNAME}/getData/track?genome=ce11;track=gold;chrom=X54252.1'\n"
 	@./jsonConsumer.pl -serverName="${SERVERNAME}" -endpoint="/getData/track" -genome="ce11" -track="gold" -chrom="X54252.1" 2>&1 | egrep -v "${excludeLines}" | sed -e 's#https://.*/getData#/getData#;' | gzip -c > testOutput/$@.gz
 	@zdiff expected/$@.gz testOutput/$@.gz
 
 # testing /getData/track?genome=ce11&track=gold&chrom=MtDNA
 chrAlias04: setOutput
-	@ printf "### $@ 'https://${SERVERNAME}/getData/track?genome=ce11;track=gold;chrom=MtDNA'\n"
+	@ printf "### $@ '${SERVERNAME}/getData/track?genome=ce11;track=gold;chrom=MtDNA'\n"
 	@./jsonConsumer.pl -serverName="${SERVERNAME}" -endpoint="/getData/track" -genome="ce11" -track="gold" -chrom="MtDNA" 2>&1 | egrep -v "${excludeLines}" | sed -e 's#https://.*/getData#/getData#;' | gzip -c > testOutput/$@.gz
 	@zdiff expected/$@.gz testOutput/$@.gz
 
 # chrom alias on an assembly hub
 chrAlias05: setOutput
-	@ printf "### $@ 'https://${SERVERNAME}/getData/track?genome=GCF_000001735.4;track=assembly;chrom=chrPltd;hubUrl=https://hgdownload.soe.ucsc.edu/hubs/GCF/000/001/735/GCF_000001735.4/hub.txt'\n"
+	@ printf "### $@ '${SERVERNAME}/getData/track?genome=GCF_000001735.4;track=assembly;chrom=chrPltd;hubUrl=https://hgdownload.soe.ucsc.edu/hubs/GCF/000/001/735/GCF_000001735.4/hub.txt'\n"
 	@./jsonConsumer.pl -serverName="${SERVERNAME}" -endpoint="/getData/track" -hubUrl="https://hgdownload.soe.ucsc.edu/hubs/GCF/000/001/735/GCF_000001735.4/hub.txt" -genome="GCF_000001735.4" -track="assembly" -chrom="chrPltd" 2>&1 | egrep -v "${excludeLines}" | sed -e 's#https://.*/getData#/getData#;' | gzip -c > testOutput/$@.gz
 	@zdiff expected/$@.gz testOutput/$@.gz
 
 # chrom alias on an assembly hub
 chrAlias06: setOutput
+	@ printf "### $@ '${SERVERNAME}/getData/track?genome=GCF_000001735.4;track=assembly;chrom=Pltd;hubUrl=https://hgdownload.soe.ucsc.edu/hubs/GCF/000/001/735/GCF_000001735.4/hub.txt'\n"
 	@./jsonConsumer.pl -serverName="${SERVERNAME}" -endpoint="/getData/track" -hubUrl="https://hgdownload.soe.ucsc.edu/hubs/GCF/000/001/735/GCF_000001735.4/hub.txt" -genome="GCF_000001735.4" -track="assembly" -chrom="Pltd" | egrep -v "${excludeLines}" | gzip -c > testOutput/$@.gz
 	@zdiff expected/$@.gz testOutput/$@.gz
 
+# testing /getData/sequence? hubUrl genome=GCF_000001735.4&chrom=Pltd&start=4321&end=5647
+# Pltd
+chrAlias07: setOutput
+	@ printf "### $@ '${SERVERNAME}/getData/sequence?genome=GCF_000001735.4;chrom=Pltd;start=4321;end=5678;hubUrl=https://hgdownload.soe.ucsc.edu/hubs/GCF/000/001/735/GCF_000001735.4/hub.txt'\n"
+	@./jsonConsumer.pl -serverName="${SERVERNAME}" -endpoint="/getData/sequence" -hubUrl="https://hgdownload.soe.ucsc.edu/hubs/GCF/000/001/735/GCF_000001735.4/hub.txt" -genome="GCF_000001735.4" -chrom="Pltd" -start=4321 -end=5678 2>&1 | egrep -v "${excludeLines}" | sed -e 's#https://.*/sequence#/sequence#;' | gzip -c > testOutput/$@.gz
+	@zdiff expected/$@.gz testOutput/$@.gz
+
+# testing /getData/sequence? genome=hg19&chrom=MT&start=4321&end=5647
+# Pltd
+chrAlias08: setOutput
+	@ printf "### $@ '${SERVERNAME}/getData/sequence?genome=hg19;chrom=MT;start=4321;end=5678'\n"
+	@./jsonConsumer.pl -serverName="${SERVERNAME}" -endpoint="/getData/sequence" -genome="hg19" -chrom="MT" -start=4321 -end=5678 2>&1 | egrep -v "${excludeLines}" | sed -e 's#https://.*/sequence#/sequence#;' | gzip -c > testOutput/$@.gz
+	@zdiff expected/$@.gz testOutput/$@.gz
+
 ##############################################################################
 ### supportedTypes - test both /list/chromosomes and /getData/track
 ###                - for each type
 ##############################################################################
 
 altGraphX: setOutput
 	@printf "### $@ '${SERVERNAME}/list/chromosomes?track=sibTxGraph;genome=hg19'\n"
 	@./jsonConsumer.pl -serverName="${SERVERNAME}" -endpoint="/list/chromosomes" -genome="hg19" -track="sibTxGraph" 2>&1 | egrep -v "${excludeLines}" | sed -e 's#https://.*/list#/list#;' | gzip -c > testOutput/$@.gz
 	@printf "### $@ 'https://hgwdev-hiram.gi.ucsc.edu/getData/track?track=sibTxGraph;chrom=chr1;genome=hg19;jsonOutputArrays=1;maxItemsOutput=5'\n"
 	@./jsonConsumer.pl -serverName="${SERVERNAME}" -endpoint="/getData/track" -genome="hg19" -track="sibTxGraph" -chrom="chr1" -jsonOutputArrays -maxItemsOutput=5 2>&1 | egrep -v "${excludeLines}" | sed -e 's#https://.*/getData#/getData#;' | gzip -c >> testOutput/$@.gz
 	@zdiff expected/$@.gz testOutput/$@.gz
 
 barChart: setOutput
 	@printf "### $@ '${SERVERNAME}/list/chromosomes?track=gtexBrain;genome=hg38'\n"
 	@./jsonConsumer.pl -serverName="${SERVERNAME}" -endpoint="/list/chromosomes" -genome="hg38" -track="gtexBrain" 2>&1 | egrep -v "${excludeLines}" | sed -e 's#https://.*/list#/list#;' | gzip -c > testOutput/$@.gz