Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple sv alt allele #1192

Merged
merged 1 commit into from
Oct 15, 2018

Conversation

SHuang-Broad
Copy link
Contributor

Description

Simple alt allele constants for SV.
Two implementations, not sure which one is preferred.

Checklist

  • Code compiles correctly
  • New tests covering changes and new functionality
  • All tests passing
  • Extended the README / documentation, if necessary
  • Is not backward compatible (breaks binary or source compatibility)

@SHuang-Broad
Copy link
Contributor Author

@droazen please review.
@LeeTL1220 please see this covers what you need.

@LeeTL1220
Copy link

@SHuang-Broad Yes, I just needed the constants.

Copy link
Contributor

@droazen droazen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Back to @SHuang-Broad with a couple of comments.

@@ -200,6 +200,11 @@ protected Allele(final Allele allele, final boolean ignoreRefState) {
public final static Allele NO_CALL = new Allele(NO_CALL_STRING, false);
public final static Allele NON_REF_ALLELE = new Allele(NON_REF_STRING, false);

public final static Allele SV_SIMPLE_DEL = new Allele(createBracketedSymbAlleleString(StructuralVariantType.DEL), false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you just call toSymbolicAltAllele() on the enum values directly, and get rid of createBracketedSymbAlleleString()?

public final static Allele SV_SIMPLE_INS = new Allele(createBracketedSymbAlleleString(StructuralVariantType.INS), false);
public final static Allele SV_SIMPLE_INV = new Allele(createBracketedSymbAlleleString(StructuralVariantType.INV), false);
public final static Allele SV_SIMPLE_CNV = new Allele(createBracketedSymbAlleleString(StructuralVariantType.CNV), false);
public final static Allele SV_SIMPLE_DUP = new Allele(createBracketedSymbAlleleString(StructuralVariantType.DUP), false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment above each SV allele declaration, describing what kind of variant it represents?

@codecov-io
Copy link

codecov-io commented Oct 10, 2018

Codecov Report

Merging #1192 into master will increase coverage by 0.002%.
The diff coverage is 77.778%.

@@               Coverage Diff               @@
##              master     #1192       +/-   ##
===============================================
+ Coverage     68.406%   68.408%   +0.002%     
- Complexity      8017      8018        +1     
===============================================
  Files            542       542               
  Lines          32693     32701        +8     
  Branches        5530      5530               
===============================================
+ Hits           22364     22370        +6     
- Misses          8126      8127        +1     
- Partials        2203      2204        +1
Impacted Files Coverage Δ Complexity Δ
...ain/java/htsjdk/variant/variantcontext/Allele.java 76.866% <100%> (+0.897%) 85 <0> (ø) ⬇️
.../variant/variantcontext/StructuralVariantType.java 80% <50%> (-20%) 2 <1> (+1)

@SHuang-Broad
Copy link
Contributor Author

@droazen please review again.

@@ -200,6 +199,16 @@ protected Allele(final Allele allele, final boolean ignoreRefState) {
public final static Allele NO_CALL = new Allele(NO_CALL_STRING, false);
public final static Allele NON_REF_ALLELE = new Allele(NON_REF_STRING, false);

// for simple deletion, e.g. "ALT==<DEL>" (not that the spec allows, for now at least, alt alleles like <DEL:ME>)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for myself: "not" -> "note"

@droazen droazen self-assigned this Oct 11, 2018
Copy link
Contributor

@droazen droazen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SHuang-Broad Back to you with a few more comments.

@@ -200,6 +199,16 @@ protected Allele(final Allele allele, final boolean ignoreRefState) {
public final static Allele NO_CALL = new Allele(NO_CALL_STRING, false);
public final static Allele NON_REF_ALLELE = new Allele(NON_REF_STRING, false);

// for simple deletion, e.g. "ALT==<DEL>" (not that the spec allows, for now at least, alt alleles like <DEL:ME>)
public final static Allele SV_SIMPLE_DEL = new Allele(StructuralVariantType.DEL.toSymbolicAltAllele(), false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't you just write public final static Allele SV_SIMPLE_DEL = StructuralVariantType.DEL.toSymbolicAltAllele(); here? (and similarly below)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opps. Went to quick at that. Yes you are right!

* @throws UnsupportedOperationException if this is invoked on a {@link #BND} object
*/
Allele toSymbolicAltAllele() {
if (this.equals(StructuralVariantType.BND))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add curly braces around if statement body.

@SHuang-Broad
Copy link
Contributor Author

@droazen I've squashed all commits into a single one.

@droazen
Copy link
Contributor

droazen commented Oct 15, 2018

👍 looks good to me -- @lbergelson can you merge?

Copy link
Member

@lbergelson lbergelson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems fine.

@lbergelson lbergelson merged commit 1971f4e into samtools:master Oct 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants