Skip to content

Commit

Permalink
Bugfix to handling of TRAV/DV segments
Browse files Browse the repository at this point in the history
  • Loading branch information
bbimber committed Aug 4, 2024
1 parent 326265a commit 8700018
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public void init(SequenceAnalysisJobSupport support) throws PipelineJobException
{
getPipelineCtx().getLogger().debug("Editing TRA/DV lineage: " + lineage);
String[] tokens = lineage.split("/");
lineage = "TR" + tokens[1] + "/" + tokens[0];
lineage = "TR" + tokens[1] + "/" + tokens[0].replaceAll("^TR", "");
getPipelineCtx().getLogger().debug("to: " + lineage);
}

Expand Down Expand Up @@ -824,6 +824,7 @@ private static void processCSV(PrintWriter writer, boolean printHeader, File inp
{
String line;
int chimericCallsRecovered = 0;
int restoredTRDVAV = 0;

int lineIdx = 0;
while ((line = reader.readLine()) != null)
Expand All @@ -841,6 +842,15 @@ private static void processCSV(PrintWriter writer, boolean printHeader, File inp

//Infer correct chain from the V, J and C genes
String[] tokens = line.split(",", -1); // -1 used to preserve trailing empty strings

// Restore original value for TRD/TRA
if (tokens[6].contains("TRDV") && tokens[6].contains("/") && tokens[6].contains("AV"))
{
restoredTRDVAV++;
String[] split = tokens[6].split("/");
tokens[6] = "TR" + split[1] + "/" + split[0].replaceAll("TR", "");
}

List<String> chains = new ArrayList<>();
String vGeneChain = null;
String jGeneChain = null;
Expand Down Expand Up @@ -914,6 +924,7 @@ else if (uniqueChains.size() == 2)
}

log.info("\tChimeric calls recovered: " + chimericCallsRecovered);
log.info("\tTRDV/AV calls restored: " + restoredTRDVAV);
}
}

Expand Down

0 comments on commit 8700018

Please sign in to comment.