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

Proposal to evolve to HTSJDK version 3 (DO NOT MERGE) #928

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions htsjdk3-dev/htsjdk-core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# HTSJDK-CORE

Contains common code and interface/api definitions.

Includes SAM/BAM, VCF and tribble support.

Should not include significant dependencies.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Contains SAM support.
*
* @author Daniel Gomez-Sanchez (magicDGS)
*/
package htsjdk.samtools;
35 changes: 35 additions & 0 deletions htsjdk3-dev/htsjdk-core/src/main/java/htsjdk/tribble/Feature.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2017 Daniel Gomez-Sanchez
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package htsjdk.tribble;


import htsjdk.util.Locatable;

/**
* Marker interface for Locatables with Tribble support. A Feature represents a record in a tribble-supported file format.
* As {@link Locatable}, represents a locus on a reference sequence and is expected to return 1-based closed-ended intervals.
*/
public interface Feature extends Locatable {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Support for indexed and query-able genomic file formats.
*
* @author Daniel Gomez-Sanchez (magicDGS)
*/
package htsjdk.tribble;
48 changes: 48 additions & 0 deletions htsjdk3-dev/htsjdk-core/src/main/java/htsjdk/util/Locatable.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2017 Daniel Gomez-Sanchez
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

package htsjdk.util;

/**
* Any class that has a single logical mapping onto the genome should implement Locatable
* positions should be reported as 1-based and closed at both ends.
*/
public interface Locatable {

/**
* Gets the contig name for the contig this is mapped to. May return null if there is no unique mapping.
* @return name of the contig this is mapped to, potentially null
*/
String getContig();

/**
* @return 1-based start position, undefined if getContig() == null
*/
int getStart();

/**
* @return 1-based closed-ended position, undefined if getContig() == null
*/
int getEnd();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Common utilies.
*
* @author Daniel Gomez-Sanchez (magicDGS)
*/
package htsjdk.util;
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
*
*
* @author Daniel Gomez-Sanchez (magicDGS)
*/
package htsjdk.variant;
3 changes: 3 additions & 0 deletions htsjdk3-dev/htsjdk-cram/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# HTSJDK-CRAM

Includes support for CRAM format.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Support for CRAM format.
*
* @author Daniel Gomez-Sanchez (magicDGS)
*/
package htsjdk.samtools.cram;
3 changes: 3 additions & 0 deletions htsjdk3-dev/htsjdk-jexl/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# HTSJDK-JEXL

Includes support for JEXL expressions in VariantContext.
3 changes: 3 additions & 0 deletions htsjdk3-dev/htsjdk-sra/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# HTSJDK-SRA

Includes support for SRA format.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* SRA support.
*
* @author Daniel Gomez-Sanchez (magicDGS)
*/
package htsjdk.samtools.sra;
31 changes: 31 additions & 0 deletions src/main/java/htsjdk/Htsjdk3.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package htsjdk;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* Marker interface to indicate the status of the class in the HTSJDK3 development.
*
* @author Daniel Gomez-Sanchez (magicDGS)
*/
@Retention(RetentionPolicy.CLASS)
@Target({
ElementType.ANNOTATION_TYPE,
ElementType.CONSTRUCTOR,
ElementType.FIELD,
ElementType.METHOD,
ElementType.TYPE
})
@Documented
public @interface Htsjdk3 {

/** Indicates the name of the new package if changed; if not changed, returns the empty String. */
public String newPackage();

/** Returns {@code true} if the port is backwards compatible; {@code false} otherwise. */
public boolean backwardsCompatible();

}
3 changes: 3 additions & 0 deletions src/main/java/htsjdk/samtools/util/Locatable.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package htsjdk.samtools.util;

import htsjdk.Htsjdk3;

/**
* Any class that has a single logical mapping onto the genome should implement Locatable
* positions should be reported as 1-based and closed at both ends
*
*/
@Htsjdk3(newPackage = "", backwardsCompatible = true)
public interface Locatable {

/**
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/htsjdk/tribble/Feature.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@
package htsjdk.tribble;


import htsjdk.Htsjdk3;
import htsjdk.samtools.util.Locatable;

/**
* Marker interface for Locatables with Tribble support. A Feature represents a record in a tribble-supported file format.
* As {@link Locatable}, represents a locus on a reference sequence and is expected to return 1-based closed-ended intervals.
*/
@Htsjdk3(newPackage = "", backwardsCompatible = false)
public interface Feature extends Locatable {

/**
Expand Down