-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
the initial design of the SmithWaterman API caused a lot of unecessary complexity in GATK, so we've redesigned it to pass the parameters to the alignment call instead of in an initialization method
- Loading branch information
1 parent
be32186
commit 65f20d1
Showing
5 changed files
with
107 additions
and
86 deletions.
There are no files selected for viewing
72 changes: 0 additions & 72 deletions
72
src/main/java/org/broadinstitute/gatk/nativebindings/smithwaterman/SWAlignerArguments.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...ings/smithwaterman/SWAlignmentResult.java → .../smithwaterman/SWNativeAlignerResult.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/main/java/org/broadinstitute/gatk/nativebindings/smithwaterman/SWOverhangStrategy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package org.broadinstitute.gatk.nativebindings.smithwaterman; | ||
|
||
/** | ||
* How overhangs should be treated during Smith-Waterman alignment | ||
*/ | ||
public enum SWOverhangStrategy { | ||
/* | ||
* Add softclips for the overhangs | ||
*/ | ||
SOFTCLIP, | ||
|
||
/* | ||
* Treat the overhangs as proper insertions/deletions | ||
*/ | ||
INDEL, | ||
|
||
/* | ||
* Treat the overhangs as proper insertions/deletions for leading (but not trailing) overhangs. | ||
* This is useful e.g. when we want to merge dangling tails in an assembly graph: because we don't | ||
* expect the dangling tail to reach the end of the reference path we are okay ignoring trailing | ||
* deletions - but leading indels are still very much relevant. | ||
*/ | ||
LEADING_INDEL, | ||
|
||
/* | ||
* Just ignore the overhangs | ||
*/ | ||
IGNORE | ||
} |
57 changes: 57 additions & 0 deletions
57
src/main/java/org/broadinstitute/gatk/nativebindings/smithwaterman/SWParameters.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package org.broadinstitute.gatk.nativebindings.smithwaterman; | ||
|
||
/** | ||
* a set of parameters to configure Smith-Waterman assembly | ||
*/ | ||
public class SWParameters { | ||
private final int matchValue; | ||
private final int mismatchPenalty; | ||
private final int gapOpenPenalty; | ||
private final int gapExtendPenalty; | ||
|
||
/** | ||
* Create a new set of parameters for Smith-Waterman alignment | ||
* @param matchValue how much to reward a match during alignment >= 0 | ||
* @param mismatchPenalty how much to penalize a mismatch during alignment <= 0 | ||
* @param gapOpenPenalty how much penalize the creation of a new gap in the alignment <= 0 | ||
* @param gapExtendPenalty how much to penalize extending an already open gap in the alignment <= 0 | ||
*/ | ||
public SWParameters(final int matchValue, final int mismatchPenalty, final int gapOpenPenalty, final int gapExtendPenalty) { | ||
if( matchValue < 0 ) { | ||
throw new IllegalArgumentException("matchValue must be >= 0 but was passed as " + matchValue); | ||
} | ||
if( mismatchPenalty > 0 ) { | ||
throw new IllegalArgumentException("mismatchPenalty must be <= 0 but was passed as " + mismatchPenalty); | ||
} | ||
if( gapOpenPenalty > 0 ) { | ||
throw new IllegalArgumentException("gapOpenPenalty must be <= 0 but was passed as " + gapOpenPenalty); | ||
} | ||
if( gapExtendPenalty > 0 ) { | ||
throw new IllegalArgumentException("gapExtendPenalty must be <= 0 but was passed as " + gapExtendPenalty); | ||
} | ||
this.matchValue = matchValue; | ||
this.mismatchPenalty = mismatchPenalty; | ||
this.gapOpenPenalty = gapOpenPenalty; | ||
this.gapExtendPenalty = gapExtendPenalty; | ||
} | ||
|
||
/** gap extension penalty **/ | ||
public int getGapExtendPenalty() { | ||
return gapExtendPenalty; | ||
} | ||
|
||
/** match value **/ | ||
public int getMatchValue() { | ||
return matchValue; | ||
} | ||
|
||
/** mismatch penalty **/ | ||
public int getMismatchPenalty() { | ||
return mismatchPenalty; | ||
} | ||
|
||
/** gap open penalty **/ | ||
public int getGapOpenPenalty() { | ||
return gapOpenPenalty; | ||
} | ||
} |