Skip to content

Commit c69a9ae

Browse files
committed
Add arguments for --set-filtered-genotype-to-no-call
1 parent 3185f99 commit c69a9ae

File tree

3 files changed

+84
-77
lines changed

3 files changed

+84
-77
lines changed

SequenceAnalysis/src/org/labkey/sequenceanalysis/run/variant/SelectVariantsStep.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,10 @@ public Provider()
7070
}}, null),
7171
new IntervalParameterDescriptor(),
7272
ToolParameterDescriptor.create(SelectSamplesStep.SAMPLE_INCLUDE, "Select Sample(s) Include", "Only variants of the selected type(s) will be included", "sequenceanalysis-trimmingtextarea", null, null),
73-
ToolParameterDescriptor.create(SelectSamplesStep.SAMPLE_EXCLUDE, "Select Samples(s) To Exclude", "Variants of the selected type(s) will be excluded", "sequenceanalysis-trimmingtextarea", null, null)
73+
ToolParameterDescriptor.create(SelectSamplesStep.SAMPLE_EXCLUDE, "Select Samples(s) To Exclude", "Variants of the selected type(s) will be excluded", "sequenceanalysis-trimmingtextarea", null, null),
74+
ToolParameterDescriptor.createCommandLineParam(CommandLineParam.createSwitch("--set-filtered-gt-to-nocall"), "setFilteredGtToNocall", "Set Filtered Genotypes to No-Call", "If selected, any filtered genotypes will be converted to no-call.", "checkbox", new JSONObject(){{
75+
put("checked", true);
76+
}}, true)
7477
), Arrays.asList("sequenceanalysis/panel/VariantFilterPanel.js", "sequenceanalysis/panel/IntervalPanel.js", "/sequenceanalysis/field/TrimmingTextArea.js"), "");
7578
}
7679

singlecell/src/org/labkey/singlecell/analysis/AbstractSingleCellHandler.java

Lines changed: 78 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -943,101 +943,104 @@ public static String getOutputDescription(JobContext ctx, File seuratObj, @Nulla
943943
descriptions = new ArrayList<>(descriptions);
944944
}
945945

946-
File metaTable = CellHashingServiceImpl.get().getMetaTableFromSeurat(seuratObj);
947-
try (CSVReader reader = new CSVReader(Readers.getReader(metaTable), ','))
946+
File metaTable = CellHashingServiceImpl.get().getMetaTableFromSeurat(seuratObj, false);
947+
if (metaTable != null)
948948
{
949-
String[] line;
950-
951-
int totalCells = 0;
952-
int totalSinglet = 0;
953-
int totalDiscordant = 0;
954-
int lowOrNegative = 0;
955-
int totalDoublet = 0;
956-
double totalSaturation = 0.0;
957-
958-
int hashingIdx = -1;
959-
int saturationIdx = -1;
960-
boolean hashingUsed = true;
961-
while ((line = reader.readNext()) != null)
949+
try (CSVReader reader = new CSVReader(Readers.getReader(metaTable), ','))
962950
{
963-
// This will test whether this is the first line or not
964-
if (hashingIdx == -1)
965-
{
966-
hashingIdx = Arrays.asList(line).indexOf("HTO.Classification");
967-
if (hashingIdx == -1)
968-
{
969-
ctx.getLogger().debug("HTO.Classification field not present, skipping");
970-
hashingUsed = false;
971-
hashingIdx = -2;
972-
}
951+
String[] line;
973952

974-
saturationIdx = Arrays.asList(line).indexOf("Saturation.RNA");
975-
}
976-
else
953+
int totalCells = 0;
954+
int totalSinglet = 0;
955+
int totalDiscordant = 0;
956+
int lowOrNegative = 0;
957+
int totalDoublet = 0;
958+
double totalSaturation = 0.0;
959+
960+
int hashingIdx = -1;
961+
int saturationIdx = -1;
962+
boolean hashingUsed = true;
963+
while ((line = reader.readNext()) != null)
977964
{
978-
totalCells++;
979-
if (hashingUsed && hashingIdx >= 0)
965+
// This will test whether this is the first line or not
966+
if (hashingIdx == -1)
980967
{
981-
String val = line[hashingIdx];
982-
if ("Singlet".equals(val))
983-
{
984-
totalSinglet++;
985-
}
986-
else if ("Doublet".equals(val))
987-
{
988-
totalDoublet++;
989-
}
990-
else if ("Discordant".equals(val))
968+
hashingIdx = Arrays.asList(line).indexOf("HTO.Classification");
969+
if (hashingIdx == -1)
991970
{
992-
totalDiscordant++;
971+
ctx.getLogger().debug("HTO.Classification field not present, skipping");
972+
hashingUsed = false;
973+
hashingIdx = -2;
993974
}
994-
else if ("Low Counts".equalsIgnoreCase(val) || "Negative".equals(val))
975+
976+
saturationIdx = Arrays.asList(line).indexOf("Saturation.RNA");
977+
}
978+
else
979+
{
980+
totalCells++;
981+
if (hashingUsed && hashingIdx >= 0)
995982
{
996-
lowOrNegative++;
983+
String val = line[hashingIdx];
984+
if ("Singlet".equals(val))
985+
{
986+
totalSinglet++;
987+
}
988+
else if ("Doublet".equals(val))
989+
{
990+
totalDoublet++;
991+
}
992+
else if ("Discordant".equals(val))
993+
{
994+
totalDiscordant++;
995+
}
996+
else if ("Low Counts".equalsIgnoreCase(val) || "Negative".equals(val))
997+
{
998+
lowOrNegative++;
999+
}
1000+
else if ("NotUsed".equals(val))
1001+
{
1002+
hashingUsed = false;
1003+
}
9971004
}
998-
else if ("NotUsed".equals(val))
1005+
1006+
if (saturationIdx >= 0)
9991007
{
1000-
hashingUsed = false;
1008+
double saturation = Double.parseDouble(line[saturationIdx]);
1009+
totalSaturation += saturation;
10011010
}
10021011
}
1003-
1004-
if (saturationIdx >= 0)
1005-
{
1006-
double saturation = Double.parseDouble(line[saturationIdx]);
1007-
totalSaturation += saturation;
1008-
}
10091012
}
1010-
}
10111013

1012-
NumberFormat pf = NumberFormat.getPercentInstance();
1013-
pf.setMaximumFractionDigits(2);
1014+
NumberFormat pf = NumberFormat.getPercentInstance();
1015+
pf.setMaximumFractionDigits(2);
10141016

1015-
NumberFormat decimal = DecimalFormat.getNumberInstance();
1016-
decimal.setGroupingUsed(false);
1017+
NumberFormat decimal = DecimalFormat.getNumberInstance();
1018+
decimal.setGroupingUsed(false);
10171019

1018-
descriptions.add("Total Cells: " + decimal.format(totalCells));
1019-
if (hashingUsed)
1020-
{
1021-
descriptions.add("Total Singlet: " + decimal.format(totalSinglet));
1022-
descriptions.add("% Singlet: " + pf.format((double) totalSinglet / (double) totalCells));
1023-
descriptions.add("% Doublet: " + pf.format((double) totalDoublet / (double) totalCells));
1024-
descriptions.add("% Discordant: " + pf.format((double) totalDiscordant / (double) totalCells));
1025-
descriptions.add("% Negative or Low Count: " + pf.format((double) lowOrNegative / (double) totalCells));
1026-
}
1027-
else
1028-
{
1029-
descriptions.add("Hashing not used");
1030-
}
1020+
descriptions.add("Total Cells: " + decimal.format(totalCells));
1021+
if (hashingUsed)
1022+
{
1023+
descriptions.add("Total Singlet: " + decimal.format(totalSinglet));
1024+
descriptions.add("% Singlet: " + pf.format((double) totalSinglet / (double) totalCells));
1025+
descriptions.add("% Doublet: " + pf.format((double) totalDoublet / (double) totalCells));
1026+
descriptions.add("% Discordant: " + pf.format((double) totalDiscordant / (double) totalCells));
1027+
descriptions.add("% Negative or Low Count: " + pf.format((double) lowOrNegative / (double) totalCells));
1028+
}
1029+
else
1030+
{
1031+
descriptions.add("Hashing not used");
1032+
}
10311033

1032-
if (totalSaturation > 0)
1034+
if (totalSaturation > 0)
1035+
{
1036+
descriptions.add("Mean RNA Saturation: " + (totalSaturation / (double) totalCells));
1037+
}
1038+
}
1039+
catch (IOException e)
10331040
{
1034-
descriptions.add("Mean RNA Saturation: " + (totalSaturation / (double) totalCells));
1041+
throw new PipelineJobException(e);
10351042
}
10361043
}
1037-
catch (IOException e)
1038-
{
1039-
throw new PipelineJobException(e);
1040-
}
10411044

10421045
if (ctx.getParams().optBoolean("singleCellRawData.PrepareRawCounts.useSoupX", false))
10431046
{

singlecell/src/org/labkey/singlecell/pipeline/singlecell/RunCelltypistCustomModel.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ public Provider()
3131
put("allowBlank", false);
3232
put("category", TrainCelltypist.CATEGORY);
3333
put("performGenomeFilter", false);
34-
}}, null)
34+
}}, null),
35+
ToolParameterDescriptor.create("columnPrefix", "Column Prefix", "This string will be pre-pended to the normal output columns (i.e. majority_voting and predicted_labels)", "textfield", null, null)
3536
), PageFlowUtil.set("sequenceanalysis/field/SequenceOutputFileSelectorField.js"), null);
3637
}
3738

0 commit comments

Comments
 (0)