Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
932e990
Pass nCores to UCell
bbimber May 6, 2025
46bc04a
Automatically strip non-numeric characters on import
bbimber May 7, 2025
1f45656
Improve nimble resume
bbimber May 9, 2025
2fa67c8
Add executor for multithreaded search (#329)
hextraza May 14, 2025
b2e66bb
Bugfix to JBrowseSessionTransform
bbimber May 17, 2025
e713541
Initial support of bbmap
bbimber May 17, 2025
7a2739f
Pass nCores to escape
bbimber May 17, 2025
58c7fb8
Bugfix to bbmap/index
bbimber May 17, 2025
c4a59ea
Bugfix to bbmap
bbimber May 17, 2025
38b2b53
Bugfix to bbmap
bbimber May 17, 2025
2eda1ad
Bugfix to bbmap
bbimber May 18, 2025
af5a272
Update download docs
bbimber May 18, 2025
988600e
BBMap updates
bbimber May 18, 2025
bf6e784
Copy bbmap index to correct dir
bbimber May 18, 2025
5d64be0
Support CRAM archival mode
bbimber May 19, 2025
53bfea1
Expand ConvertToCramHandler to support CRAM
bbimber May 19, 2025
4517fce
Bugfix to SamtoolsCramConverter
bbimber May 19, 2025
150f4b6
Include CRAM Archival Mode in description
bbimber May 19, 2025
be330ea
Allow bbmap to retain unmapped reads
bbimber May 19, 2025
1c53e3b
Add saa=t to bbmap
bbimber May 19, 2025
2fb4b48
Simplify bbmap and unmapped reads
bbimber May 19, 2025
3ed0928
Support lossy_names for SamtoolsCramConverter
bbimber May 19, 2025
39cc937
Correct bbmap to use saa=f
bbimber May 19, 2025
2fb3d8c
Better resume for ConvertToCramHandler
bbimber May 19, 2025
723d3d4
More visibility into orphan aligner indexes
bbimber May 19, 2025
bc8f617
Bugfix to CigarPositionIterable when operator is equal sign
bbimber May 20, 2025
0a38278
Bugfix to CigarPositionIterable when operator is equal sign
bbimber May 20, 2025
655c47a
Mark index folder for deletion
bbimber May 20, 2025
c876525
Bugfix to ConvertToCramHandler
bbimber May 21, 2025
62d9375
Add action to manually create ExpData for file
bbimber May 21, 2025
1ac2cb4
Add more logging
bbimber May 21, 2025
9c6d114
Stream JSON results to client (#330)
hextraza May 21, 2025
709e32a
Bugfix to CRAM handler for BAM inputs
bbimber May 21, 2025
2b31242
Support additional GeneComponentScore values
bbimber May 22, 2025
4581058
Expand OrphanFilePipelineJob
bbimber May 27, 2025
d9ac32c
Expand studies datasets
bbimber May 31, 2025
7db7c21
Update default for JBrowse lucene cores
bbimber May 31, 2025
192acfd
Delay creation of ExecutorService until after server startup and unti…
bbimber May 31, 2025
e604c88
Batch exportCSV scoredocs (#331)
hextraza Jun 2, 2025
7cbcb24
Add study columns
bbimber Jun 3, 2025
f5f8deb
Update JBrowse packages
bbimber Jun 3, 2025
1a845e1
Store more information about cluster jobs
bbimber Jun 7, 2025
9a6f11c
Fix sql error
bbimber Jun 7, 2025
004facd
Bugfixes to SlurmExecutionEngine
bbimber Jun 7, 2025
826a3dd
Bugfixes to SlurmExecutionEngine
bbimber Jun 7, 2025
a570fa4
Fix sql type
bbimber Jun 7, 2025
e6225b0
Debug slurm parsing
bbimber Jun 7, 2025
7e92b47
No need to copy files locally in AbstractSingleCellHandler
bbimber Jun 9, 2025
b07522b
Add consolidate_genomicsdb_array
bbimber Jun 9, 2025
eca5f07
Remove direct access to GenomicsDBImport
bbimber Jun 9, 2025
0611e5b
Add ResultsOOODisplayColumn
bbimber Jun 9, 2025
e7c6a9b
Add metadata for many SIV study queries (#333)
bbimber Jun 9, 2025
a83bb06
Correct XML
bbimber Jun 10, 2025
1edf565
More query XML updates
bbimber Jun 10, 2025
1061b15
Refactor code into discrete SivStudies module
bbimber Jun 10, 2025
f91af88
Minor cleanup
bbimber Jun 12, 2025
c3377a9
Use full filepath
bbimber Jun 13, 2025
301768b
Add length check
bbimber Jun 13, 2025
2c9d337
Fix merge conflicts
bbimber Jun 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ abstract public class AbstractAlignmentStepProvider<StepType extends AlignmentSt
public static String SUPPORT_MERGED_UNALIGNED = "supportsMergeUnaligned";
public static String COLLECT_WGS_METRICS = "collectWgsMetrics";
public static String CONVERT_TO_CRAM = "convertToCram";
public static String CRAM_ARCHIVAL_MODE = "doCramArchivalMode";
public static String COLLECT_WGS_METRICS_NON_ZERO = "collectWgsMetricsNonZero";
public static String DISCARD_BAM = "discardBam";

Expand Down Expand Up @@ -116,6 +117,10 @@ private static List<ToolParameterDescriptor> getParamList(List<ToolParameterDesc
put("checked", false);
}}, false));

parameters.add(ToolParameterDescriptor.create("doCramArchivalMode", "CRAM Archival Mode", "If selected, the CRAM will undergo additional compression to save space. This is lossy and may not be compatible with all downstream tools. See samtools view --output-fmt-option archive", "checkbox", new JSONObject(){{
put("checked", false);
}}, false));

parameters.add(ToolParameterDescriptor.create(ALIGNMENT_MODE_PARAM, "Alignment Mode", "If your readset has more than one pair of FASTQs, there pipeline can either align each pair sequentially (and then merge these BAMs), or merge the pairs of FASTQs first and then perform alignment once. The default is to align each pair of FASTQs separately; however, some pipelines like STAR require the latter.", "ldk-simplecombo", new JSONObject(){{
put("storeValues", ALIGNMENT_MODE.ALIGN_THEN_MERGE.name() + ";" + ALIGNMENT_MODE.MERGE_THEN_ALIGN.name());
put("value", alignmentMode.name());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,19 @@ default boolean supportsMetrics()
boolean supportsGzipFastqs();

@Override
AlignmentStepProvider getProvider();
AlignmentStepProvider<?> getProvider();

default String getAlignmentDescription()
{
return "Aligner: " + getProvider().getName();
ToolParameterDescriptor cramArchivalParam = getProvider().getParameterByName(AbstractAlignmentStepProvider.CRAM_ARCHIVAL_MODE);
boolean doArchival = cramArchivalParam != null && cramArchivalParam.extractValue(getPipelineCtx().getJob(), getProvider(), getStepIdx(), Boolean.class, false);
String ret = "Aligner: " + getProvider().getName();
if (doArchival)
{
ret = ret + "\nCRAM Archival Mode";
}

return ret;
}

interface AlignmentOutput extends PipelineStepOutput
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,44 @@ public SamtoolsCramConverter(Logger log)
super(log);
}

public File convert(File inputBam, File outputCram, File gzippedFasta, boolean doIndex, @Nullable Integer threads) throws PipelineJobException
public File convert(File inputBam, File outputCram, File gzippedFasta, boolean doIndex, @Nullable Integer threads, boolean archivalMode) throws PipelineJobException
{
getLogger().info("Converting SAM/BAM to CRAM: " + inputBam.getPath());
if (inputBam.equals(outputCram))
{
throw new PipelineJobException("Input/output files are the same");
}

List<String> params = new ArrayList<>();
params.add(getSamtoolsPath().getPath());
params.add("view");

params.add("-C");
params.add("--output-fmt");
params.add("cram,version=3.0" + (archivalMode ? ",lossy_names=1" : ""));

params.add("-o");
params.add(outputCram.getPath());

// CRAM does, however, have an optional archive settings mode (samtools view ...)
// which is a lossy compression, doing things like removing read names, removing additional accessory fields, and additional compression of quality scores.
// In all cases, the base sequence of the reads is preserved: https://www.htslib.org/doc/samtools.html
if (archivalMode)
{
params.add("--output-fmt-option");
params.add("archive");
}

params.add("-T");
params.add(gzippedFasta.getPath());

if (doIndex)
{
params.add("--write-index");
}

if (threads != null)
{
params.add("--threads");
params.add("-@");
params.add(String.valueOf(threads));
}

Expand All @@ -49,11 +68,6 @@ public File convert(File inputBam, File outputCram, File gzippedFasta, boolean d
throw new PipelineJobException("Missing output: " + outputCram.getPath());
}

if (doIndex)
{
doIndex(outputCram, threads);
}

return outputCram;
}

Expand Down
14 changes: 14 additions & 0 deletions SequenceAnalysis/pipeline_code/extra_tools_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -305,3 +305,17 @@ then
else
echo "Already installed"
fi

if [[ ! -e ${LKTOOLS_DIR}/bbmap || ! -z $FORCE_REINSTALL ]];
then
echo "Cleaning up previous installs"
rm -Rf $LKTOOLS_DIR/bbmap

wget https://sourceforge.net/projects/bbmap/files/BBMap_39.25.tar.gz
tar -xf BBMap_39.25.tar.gz

mv bbmap $LKTOOLS_DIR/
ln -s $LKTOOLS_DIR/bbmap/bbmap.sh $LKTOOLS_DIR/bbmap.sh
else
echo "Already installed"
fi
Original file line number Diff line number Diff line change
Expand Up @@ -5183,4 +5183,62 @@ public void setDoNotRequireSra(boolean doNotRequireSra)
_doNotRequireSra = doNotRequireSra;
}
}

@RequiresSiteAdmin
public static class CreateExpDataForFileAction extends ConfirmAction<CreateExpDataForFileForm>
{
@Override
public void validateCommand(CreateExpDataForFileForm form, Errors errors)
{

}

@Override
public URLHelper getSuccessURL(CreateExpDataForFileForm form)
{
return getContainer().getStartURL(getUser());
}

@Override
public ModelAndView getConfirmView(CreateExpDataForFileForm form, BindException errors) throws Exception
{
return new HtmlView(HtmlString.unsafe("This will create a new ExpData with a DataFileUrl pointing to the provided URI. This should be a full URI, such as file:///my/path/myFile.txt." +
"<br><br>" +
"<label>DataFileUrl </label><input name=\"dataFileUrl\" value = \"" + HtmlString.of(form.getDataFileUrl()) + "\"><br>"));
}

@Override
public boolean handlePost(CreateExpDataForFileForm form, BindException errors) throws Exception
{
URI newUri = URI.create(form.getDataFileUrl());
File f = new File(newUri);
if (!f.exists())
{
throw new PipelineJobException("Missing file: " + form.getDataFileUrl());
}

DataType dataType = new DataType("File");

ExpData d = ExperimentService.get().createData(getContainer(), dataType, f.getName());
d.setDataFileURI(newUri);
d.save(getUser());

return true;
}
}

public static class CreateExpDataForFileForm
{
private String _dataFileUrl;

public String getDataFileUrl()
{
return _dataFileUrl;
}

public void setDataFileUrl(String dataFileUrl)
{
_dataFileUrl = dataFileUrl;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
import org.labkey.sequenceanalysis.query.SequenceAnalysisUserSchema;
import org.labkey.sequenceanalysis.query.SequenceTriggerHelper;
import org.labkey.sequenceanalysis.run.RestoreSraDataHandler;
import org.labkey.sequenceanalysis.run.alignment.BBMapWrapper;
import org.labkey.sequenceanalysis.run.alignment.BWAMem2Wrapper;
import org.labkey.sequenceanalysis.run.alignment.BWAMemWrapper;
import org.labkey.sequenceanalysis.run.alignment.BWASWWrapper;
Expand Down Expand Up @@ -157,8 +158,6 @@
import org.labkey.sequenceanalysis.run.reference.VirusReferenceLibraryStep;
import org.labkey.sequenceanalysis.run.util.CombineGVCFsHandler;
import org.labkey.sequenceanalysis.run.util.FastqcRunner;
import org.labkey.sequenceanalysis.run.util.GenomicsDBAppendHandler;
import org.labkey.sequenceanalysis.run.util.GenomicsDBImportHandler;
import org.labkey.sequenceanalysis.run.util.SVAnnotateStep;
import org.labkey.sequenceanalysis.run.variant.DepthOfCoverageHandler;
import org.labkey.sequenceanalysis.run.variant.GenotypeConcordanceStep;
Expand Down Expand Up @@ -309,6 +308,7 @@ public static void registerPipelineSteps()
SequencePipelineService.get().registerPipelineStep(new StarWrapper.Provider());
SequencePipelineService.get().registerPipelineStep(new Pbmm2Wrapper.Provider());
SequencePipelineService.get().registerPipelineStep(new VulcanWrapper.Provider());
SequencePipelineService.get().registerPipelineStep(new BBMapWrapper.Provider());

//de novo assembly
SequencePipelineService.get().registerPipelineStep(new TrinityRunner.Provider());
Expand Down Expand Up @@ -395,8 +395,6 @@ public static void registerPipelineSteps()
SequenceAnalysisService.get().registerFileHandler(new RecalculateSequenceMetricsHandler());
SequenceAnalysisService.get().registerFileHandler(new ListVcfSamplesHandler());
SequenceAnalysisService.get().registerFileHandler(new MultiQCBamHandler());
SequenceAnalysisService.get().registerFileHandler(new GenomicsDBImportHandler());
SequenceAnalysisService.get().registerFileHandler(new GenomicsDBAppendHandler());
SequenceAnalysisService.get().registerFileHandler(new MergeLoFreqVcfHandler());
SequenceAnalysisService.get().registerFileHandler(new PangolinHandler());
SequenceAnalysisService.get().registerFileHandler(new NextCladeHandler());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ private void initializeCigar()
int i = 0;
for (char el : _explodedCigar)
{
CigarOperator op = CigarOperator.valueOf(Character.toString(el));
CigarOperator op = CigarOperator.characterToEnum(el);
if (op.consumesReadBases())
{
_readPositions[i] = readPos;
Expand Down Expand Up @@ -155,7 +155,7 @@ public PositionInfo(SAMRecord record, int pos, char[] ops, Integer[] readPos, In
{
_record = record;
_pos = pos;
_op = CigarOperator.valueOf(Character.toString(ops[pos]));
_op = CigarOperator.characterToEnum(ops[pos]);
_readPos = readPos[pos];
_refPos = refPos[pos];

Expand Down
Loading