Skip to content

Commit

Permalink
Sage: added artefact unit test, bumped version
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesshale committed Mar 6, 2024
1 parent 65bec1a commit 9e32d3f
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
<patient-db.version>5.34</patient-db.version>
<pave.version>1.6</pave.version>
<purple.version>4.0.2</purple.version>
<sage.version>3.4.1</sage.version>
<sage.version>3.4.2</sage.version>
<sigs.version>1.2.1</sigs.version>
<sv-prep.version>1.3</sv-prep.version>
<sv-tools.version>1.0</sv-tools.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,39 @@ record = buildSamRecord(20, cigar, readContextBases, new String(readQualities));
assertEquals(lowQualBase, adjustedBaseQual);
}

@Test
public void testSnvWithAdjacentInsert()
{
int pos = 115;
String leftFlank = "AAAATCAGGA";
String rightFlank = "AAAGGCAGAA";

SimpleVariant variant = new SimpleVariant(CHR_1, pos, "G", "T");

int varIndex = 15;
String readContextBases = leftFlank + "CTGTTTTTTTTTTTTTTTTTTA" + rightFlank;

IndexedBases indexBases = new IndexedBases(
pos, varIndex, leftFlank.length(),
readContextBases.length() - rightFlank.length() - 1, rightFlank.length(), readContextBases.getBytes());

ArtefactContext artefactContext = ArtefactContext.buildContext(variant, indexBases);
assertNotNull(artefactContext);

int readLength = readContextBases.length();
String cigar = format("%dM", readLength);
byte[] readQualities = buildDefaultBaseQuals(readLength);

byte lowQualBase = 10;
readQualities[varIndex-1] = lowQualBase;
SAMRecord record = buildSamRecord(20, cigar, readContextBases, new String(readQualities));
record.setReadNegativeStrandFlag(true);

byte adjustedBaseQual = artefactContext.findApplicableBaseQual(record, varIndex);

assertEquals(lowQualBase, adjustedBaseQual);
}

@Test
public void testSnvBeforeInsert()
{
Expand All @@ -281,7 +314,7 @@ public void testSnvBeforeInsert()
ReadContext readContext = new ReadContext(pos, "", 0, "", indexBases, false);

IndexedBases indexedRefBases = new IndexedBases(100, 0, refBases.getBytes());
QualityCalculator qualityCalculator = new QualityCalculator(TEST_CONFIG, RECALIBRATION, indexedRefBases);
QualityCalculator qualityCalculator = new QualityCalculator(TEST_CONFIG.Quality, RECALIBRATION, indexedRefBases);

ReadContextCounter rcCounter = new ReadContextCounter(
1, variant, readContext, VariantTier.PANEL, 100, 0,
Expand Down

0 comments on commit 9e32d3f

Please sign in to comment.