25149d3a1dafdf85838536e178b5e66515f8736b hiram Thu Oct 10 14:08:11 2019 -0700 testing newly supported type wigMaf refs #23589 diff --git src/hg/hubApi/tests/makefile src/hg/hubApi/tests/makefile index c20f73a..800fc33 100644 --- src/hg/hubApi/tests/makefile +++ src/hg/hubApi/tests/makefile @@ -1,29 +1,30 @@ test:: all all:: test0 listFunctions getFunctions listSchema getSequence wigData \ supportedTypes errorTests notSupported bugReports listFunctions: list01 list02 list03 list04 list05 list06 list07 list08 list09 \ - list10 list11 list12 list13 list14 list15 list16 + list10 list11 list12 list13 list14 list15 list16 list17 list18 getFunctions: test8 test9 test10 test11 test12 test13 test14 \ test15 test16 test19 test21 test26 test27 test28 \ - test29 test39 test40 + test29 test39 test40 test41 test42 test43 test44 -listSchema: schema01 schema02 schema03 schema04 schema05 schema06 schema07 +listSchema: schema01 schema02 schema03 schema04 schema05 schema06 schema07 \ + schema08 getSequence: getSeq01 getSeq02 getSeq03 getSeq04 getSeq05 wigData: wig01 wig02 wig03 wig04 wig05 wig06 wig07 wig08 wig09 wig10 \ wig11 wig12 wig13 wig14 wig15 wig16 wig17 wig18 wig19 wig20 \ wig21 wig22 wig23 wig24 supportedTypes: altGraphX barChart chain ctgPos expRatio \ interact netAlign peptideMapping pgSnp supportedTypes0: altGraphX barChart chain ctgPos expRatio factorSource gvf \ interact netAlign peptideMapping pgSnp errorTests: err01 err02 err03 err04 err05 err06 err07 err08 err09 err10 \ err11 err12 err13 err14 err15 err16 err17 err18 err19 err20 \ @@ -148,37 +149,42 @@ # testing /list/chromosomes?genome=ce4&track=est different chrom name column # and ce4 has split tables list15: setOutput @printf "### $@ 'https://hgwdev-hiram.gi.ucsc.edu/cgi-bin/hubApi/list/chromosomes?track=est;genome=ce4'\n" @./jsonConsumer.pl -endpoint="/list/chromosomes" -genome="ce4" -track="est" 2>&1 | egrep -v "${excludeLines}" | sed -e 's#https://.*/list#/list#;' | gzip -c > testOutput/$@.gz @zdiff expected/$@.gz testOutput/$@.gz # list chromosomes for a track that only has a bigDataUrl specification, # no database table # testing /list/chromosomes?genome=equCab3&track=transMapEnsemblV5 list16: setOutput @printf "### $@ 'https://api-test.gi.ucsc.edu/list/chromosomes?track=transMapEnsemblV5;genome=equCab3'\n" @./jsonConsumer.pl -endpoint="/list/chromosomes" -genome="equCab3" -track="transMapEnsemblV5" 2>&1 | egrep -v "${excludeLines}" | sed -e 's#https://.*/list#/list#;' | gzip -c > testOutput/$@.gz @zdiff expected/$@.gz testOutput/$@.gz -# ./hubApi track=gc5BaseBw genome=rheMac10 - +# list chromosomes for a bigWig track=gc5BaseBw genome=rheMac10 list17: setOutput @printf "### $@ 'https://api-test.gi.ucsc.edu/list/chromosomes?track=gc5BaseBw;genome=rheMac10'\n" @./jsonConsumer.pl -endpoint="/list/chromosomes" -genome="rheMac10" -track="gc5BaseBw" 2>&1 | egrep -v "${excludeLines}" | sed -e 's#https://.*/list#/list#;' | gzip -c > testOutput/$@.gz @zdiff expected/$@.gz testOutput/$@.gz +# list chromosomes for a wigMaf table track=multiz7way genome=hg38 +list18: setOutput + @printf "### $@ 'https://api-test.gi.ucsc.edu/list/chromosomes?track=multiz7way;genome=hg38'\n" + @./jsonConsumer.pl -endpoint="/list/chromosomes" -genome="hg38" -track="multiz7way" 2>&1 | egrep -v "${excludeLines}" | sed -e 's#https://.*/list#/list#;' | gzip -c > testOutput/$@.gz + @zdiff expected/$@.gz testOutput/$@.gz + ########################## getData functions ############################# # testing /getData/track?genome=ce11&track=gold test8: setOutput @./jsonConsumer.pl -maxItemsOutput=123 -endpoint="/getData/track" -genome="ce11" -track="gold" | egrep -v "${excludeLines}" | gzip -c > testOutput/$@.gz @zdiff expected/$@.gz testOutput/$@.gz # testing /getData/track?genome=ce11&track=gold&chrom=chrM test9: setOutput @./jsonConsumer.pl -endpoint="/getData/track" -genome="ce11" -track="gold" -chrom="chrM" | egrep -v "${excludeLines}" | gzip -c > testOutput/$@.gz @zdiff expected/$@.gz testOutput/$@.gz # testing /getData/track?genome=ce11&track=gold&chrom=chrI&start=1&end=1024 test10: setOutput @./jsonConsumer.pl -endpoint="/getData/track" -genome="ce11" -track="gold" -chrom="chrI" -start=1 -end=1024 | egrep -v "${excludeLines}" | gzip -c > testOutput/$@.gz @zdiff expected/$@.gz testOutput/$@.gz @@ -255,30 +261,48 @@ @./jsonConsumer.pl -maxItemsOutput=123 -endpoint="/getData/track" -genome="ce4" -track="gold" | egrep -v "${excludeLines}" | gzip -c > testOutput/$@.gz @zdiff expected/$@.gz testOutput/$@.gz # testing /getData/track?genome=ce4&track=gold for split table operation # plus jsonArrayOutput test40: setOutput @./jsonConsumer.pl -jsonOutputArrays -maxItemsOutput=123 -endpoint="/getData/track" -genome="ce4" -track="gold" | egrep -v "${excludeLines}" | gzip -c > testOutput/$@.gz @zdiff expected/$@.gz testOutput/$@.gz # bigDataUrl for bigGenePred track with no table, only trackDb test41: setOutput @printf "### $@ ### 'https://apibeta.soe.ucsc.edu/getData/track?track=mane;genome=hg38;jsonOutputArrays=1;maxItemsOutput=5'\n" @./jsonConsumer.pl -endpoint="/getData/track" -genome=hg38 -track=mane -maxItemsOutput=5 -jsonOutputArrays | egrep -v "${excludeLines}" | gzip -c > testOutput/$@.gz @zdiff expected/$@.gz testOutput/$@.gz +# get data from wigMaf database table +test42: setOutput + @printf "### $@ ### 'https://api-test.gi.soe.ucsc.edu/getData/track?track=multiz7way;genome=hg38;jsonOutputArrays=1;maxItemsOutput=5'\n" + @./jsonConsumer.pl -endpoint="/getData/track" -genome=hg38 -track=multiz7way -maxItemsOutput=5 -jsonOutputArrays | egrep -v "${excludeLines}" | gzip -c > testOutput/$@.gz + @zdiff expected/$@.gz testOutput/$@.gz + +# get data from wigMaf database table with chrom specified +test43: setOutput + @printf "### $@ ### 'https://api-test.gi.soe.ucsc.edu/getData/track?track=multiz7way;genome=hg38;jsonOutputArrays=1;maxItemsOutput=5;chrom=chr22'\n" + @./jsonConsumer.pl -endpoint="/getData/track" -genome=hg38 -track=multiz7way -maxItemsOutput=5 -jsonOutputArrays -chrom=chr22 | egrep -v "${excludeLines}" | gzip -c > testOutput/$@.gz + @zdiff expected/$@.gz testOutput/$@.gz + +# get data from wigMaf database table with chrom and start,end specified +test44: setOutput + @printf "### $@ ### 'https://api-test.gi.soe.ucsc.edu/getData/track?track=multiz7way;genome=hg38;jsonOutputArrays=1;maxItemsOutput=5;chrom=chr21;start=20000000;end=30000000'\n" + @./jsonConsumer.pl -endpoint="/getData/track" -genome=hg38 -track=multiz7way -maxItemsOutput=5 -jsonOutputArrays -chrom=chr21 -start=20000000 -end=30000000 | egrep -v "${excludeLines}" | gzip -c > testOutput/$@.gz + @zdiff expected/$@.gz testOutput/$@.gz + ############################################################################### # /getData/sequence testing ############################################################################### # testing /getData/sequence? hubUrl genome=hg19&chrom=chrCp&start=4321&end=5647 getSeq01: setOutput @printf "### $@ " @./jsonConsumer.pl -endpoint="/getData/sequence" -hubUrl="http://genome-test.gi.ucsc.edu/~hiram/hubs/Plants/hub.txt" -genome="araTha1" -chrom="chrCp" -start=4321 -end=5678 | egrep -v "${excludeLines}" | gzip -c > testOutput/$@.gz @zdiff expected/$@.gz testOutput/$@.gz # testing /getData/sequence? hubUrl Bejerano genome=hg19&chrom=chrM&start=4321&end=5647 getSeq02: setOutput @printf "### $@ " @./jsonConsumer.pl -endpoint="/getData/sequence" -hubUrl="http://genome-test.gi.ucsc.edu/~hiram/hubs/GillBejerano/hub.txt" -genome="hg19" -chrom="chrM" -start=4321 -end=5678 | egrep -v "${excludeLines}" | gzip -c > testOutput/$@.gz @zdiff expected/$@.gz testOutput/$@.gz @@ -329,30 +353,36 @@ @./jsonConsumer.pl -endpoint="/list/schema" -genome="hg38" -track=chromAlias | egrep -v "${excludeLines}" | gzip -c > testOutput/$@.gz @zdiff expected/$@.gz testOutput/$@.gz # list schema for bigBed file via table fileName reference schema06: setOutput @printf "### $@ 'https://hgwdev-hiram.gi.ucsc.edu/list/schema?track=crispr10KTargets;genome=hg38'\n" @./jsonConsumer.pl -endpoint="/list/schema" -genome="hg38" -track=crispr10KTargets | egrep -v "${excludeLines}" | gzip -c > testOutput/$@.gz @zdiff expected/$@.gz testOutput/$@.gz # list schema for bigWig file with table and bigWig file schema07: setOutput @printf "### $@ 'https://hgwdev-hiram.gi.ucsc.edu/list/schema?track=gc5BaseBw;genome=ce11'\n" @./jsonConsumer.pl -endpoint="/list/schema" -genome="ce11" -track=gc5BaseBw | egrep -v "${excludeLines}" | gzip -c > testOutput/$@.gz @zdiff expected/$@.gz testOutput/$@.gz +# list schema for wigMaf table type +schema08: setOutput + @printf "### $@ 'https://api-test.gi.ucsc.edu/list/schema?track=multiz7way;genome=hg38'\n" + @./jsonConsumer.pl -endpoint="/list/schema" -genome="hg38" -track=multiz7way | egrep -v "${excludeLines}" | gzip -c > testOutput/$@.gz + @zdiff expected/$@.gz testOutput/$@.gz + ############################################################################### # ERROR testing ############################################################################### # generate an error: ask for non-existent chrom in a track hub # /getData/track? hubUrl Plants &track=assembly&chrom=chrI&start=1&end=14309681 err01: setOutput @printf "### $@ https://hgwdev-api.gi.ucsc.edu/getData/track?track=assembly;chrom=chrI;genome=araTha1;hubUrl=http://genome-test.gi.ucsc.edu/~hiram/hubs/Plants/hub.txt;end=14309681;start=1\n" @./jsonConsumer.pl -endpoint="/getData/track" -hubUrl="http://genome-test.gi.ucsc.edu/~hiram/hubs/Plants/hub.txt" -genome="araTha1" -track="assembly" -chrom="chrI" -start=1 -end=14309681 2>&1 | sed -e 's#https://.*/getData#/getData#;' | egrep -v "${excludeLines}" | gzip -c > testOutput/$@.gz @zdiff expected/$@.gz testOutput/$@.gz # error test, can not open bigWig file err02: setOutput @printf "### $@ https://hgwdev-api.gi.ucsc.edu/getData/track?track=gc5Base;chrom=chrA9;genome=braRap1;hubUrl=http://genome-test.gi.ucsc.edu/~hiram/hubs/bPlants/hub.txt\n" @./jsonConsumer.pl -endpoint="/getData/track" -hubUrl="http://genome-test.gi.ucsc.edu/~hiram/hubs/bPlants/hub.txt" -genome="braRap1" -track="gc5Base" -chrom=chrA9 2>&1 | egrep -v "${excludeLines}" | sed -e 's#https://.*/getData#/getData#;' | gzip -c > testOutput/$@.gz @zdiff expected/$@.gz testOutput/$@.gz