Changeset 5765


Ignore:
Timestamp:
Nov 29, 2019, 2:30:45 PM (3 years ago)
Author:
Nicklas Nordborg
Message:

References #1208: Implement wizard for building database of variant frequencies in SCAN-B samples

Started with the code for submitting the statistics script to the cluster. The framework is ready and it will submit an empty script that doesn't do anything.

Location:
extensions/net.sf.basedb.reggie/trunk
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/resources/analysis/vcall_build.js

    r5764 r5765  
    178178     
    179179    var submitInfo = {};
    180     submitInfo.itemList = parseInt(frm.itemList.id);
     180    submitInfo.itemList = parseInt(frm.itemList.value);
    181181    submitInfo.cluster = frm.clusters.value;
    182182    if (frm.priority.selectedIndex >= 0)
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/VariantCallingServlet.java

    r5764 r5765  
    5656import net.sf.basedb.reggie.grid.ScriptUtil;
    5757import net.sf.basedb.reggie.grid.VariantCallingJobCreator;
     58import net.sf.basedb.reggie.grid.VariantStatisticsJobCreator;
    5859import net.sf.basedb.reggie.query.AnyToAnyRestriction;
    5960import net.sf.basedb.reggie.vcf.SnpData;
     
    509510          }
    510511        }
     512      }
     513      else if ("BuildVariantStatistics".equals(cmd))
     514      {
     515        dc = sc.newDbControl();
     516
     517        ReggieRole.checkPermission(dc, "'" + cmd + "' wizard", ReggieRole.ADMINISTRATOR);
     518
     519        JSONObject jsonReq = JsonUtil.parseRequest(req);
     520     
     521        Number listId = (Number)jsonReq.get("itemList");
     522        String clusterId = (String)jsonReq.get("cluster");
     523        boolean debug = Boolean.TRUE.equals(jsonReq.get("debug"));
     524        Number priority = (Number)jsonReq.get("priority");
     525
     526        OpenGridCluster cluster = OpenGridService.getInstance().getClusterById(dc, clusterId);
     527        if (cluster == null)
     528        {
     529          throw new ItemNotFoundException("OpenGridCluster[" + clusterId + "]");
     530        }
     531       
     532        ItemList list = ItemList.getById(dc, listId.intValue());
     533       
     534        VariantStatisticsJobCreator jobCreator = new VariantStatisticsJobCreator();
     535        jobCreator.setDebug(debug);
     536        jobCreator.setPriority(priority == null ? null : priority.intValue());
     537
     538        Job statJob = jobCreator.createVariantStatisticsJob(dc, cluster, list);
     539        if (statJob.getStatus() == Job.Status.ERROR)
     540        {
     541          jsonMessages.add("[Error]Job submission for '" + statJob.getName() + "' failed: " + statJob.getStatusMessage());
     542        }
     543        else
     544        {
     545          jsonMessages.add("Submitted variant statistics job to " + cluster.getConnectionInfo().getName() + " with id " + statJob.getExternalId());
     546        }
     547        dc.commit();
     548
    511549      }
    512550
Note: See TracChangeset for help on using the changeset viewer.