Skip to content

Commit 241c74a

Browse files
committed
Merge discvr-19.3 to develop
2 parents caf220e + 6f45d57 commit 241c74a

File tree

11 files changed

+74
-6
lines changed

11 files changed

+74
-6
lines changed

.github/workflows/sync-repos.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
- cron: "10 */3 * * *"
55
jobs:
66
sync-release-branches:
7+
# github.head_ref should only be set on forked repos, meaning this action should only run on the primary fork
8+
if: github.head_ref == ''
79
runs-on: ubuntu-latest
810
steps:
911
- name: "Sync Release Branches"
@@ -15,6 +17,7 @@ jobs:
1517
destination_branch_prefix: "discvr-"
1618
github_token: ${{ secrets.GITHUB_TOKEN }}
1719
sync-develop:
20+
if: github.head_ref == ''
1821
runs-on: ubuntu-latest
1922
steps:
2023
- name: "Sync Develop Branch"

SequenceAnalysis/resources/external/scRNAseq/htoClassifier.Rmd

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,19 @@
22
title: 'Cell Hashing'
33
---
44

5-
```{r}
5+
```{r setup}
66
77
library(OOSAP)
88
9+
cores <- Sys.getenv('SEQUENCEANALYSIS_MAX_THREADS')
10+
if (cores != ''){
11+
print(paste0('Setting threads to ', cores))
12+
future::plan("multiprocess", workers = as.integer(cores))
13+
Sys.setenv('OMP_NUM_THREADS' = cores)
14+
} else {
15+
print('SEQUENCEANALYSIS_MAX_THREADS not set, will not set cores')
16+
}
17+
918
```
1019

1120
## Basic QC and Filtering on input:

SequenceAnalysis/resources/external/scRNAseq/htoClassifier.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,18 @@ if [ $# -ge 8 ];then
1919
WHITELIST="whitelistFile<-'"${8}"';"
2020
fi
2121

22+
ENV_OPTS=""
2223
RAM_OPTS=""
2324
if [ ! -z $SEQUENCEANALYSIS_MAX_RAM ];then
2425
RAM_OPTS=" --memory=${SEQUENCEANALYSIS_MAX_RAM}g"
26+
27+
ENV_OPTS=" -e SEQUENCEANALYSIS_MAX_RAM"
28+
fi
29+
30+
if [ ! -z SEQUENCEANALYSIS_MAX_THREADS ];then
31+
ENV_OPTS=${ENV_OPTS}" -e SEQUENCEANALYSIS_MAX_THREADS="${SEQUENCEANALYSIS_MAX_THREADS}
2532
fi
2633

2734
sudo $DOCKER pull bimberlab/oosap
2835

29-
sudo $DOCKER run --rm=true $RAM_OPTS -v "${WD}:/work" -v "${HOME}:/homeDir" -u $UID -e USERID=$UID -w /work -e HOME=/homeDir bimberlab/oosap Rscript -e "barcodeDir <- '"${CITESEQ_COUNT_DIR}"';finalCallFile <- '"${FINAL_CALLS}"';doHtoFilter <- "${DO_HTO_FILTER}";maxValueForColSumFilter <- "${MIN_READS_PER_CELL}";allCallsOutFile <- '"${RAW_CALLS}"';metricsFile <- '"${METRICS_FILE}"';"${WHITELIST}"rmarkdown::render('htoClassifier.Rmd', output_file = '"${HTML_FILE}"')"
36+
sudo $DOCKER run --rm=true $RAM_OPTS $ENV_OPTS -v "${WD}:/work" -v "${HOME}:/homeDir" -u $UID -e USERID=$UID -w /work -e HOME=/homeDir bimberlab/oosap Rscript -e "barcodeDir <- '"${CITESEQ_COUNT_DIR}"';finalCallFile <- '"${FINAL_CALLS}"';doHtoFilter <- "${DO_HTO_FILTER}";maxValueForColSumFilter <- "${MIN_READS_PER_CELL}";allCallsOutFile <- '"${RAW_CALLS}"';metricsFile <- '"${METRICS_FILE}"';"${WHITELIST}"rmarkdown::render('htoClassifier.Rmd', output_file = '"${HTML_FILE}"')"

SequenceAnalysis/resources/web/SequenceAnalysis/panel/AlignmentAnalysisPanel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ Ext4.define('SequenceAnalysis.panel.AlignmentAnalysisPanel', {
140140
};
141141

142142
//first add the general params
143-
Ext4.apply(json, this.down('#runInformation').getForm().getValues());
143+
Ext4.apply(json, this.down('#runInformation').getForm().getFieldValues());
144144

145145
//and sample information
146146
json.analysisIds = this.analyses;

SequenceAnalysis/resources/web/SequenceAnalysis/panel/SequenceAnalysisPanel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ Ext4.define('SequenceAnalysis.panel.SequenceAnalysisPanel', {
256256
};
257257

258258
//first add the general params
259-
Ext4.apply(json, this.down('#runInformation').getForm().getValues());
259+
Ext4.apply(json, this.down('#runInformation').getForm().getFieldValues());
260260

261261
json['alignment.doAlignment'] = this.down('#doAlignment').getValue();
262262

SequenceAnalysis/resources/web/SequenceAnalysis/panel/VariantProcessingPanel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ Ext4.define('SequenceAnalysis.panel.VariantProcessingPanel', {
453453
};
454454

455455
//first add the general params
456-
Ext4.apply(json, this.down('#runInformation').getForm().getValues());
456+
Ext4.apply(json, this.down('#runInformation').getForm().getFieldValues());
457457

458458
//then append each section
459459
var sections = this.query('sequenceanalysis-analysissectionpanel');

SequenceAnalysis/resources/web/SequenceAnalysis/window/OutputHandlerWindow.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,8 @@ Ext4.define('SequenceAnalysis.window.OutputHandlerWindow', {
250250
return;
251251
}
252252

253-
var params = this.down('form').getForm().getValues();
253+
//Note: use getFieldValues() to also include unchecked checkboxes
254+
var params = this.down('form').getForm().getFieldValues();
254255
var json = {
255256
handlerType: this.handlerType,
256257
handlerClass: this.handlerClass,

SequenceAnalysis/src/org/labkey/sequenceanalysis/SequenceAnalysisController.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3659,6 +3659,21 @@ else if (fastaFileType.isType(data.getFile()))
36593659
}
36603660
}
36613661
}
3662+
3663+
File dict = new File(data.getFile().getParentFile(), FileUtil.getBaseName(data.getFile()) + ".dict");
3664+
if (dict.exists())
3665+
{
3666+
files.add(dict);
3667+
}
3668+
else
3669+
{
3670+
//Try alternate name scheme
3671+
dict = new File(data.getFile() + ".dict");
3672+
if (dict.exists())
3673+
{
3674+
files.add(dict);
3675+
}
3676+
}
36623677
}
36633678
}
36643679

SequenceAnalysis/src/org/labkey/sequenceanalysis/analysis/CellHashingHandler.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ public static List<ToolParameterDescriptor> getDefaultParams()
8585
put("checked", true);
8686
}}, true),
8787
ToolParameterDescriptor.create("editDistance", "Edit Distance", null, "ldk-integerfield", null, 1),
88+
ToolParameterDescriptor.create("excludeFailedcDNA", "Exclude Failed cDNA", "If selected, cDNAs with non-blank status fields will be omitted", "checkbox", null, true),
8889
ToolParameterDescriptor.create("minCountPerCell", "Min Reads/Cell", null, "ldk-integerfield", null, 5),
8990
ToolParameterDescriptor.createCommandLineParam(CommandLineParam.create("-cells"), "cells", "Expected Cells", null, "ldk-integerfield", null, 20000),
9091
ToolParameterDescriptor.create("tagGroup", "Tag List", null, "ldk-simplelabkeycombo", new JSONObject(){{
@@ -276,6 +277,7 @@ private Map<String, Object> executeCiteSeqCount(JobContext ctx, RecordedAction a
276277
CiteSeqCountWrapper wrapper = new CiteSeqCountWrapper(ctx.getLogger());
277278
ReadData rd = rs.getReadData().get(0);
278279

280+
//ctx.getJob().setStatus(PipelineJob.TaskStatus.running, "Running CITE-seq-count with edit distance: " + editDistance);
279281
List<String> args = new ArrayList<>();
280282

281283
args.addAll(getClientCommandArgs(ctx.getParams()));

SequenceAnalysis/src/org/labkey/sequenceanalysis/pipeline/CreateReferenceLibraryTask.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
*/
1616
package org.labkey.sequenceanalysis.pipeline;
1717

18+
import htsjdk.samtools.SAMSequenceDictionary;
19+
import htsjdk.variant.utils.SAMSequenceDictionaryExtractor;
1820
import org.apache.commons.io.FileUtils;
1921
import org.jetbrains.annotations.NotNull;
2022
import org.labkey.api.collections.CaseInsensitiveHashMap;
@@ -193,6 +195,33 @@ public RecordedActionSet run() throws PipelineJobException
193195
File dict = new File(existingFasta.getFile().getParentFile(), basename + ".dict");
194196
if (dict.exists())
195197
{
198+
SAMSequenceDictionary extractor = SAMSequenceDictionaryExtractor.extractDictionary(dict.toPath());
199+
200+
//ensure set of sequence names is identical:
201+
List<String> dictSequenceNames = new ArrayList<>();
202+
extractor.getSequences().forEach(x -> dictSequenceNames.add(x.getSequenceName()));
203+
204+
Map<String, ReferenceLibraryMember> libraryMemberMap = new HashMap<>();
205+
libraryMembers.forEach(x -> libraryMemberMap.put(x.getHeaderName(), x));
206+
List<String> uniqueIncomingSequenceNames = new ArrayList<>(libraryMemberMap.keySet());
207+
uniqueIncomingSequenceNames.removeAll(dictSequenceNames);
208+
209+
if (libraryMemberMap.size() == dictSequenceNames.size() && uniqueIncomingSequenceNames.isEmpty())
210+
{
211+
getJob().getLogger().info("Sorting output to match pre-existing dictionary file");
212+
213+
List<ReferenceLibraryMember> orderedMembers = new ArrayList<>();
214+
extractor.getSequences().forEach(x -> {
215+
orderedMembers.add(libraryMemberMap.get(x.getSequenceName()));
216+
});
217+
218+
libraryMembers = orderedMembers;
219+
}
220+
else
221+
{
222+
getJob().getLogger().info("An existing dictionary file was found, but the set of sequences differs. Will not use.");
223+
}
224+
196225
dict.delete();
197226
}
198227

0 commit comments

Comments
 (0)