Skip to content

Commit 04a9789

Browse files
committed
Better handling of multi-chain TRA/TRDV segments
1 parent dcd9f66 commit 04a9789

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

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

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,15 @@ public void init(SequenceAnalysisJobSupport support) throws PipelineJobException
177177
String lineage = nt.getLineage();
178178
if (doGDParsing() && "TRD".equalsIgnoreCase(locus))
179179
{
180+
// Dont duplicate sequences like TRAV14/DV4, since they will be covered by the TRA:
181+
if (lineage.contains("TRA") && Arrays.asList(loci).contains("TRA"))
182+
{
183+
getPipelineCtx().getLogger().debug("skipping redundant sequence: " + nt.getName() + " / " + nt.getLocus());
184+
continue;
185+
}
186+
180187
locus = "TRB";
181-
lineage = nt.getLineage().replaceAll("TRD", locus);
188+
lineage = lineage.replaceAll("TRD", locus);
182189

183190
//In the situation where there is no gene number, inject one:
184191
if (!lineage.matches(".*[0-9]+$"))
@@ -194,7 +201,7 @@ public void init(SequenceAnalysisJobSupport support) throws PipelineJobException
194201
else if (doGDParsing() && "TRG".equalsIgnoreCase(locus))
195202
{
196203
locus = "TRA";
197-
lineage = nt.getLineage().replaceAll("TRG", locus);
204+
lineage = lineage.replaceAll("TRG", locus);
198205

199206
//In the situation where there is no gene number, inject one:
200207
if (!lineage.matches(".*[0-9]+$"))
@@ -220,8 +227,8 @@ else if (nt.getLineage().contains("V"))
220227
{
221228
if (seq.length() < 300)
222229
{
223-
getPipelineCtx().getLogger().info("Using V-REGION due to short length: " + nt.getName() + " / " + nt.getSeqLength());
224-
type = "V-REGION";
230+
getPipelineCtx().getLogger().info("V-segment too short, skipping: " + nt.getName() + " / " + nt.getSeqLength());
231+
continue;
225232
}
226233
else
227234
{

0 commit comments

Comments
 (0)