-
Notifications
You must be signed in to change notification settings - Fork 3
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
Sketch Locatable interface #6
base: master
Are you sure you want to change the base?
Conversation
Still requires some implementation of default behaviour, but depends on the discussion about API definitions. |
* @author Daniel Gomez-Sanchez (magicDGS) | ||
* @implSpec note that 0-length intervals are allowed in an implementation-dependent manner. | ||
*/ | ||
public interface Locatable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should extend Comparable
, but I think that it will be better to have a LocatableComparator
instead to allow different comprators to be use
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this should be comparable because there's no single consistent comparator, it depends on how you want to sort he chromosomes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't do.
* @see #getStart() | ||
* @see #getEnd() | ||
*/ | ||
default OptionalLong getLengthOnReference() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about not implementing this in the interface, but an utility class instead which throws if no end is provided.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forget about this comment.
* @implSpec should return {@code false} if {@code referenceMatch(other) == false}. | ||
* @see #withinDistanceOf(Locatable, int) | ||
*/ | ||
default boolean overlaps(Locatable other) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can add also more methods to pad/merge/etc. to make the interface complete...
* with respect to a reference). | ||
* </p> | ||
* | ||
* @author Daniel Gomez-Sanchez (magicDGS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want author's tags in the new code? My feeling has been that they rapidly become out of date and are handled better by git history. Do others feel differently?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was the default in my IDE - will remove!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
* > getEnd()}). | ||
* @see #getStart() | ||
*/ | ||
OptionalLong getEnd(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why make this optional? In a 1-based system a point just has end == start. Better to just require it I think and a point class can avoid storing it if they want. Adding an optional adds boxing overhead and complexity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returned as long now.
@@ -0,0 +1,140 @@ | |||
package org.samtools.htsjdk.core; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you feel by making a package that is called org.samtools.htsjdk.core.api
for the core interfaces and then a implementation-specific package? For example (just care about the api name, the rest are just first idea of how to name specific implementations):
Read
interface in theapi
package, andSAMRecord
implementation inorg.samtools.htsjdk.core.sam
Variant
interface in theapi
package, andVCFRecord
implementation inorg.samtools.htsjdk.core.vcf
6c79a97
to
4622ded
Compare
Rebased into the latest master (build system parts are removed). |
4622ded
to
cda6f0a
Compare
cda6f0a
to
03abb3d
Compare
No description provided.