3030 <!-- <script src="static/saveVIP.js"></script> -->
3131 <!-- for testing the VIP -->
3232 < script src ="https://interactivereport.github.io/cellxgene_VIP/static/testVIP.js "> </ script >
33- <!-- <script src="static/testVIP /testVIP.js"></script> -->
33+ <!-- <script src="static/testVIP.js"></script> -->
3434 <!-- end -->
3535 < style >
3636 .dropup ,
499499 < button class ="tablinks " onclick ="ABBRall() "> Check All Annotations</ button >
500500 < button class ="tablinks " onclick ="selFun(event, 'BRUSH'); "> Brush</ button >
501501 < button class ="tablinks " onclick ="sync(); "> Sync</ button >
502- < button id ="VIPtestBT " class ="tablinks " onclick ="selFun(event, 'tVIP');testVIP('tVIP'); "> Test</ button >
502+ < button id ="VIPtestBT " class ="tablinks " onclick ="selFun(event, 'tVIP') "> Test</ button >
503503 </ div >
504504 </ div >
505505 < div id ="separator " > </ div >
506506 < div id ="panel-right " >
507507
508- < input id ="loadfile " type ="file " onchange ="load() " style ="display:none " files =" static/testVIP/info.txt " />
508+ < input id ="loadfile " type ="file " onchange ="load() " style ="display:none "/>
509509 < div id ="ABBR " class ="tabcontent "> <!-- Abbreviation -->
510510 < h3 > Create a combinatorial annotation</ h3 >
511511 < ol type ="1 ">
@@ -1201,10 +1201,10 @@ <h3>Interactive stacked barplot of cell distribution of selected cells over two
12011201 </ div >
12021202 < p > Annotations:</ p > < p id ="STACBARgrp "> </ p >
12031203 < p > Color by < select id ="STACBARcol "> </ select > </ p >
1204- < p > Figure width: < input id ="STACBARwidth " type ="number " step ="50 " value ="800 "/> , height: < input id ="STACBARheight " type ="number " step ="40 " value ="480 "/> </ p >
1204+ < p > Figure width: < input id ="STACBARwidth " type ="number " step ="50 " value ="800 "/> , height: < input id ="STACBARheight " type ="number " step ="40 " value ="480 "/> </ p >
12051205 < p > x-Axis font size: < input id ="STACBARxfontsize " type ="number " step ="2 " value ="16 "/> ,
12061206 label rotate: < input id ="STACBARxlabelrotate " type ="number " step ="5 " value ="-60 "/> ,
1207- label shift: < input id ="STACBARxlabelshift " type ="number " step ="2 " value ="-24 "/> </ p >
1207+ label shift: < input id ="STACBARxlabelshift " type ="number " step ="2 " value ="-24 "/> </ p >
12081208 </ div >
12091209
12101210
@@ -1333,7 +1333,32 @@ <h3>Brushed ranges</h3>
13331333 < div id ="CLIresize " style ="height: 'auto'; width: 'auto'; padding: 0.5em; "> </ div >
13341334 </ div > <!--CLI-->
13351335
1336- < div id ="tVIP " class ="tabcontent "> </ div >
1336+ < div id ="tVIP " class ="tabcontent ">
1337+ < h3 > Test the VIP functionality</ h3 >
1338+ < p > < button id ="tVIPtest " class ="tVIPbt " onclick ="testVIP('tVIPnote') "> < b > Test by the latest case</ b > </ button > </ p >
1339+ < fieldset >
1340+ < legend > Create a test case</ legend >
1341+ < p > by: < select id ="tVIPgrp "> </ select > </ p >
1342+ < p > < button class ="tVIPbt tVIPbtA " onclick ="tVIPcreate('random','tVIPnote') "> Create</ button > < br >
1343+ The prcess will< br >
1344+ 1. Split the annotations of selected category into two groups randomly;< br >
1345+ 2. Select 500 cells from each group;< br >
1346+ 3. Apply DEG for those two groups of cells;< br >
1347+ 4. Select top DEGs randomly in to groups;< br >
1348+ 5. Choose user selections in VIP randomly;< br >
1349+ 6. Perform plotting function one by one;< br >
1350+ 7. Save the test case on the server for future use (overwrite preivous).
1351+ </ p >
1352+ < p > < button class ="tVIPbt tVIPbtA " onclick ="tVIPcreate('cells','tVIPnote') "> Create on selected cells</ button > < br >
1353+ The test generation will ignore the first 2 steps in the above process, and run all the rest.
1354+ </ p >
1355+ < p > < button class ="tVIPbt tVIPbtA " onclick ="tVIPcreate('selections','tVIPnote') "> Create on selections</ button > < br >
1356+ The user have selected all options on VIP including the genes and gene sets (or loaded previous session).
1357+ This process will process all VIP plots one by one and save it as a test case on the server (overwrite preivous).
1358+ </ p >
1359+ </ fieldset >
1360+ < div id ="tVIPnote "> </ div >
1361+ </ div >
13371362 </ div >
13381363
13391364</ div >
@@ -1603,9 +1628,14 @@ <h3>Brushed ranges</h3>
16031628 data:JSON.stringify({'method':"testVIPready",'dataset': window.store.getState().config.displayNames.dataset+'.h5ad'}),
16041629 contentType: 'application/json;charset=UTF-8',
16051630 success: function(res){
1631+ $("#tVIPtest").prop('disabled',true);
16061632 if(res == "TRUE"){
16071633 $("#VIPtestBT").show();
16081634 }
1635+ if(res == "SHOW"){
1636+ $("#tVIPtest").prop('disabled',false);
1637+ $("#VIPtestBT").show();
1638+ }
16091639 },
16101640 error: function(request,status,error){
16111641 console.log(request.status+': cannot get VIP test information ...');
@@ -1662,6 +1692,7 @@ <h3>Brushed ranges</h3>
16621692 var densS = document.getElementById("DENSsplit");
16631693 var densG = document.getElementById("DENSgrp");
16641694 var embed = document.getElementById("EMBEDsplit");
1695+ var tVIP = document.getElementById("tVIPgrp");
16651696
16661697 for(const one of grps){
16671698 if (one.startsWith("> ")) continue;
@@ -1676,6 +1707,7 @@ <h3>Brushed ranges</h3>
16761707 densS.add(createOpt(one));
16771708 densG.add(createOpt(one));
16781709 embed.add(createOpt(one));
1710+ tVIP.add(createOpt(one));
16791711 }
16801712 densS.add(createOpt('None'));
16811713 densG.add(createOpt('None'));
@@ -1854,6 +1886,9 @@ <h3>Brushed ranges</h3>
18541886 CLIref();
18551887 preDEGVolcanoref("preDEGvolcano");
18561888 preDEGmultiref();
1889+ if(window.store.getState().colors.colorAccessor != null){
1890+ $('#tVIPgrp').val(window.store.getState().colors.colorAccessor);
1891+ }
18571892}
18581893function ABBRref(){
18591894}
@@ -4476,6 +4511,19 @@ <h3>Brushed ranges</h3>
44764511 numberLoad(content['number']);
44774512 sortableLoad(content['sortable']);
44784513}
4514+ // test the VIP
4515+ function tVIPcreate(act,eID){
4516+ $(".tVIPbt").prop('disabled',true);
4517+ $("#"+eID).html("");
4518+
4519+ if(act=='random'){
4520+ createTest($("#tVIPgrp").val(),'tVIPnote');
4521+ }else if(act=='cells'){
4522+ randomInitDEG($("#tVIPgrp").val(),'tVIPnote');
4523+ }else if(act=='selections'){
4524+ randomPlot('tVIPnote');
4525+ }
4526+ }
44794527// ignore global definition for stackedBar legend circle
44804528function GetStyle(CLASSname){
44814529 var styleSheets = document.styleSheets;
0 commit comments