Skip to content

Commit

Permalink
Small bugfixes to mGAP release
Browse files Browse the repository at this point in the history
  • Loading branch information
bbimber committed Feb 1, 2025
1 parent 036af5f commit 1dd37ca
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 47 deletions.
4 changes: 1 addition & 3 deletions mGAP/resources/views/mgapDataDashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
header: 'Upcoming Release',
items: [{
name: 'Release Instructions',
url: LABKEY.ActionURL.buildURL('query', 'executeQuery.view', null, {
schemaName: 'wiki',
queryName: 'page',
url: LABKEY.ActionURL.buildURL('wiki', 'page.view', null, {
name: 'mgapRelease'
})
},{
Expand Down
14 changes: 12 additions & 2 deletions mGAP/resources/web/mGAP/window/ReleaseWindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Ext4.define('mGAP.window.ReleaseWindow', {
Ext4.Msg.hide();
var outputFiles = [];
var distinctGenomesBySpecies = {};
var distinctGenomes = [];
Ext4.Array.forEach(results.rows, function(r){
if (!r.vcfId) {
Ext4.Msg.alert('Error', 'Track lacks VCF ID: ' + r.trackName);
Expand All @@ -34,20 +35,29 @@ Ext4.define('mGAP.window.ReleaseWindow', {
distinctGenomesBySpecies[r.species] = distinctGenomesBySpecies[r.species] || [];
if (r['vcfId/library_id']) {
distinctGenomesBySpecies[r.species].push(r['vcfId/library_id']);
distinctGenomes.push(r['vcfId/library_id']);
}
}, this);

distinctGenomes = Ext4.unique(distinctGenomes)

if (!outputFiles.length){
Ext4.Msg.alert('Error', 'None of the tracks have VCF files');
return;
}

for (sn in Ext4.Object.getKeys(distinctGenomesBySpecies)) {
var hadError = false;
Ext4.Array.forEach(Ext4.Object.getKeys(distinctGenomesBySpecies), function(sn) {
var genomes = Ext4.Array.unique(distinctGenomesBySpecies[sn]);
if (genomes.length !== 1){
Ext4.Msg.alert('Error', 'All files must use the same genome. Genomes found for species ' + sn + ': ' + genomes.length);
return;
hadError = true;
return false;
}
}, this);

if (hadError) {
return;
}

LABKEY.Ajax.request({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public class mGapReleaseGenerator extends AbstractParameterizedOutputHandler<Seq
public mGapReleaseGenerator()
{
super(ModuleLoader.getInstance().getModule(mGAPModule.class), "Create mGAP Release", "This will prepare an input VCF for use as an mGAP public release. This will optionally include: removing excess annotations and program records, limiting to SNVs (optional) and removing genotype data (optional). If genotypes are retained, the subject names will be checked for mGAP aliases and replaced as needed.", new LinkedHashSet<>(PageFlowUtil.set("sequenceanalysis/field/GenomeFileSelectorField.js")), Arrays.asList(
ToolParameterDescriptor.create("species", "Version", "The species, which is used to filter tracks", "ldk-simplelabkeycombo", new JSONObject(){{
ToolParameterDescriptor.create("species", "Species", "The species, which is used to filter tracks", "ldk-simplelabkeycombo", new JSONObject(){{
put("allowBlank", false);
put("doNotIncludeInTemplates", true);
put("width", 400);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ public List<ToolParameterDescriptor> getParams()
put("minValue", 512);
}}, 1028),
ToolParameterDescriptor.create("localSSD", "Request Nodes With SSD Scratch", "If selected, -C ssdscratch will be added to the submit script, which limits to node with faster SSD scratch space. This might be important for I/O intense jobs.", "checkbox", null, null),
ToolParameterDescriptor.create("useLustre", "Use Old Lustre Working Space", "If selected, this job will use the older Lustre working space.", "checkbox", null, null),
ToolParameterDescriptor.create("requireInfiniband", "Require InfiniBand", "If selected, this job will be flagged as -C IB to force the node to have InfiniBand.", "checkbox", null, null),
ToolParameterDescriptor.create("gpus", "GPUs", "The number of GPUs requested for this job. If non-zero, the gpu partition will be used.", "ldk-integerfield", null, null)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,6 @@ public void addExtraSubmitScriptLines(PipelineJob job, RemoteExecutionEngine eng
possiblyAddSSD(job, engine, lines);
possiblyAddGpus(job, engine, lines);
possiblyAddExclusive(job, engine, lines);
possiblyAddInfiniband(job, engine, lines);
}
}

Expand All @@ -319,11 +318,6 @@ public void addExtraSubmitScriptLines(PipelineJob job, RemoteExecutionEngine eng
{
Map<String, Object> ret = new HashMap<>();

if (job instanceof HasJobParams && getUseLustreValue((HasJobParams)job))
{
job.getLogger().info("Requiring using original lustre as working space");
ret.put("USE_LUSTRE", "1");
}

return ret;
}
Expand Down Expand Up @@ -482,39 +476,6 @@ private void possiblyAddSSD(PipelineJob job, RemoteExecutionEngine engine, List<
}
}

private void possiblyAddInfiniband(PipelineJob job, RemoteExecutionEngine engine, List<String> lines)
{
Map<String, String> params = ((HasJobParams)job).getJobParams();
String val = StringUtils.trimToNull(params.get("resourceSettings.resourceSettings.requireInfiniband"));
if (val == null)
{
return;
}

boolean parsed = Boolean.parseBoolean(val);
if (parsed)
{
job.getLogger().info("Requiring node with infiniband");
String line = "#SBATCH -C IB";
if (!lines.contains(line))
{
lines.add(line);
}
}
}

private boolean getUseLustreValue(HasJobParams job)
{
Map<String, String> params = (job).getJobParams();
String val = StringUtils.trimToNull(params.get("resourceSettings.resourceSettings.useLustre"));
if (val == null)
{
return false;
}

return Boolean.parseBoolean(val);
}

private void possiblyAddQOS(PipelineJob job, RemoteExecutionEngine engine, List<String> lines)
{
//first remove existing
Expand Down

0 comments on commit 1dd37ca

Please sign in to comment.