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

Add NamedFeature for common interface to name in bed or interval_list #1680

Merged
merged 3 commits into from
Aug 9, 2023
Merged
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
4 changes: 2 additions & 2 deletions src/main/java/htsjdk/samtools/util/Interval.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
package htsjdk.samtools.util;

import htsjdk.samtools.SAMException;
import htsjdk.tribble.Feature;
import htsjdk.tribble.NamedFeature;
import htsjdk.tribble.annotation.Strand;

import java.util.Collection;
Expand All @@ -34,7 +34,7 @@
*
* @author Tim Fennell
*/
public class Interval implements Comparable<Interval>, Cloneable, Feature {
public class Interval implements Comparable<Interval>, Cloneable, NamedFeature {
private final boolean negativeStrand;
private final String name;
private final String contig;
Expand Down
33 changes: 33 additions & 0 deletions src/main/java/htsjdk/tribble/NamedFeature.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* The MIT License
*
* Copyright (c) 2023 The Broad Institute
*
* 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;


/**
* An interface for features provided via an interval file, e.g. bed or interval_list.
* Provides a common interface for accessing the name column for both of these file types.
*/
public interface NamedFeature extends Feature {
String getName();
}
6 changes: 2 additions & 4 deletions src/main/java/htsjdk/tribble/bed/BEDFeature.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/
package htsjdk.tribble.bed;

import htsjdk.tribble.Feature;
import htsjdk.tribble.NamedFeature;
import htsjdk.tribble.annotation.Strand;

import java.awt.*;
Expand All @@ -36,7 +36,7 @@
* This is different than the 0-based representation in a BED file. This conversion is handled by {@link BEDCodec}.
* Anyone writing a bed file should be aware of this difference.
*/
public interface BEDFeature extends Feature {
public interface BEDFeature extends NamedFeature {
Strand getStrand();

String getType();
Expand All @@ -47,8 +47,6 @@ public interface BEDFeature extends Feature {

java.util.List<FullBEDFeature.Exon> getExons();

String getName();

float getScore();

String getLink();
Expand Down