Skip to content

Commit 37d2065

Browse files
committed
Switch approach for differentiating TRD/G segments in cellranger
1 parent 052905b commit 37d2065

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

cluster/src/org/labkey/cluster/pipeline/AbstractClusterExecutionEngine.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,9 +502,9 @@ protected void updateJobStatus(@Nullable String status, ClusterJob j, @Nullable
502502
statusChanged = true;
503503
}
504504

505-
if (!statusChanged && !sf.getStatus().equalsIgnoreCase(j.getStatus()))
505+
if (status != null && !statusChanged && !sf.getStatus().equalsIgnoreCase(j.getStatus()))
506506
{
507-
_log.error("ClusterExecutionEngine reports status not changed, but was: " + status + " / statusfile: " + sf.getStatus() + " / cluster job: " + j.getStatus());
507+
_log.error("ClusterExecutionEngine reports status not changed for job: " + sf.getRowId() + ", but was: " + status + " / statusfile: " + sf.getStatus() + " / cluster job: " + j.getStatus());
508508
}
509509
}
510510

singlecell/src/org/labkey/singlecell/run/CellRangerVDJWrapper.java

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -167,20 +167,23 @@ public void init(SequenceAnalysisJobSupport support) throws PipelineJobException
167167

168168
//example: >1|TRAV41*01 TRAV41|TRAV41|L-REGION+V-REGION|TR|TRA|None|None
169169
//Note: for g/d recovery, add any gamma segments as TRA and delta as TRB. Also prefix their gene names with TRA/B, but keep the true name (i.e. TRDV1 -> TRBTRDV1)
170-
String prefix = "";
170+
String suffix = "";
171+
String lineage = nt.getLineage();
171172
if (doGDParsing() && "TRD".equalsIgnoreCase(locus))
172173
{
173-
prefix = "TRB";
174+
suffix = "d";
175+
lineage = lineage.replaceAll("TRD", "TRB");
174176
locus = "TRB";
175177
}
176178
else if (doGDParsing() && "TRG".equalsIgnoreCase(locus))
177179
{
178-
prefix = "TRA";
180+
suffix = "g";
181+
lineage = lineage.replaceAll("TRG", "TRA");
179182
locus = "TRA";
180183
}
181184

182185
StringBuilder header = new StringBuilder();
183-
header.append(">").append(i.get()).append("|").append(prefix).append(nt.getName()).append(" ").append(prefix).append(nt.getLineage()).append("|").append(prefix).append(nt.getLineage()).append("|");
186+
header.append(">").append(i.get()).append("|").append(nt.getName()).append(suffix).append(" ").append(lineage).append("|").append(lineage).append("|");
184187
//translate into V_Region
185188
String type;
186189
if (nt.getLineage().contains("J"))
@@ -235,7 +238,7 @@ private File getGenomeFasta()
235238
@Override
236239
public String getIndexCachedDirName(PipelineJob job)
237240
{
238-
return getProvider().getName() + (doGDParsing() ? "-GD" : "");
241+
return getProvider().getName() + (doGDParsing() ? "-GammaDelta" : "");
239242
}
240243

241244
@Override
@@ -431,7 +434,7 @@ public AlignmentStep.AlignmentOutput performAlignment(Readset rs, List<File> inp
431434
int totalG = 0;
432435
while ((line = reader.readLine()) != null)
433436
{
434-
if (line.contains("TRATRG") || line.contains("TRBTRD"))
437+
if (line.contains("g,") || line.contains("d,"))
435438
{
436439
//Infer correct chain from the V, J and C genes
437440
String[] tokens = line.split(",");
@@ -443,11 +446,11 @@ public AlignmentStep.AlignmentOutput performAlignment(Readset rs, List<File> inp
443446
String val = StringUtils.trimToNull(tokens[idx]);
444447
if (val != null)
445448
{
446-
if (val.contains("TRATRG"))
449+
if (val.endsWith("g"))
447450
{
448451
val = "TRG";
449452
}
450-
else if (val.contains("TRBTRD"))
453+
else if (val.endsWith("d"))
451454
{
452455
val = "TRD";
453456
}
@@ -523,8 +526,8 @@ else if (chain.equals("TRD"))
523526
tokens[5] = chain;
524527

525528
line = StringUtils.join(tokens, ",");
526-
line = line.replaceAll("TRATRG", "TRG");
527-
line = line.replaceAll("TRBTRD", "TRD");
529+
line = line.replaceAll("g,", ",");
530+
line = line.replaceAll("d,", ",");
528531
}
529532
else
530533
{

0 commit comments

Comments
 (0)