Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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 numberDiff line numberDiff line change
Expand Up@@ -248,7 +248,7 @@ public static File processBarcodeFile(SequenceOutputHandler.JobContext ctx, File
//prepare whitelist of cell indexes
File cellBarcodeWhitelist = utils.getValidCellIndexFile();
Set<String> uniqueBarcodes = new HashSet<>();
ctx.getLogger().debug("writing cell barcodes");
ctx.getLogger().debug("writing cell barcodes, using file: " + perCellTsv.getPath());
try (CSVWriter writer = new CSVWriter(PrintWriters.getPrintWriter(cellBarcodeWhitelist), ',', CSVWriter.NO_QUOTE_CHARACTER);CSVReader reader = new CSVReader(IOUtil.openFileForBufferedUtf8Reading(perCellTsv), '\t'))
{
int rowIdx = 0;
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -376,7 +376,7 @@ public File runRemoteVdjCellHashingTasks(PipelineStepOutput output, String outpu
File cellBarcodeWhitelist = getValidCellIndexFile();
Set<String> uniqueBarcodes = new HashSet<>();
Set<String> uniqueBarcodesIncludingNoCDR3 = new HashSet<>();
_log.debug("writing cell barcodes");
_log.debug("writing cell barcodes, using file: " + perCellTsv.getPath());
try (CSVWriter writer = new CSVWriter(PrintWriters.getPrintWriter(cellBarcodeWhitelist), ',', CSVWriter.NO_QUOTE_CHARACTER); CSVReader reader = new CSVReader(Readers.getReader(perCellTsv), ','))
{
int rowIdx = 0;
Expand Down
34 changes: 34 additions & 0 deletions tcrdb/src/org/labkey/tcrdb/pipeline/CellRangerVDJWrapper.java
Original file line numberDiff line numberDiff line change
Expand Up@@ -68,6 +68,7 @@ public CellRangerVDJWrapper(@Nullable Logger logger)

public static final String TARGET_ASSAY = "targetAssay";
public static final String DELETE_EXISTING_ASSAY_DATA = "deleteExistingAssayData";
public static final String INNER_ENRICHMENT_PRIMERS = "innerEnrichmentPrimers";

public static class VDJProvider extends AbstractAlignmentStepProvider<AlignmentStep>
{
Expand All@@ -82,6 +83,13 @@ public VDJProvider()
ToolParameterDescriptor.createCommandLineParam(CommandLineParam.create("--force-cells"), "force-cells", "Force Cells", "Force pipeline to use this number of cells, bypassing the cell detection algorithm. Use this if the number of cells estimated by Cell Ranger is not consistent with the barcode rank plot.", "ldk-integerfield", new JSONObject(){{
put("minValue", 0);
}}, null),
ToolParameterDescriptor.createCommandLineParam(CommandLineParam.createSwitch("--disable-ui"), "disable-ui", "Disable UI", "If checked, this will run cellranger with the optional web-based UI disabled.", "checkbox", new JSONObject(){{
put("checked", true);
}}, true),
ToolParameterDescriptor.create(INNER_ENRICHMENT_PRIMERS, "Inner Enrichment Primers", "An option comma-separated list of the inner primers used for TCR enrichment. These will be used for trimming.", "textarea", new JSONObject(){{
put("height", 100);
put("width", 400);
}}, null),
ToolParameterDescriptor.create(TARGET_ASSAY, "Target Assay", "Results will be loaded into this assay. If no assay is selected, a table will be created with nothing in the DB.", "tcr-assayselectorfield", new JSONObject(){{
put("autoSelectAssay", false);
}}, null),
Expand DownExpand Up@@ -296,6 +304,32 @@ public AlignmentStep.AlignmentOutput performAlignment(Readset rs, File inputFast
File indexDir = AlignerIndexUtil.getIndexDir(referenceGenome, getIndexCachedDirName(getPipelineCtx().getJob()));
args.add("--reference=" + indexDir.getPath());

String primers = StringUtils.trimToNull(getProvider().getParameterByName(INNER_ENRICHMENT_PRIMERS).extractValue(getPipelineCtx().getJob(), getProvider(), getStepIdx(), String.class, null));
if (primers != null)
{
primers = primers.replaceAll("\\s+", ",");
primers = primers.replaceAll(",+", ",");

File primerFile = new File(outputDirectory, "primers.txt");
try (PrintWriter writer = PrintWriters.getPrintWriter(primerFile))
{
Arrays.stream(primers.split(",")).forEach(x -> {
x = StringUtils.trimToNull(x);
if (x != null)
{
writer.println(x);
}
});
}
catch (IOException e)
{
throw new PipelineJobException(e);
}

output.addIntermediateFile(primerFile);
args.add("--inner-enrichment-primers=" + primerFile.getPath());
}

args.addAll(getClientCommandArgs("="));

Integer maxThreads = SequencePipelineService.get().getMaxThreads(getPipelineCtx().getLogger());
Expand Down