diff --git a/uk/ac/sanger/artemis/io/GFFStreamFeature.java b/uk/ac/sanger/artemis/io/GFFStreamFeature.java index 4d304947d188ff720f2b67bfd72ad1a4569cd8ae..6c3bed741fcb222d97652890b942f0d29c46630c 100644 --- a/uk/ac/sanger/artemis/io/GFFStreamFeature.java +++ b/uk/ac/sanger/artemis/io/GFFStreamFeature.java @@ -20,7 +20,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * $Header: //tmp/pathsoft/artemis/uk/ac/sanger/artemis/io/GFFStreamFeature.java,v 1.4 2005-04-19 09:22:18 tjc Exp $ + * $Header: //tmp/pathsoft/artemis/uk/ac/sanger/artemis/io/GFFStreamFeature.java,v 1.5 2005-04-19 14:49:47 tjc Exp $ */ package uk.ac.sanger.artemis.io; @@ -35,15 +35,13 @@ import java.util.StringTokenizer; * A StreamFeature that thinks it is a GFF feature. * * @author Kim Rutherford - * @version $Id: GFFStreamFeature.java,v 1.4 2005-04-19 09:22:18 tjc Exp $ + * @version $Id: GFFStreamFeature.java,v 1.5 2005-04-19 14:49:47 tjc Exp $ **/ public class GFFStreamFeature extends SimpleDocumentFeature implements DocumentFeature, StreamFeature, ComparableFeature { - private String region_name = null; - /** * Create a new GFFStreamFeature object. The feature should be added * to an Entry (with Entry.add()). @@ -179,10 +177,7 @@ public class GFFStreamFeature extends SimpleDocumentFeature if(name.equals("ID")) name = "systematic_id"; - - region_name = line_bits.elementAt(0).trim(); - - if(name.equals("Name")) + else if(name.equals("Name")) name = type; if(values.size() == 0) @@ -246,9 +241,7 @@ public class GFFStreamFeature extends SimpleDocumentFeature start_base); final Range location_range = new Range(start_base, end_base); - final RangeVector location_ranges = new RangeVector(location_range); - setLocation(new Location(location_ranges, complement_flag)); } catch(ReadOnlyException e) @@ -268,17 +261,6 @@ public class GFFStreamFeature extends SimpleDocumentFeature } - /** - * - * The ID of the landmark used to establish the coordinate - * system for the current feature - GFF3. - * - */ - protected String getRegionName() - { - return region_name; - } - /** * * For gff-version 3: @@ -331,26 +313,6 @@ public class GFFStreamFeature extends SimpleDocumentFeature return return_value; } - /** - * Helper method for the constructor - returns a String that is the - * concatenation of the Strings in the given StringVector. The strings - * will be separated by four spaces - **/ - private String joinStringVector(final StringVector string_vector) - { - final StringBuffer return_buffer = new StringBuffer(); - - for(int i = 0 ; i < string_vector.size() ; ++i) - { - if(i != 0) - return_buffer.append(" "); - - return_buffer.append(string_vector.elementAt(i)); - } - - return return_buffer.toString(); - } - /** * Read and return a GFFStreamFeature from a stream. A feature must be the * next thing in the stream. diff --git a/uk/ac/sanger/artemis/io/SimpleDocumentEntry.java b/uk/ac/sanger/artemis/io/SimpleDocumentEntry.java index 7ffff76f6462390bb92b26178782f92f76dc71f5..77e3247de2a38ae35062a6c9885e73e8a9f8499c 100644 --- a/uk/ac/sanger/artemis/io/SimpleDocumentEntry.java +++ b/uk/ac/sanger/artemis/io/SimpleDocumentEntry.java @@ -20,7 +20,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * $Header: //tmp/pathsoft/artemis/uk/ac/sanger/artemis/io/SimpleDocumentEntry.java,v 1.8 2005-04-19 09:22:18 tjc Exp $ + * $Header: //tmp/pathsoft/artemis/uk/ac/sanger/artemis/io/SimpleDocumentEntry.java,v 1.9 2005-04-19 14:49:47 tjc Exp $ */ package uk.ac.sanger.artemis.io; @@ -37,7 +37,7 @@ import java.util.Enumeration; * This class contains the methods common to all DocumentEntry objects. * * @author Kim Rutherford <kmr@sanger.ac.uk> - * @version $Id: SimpleDocumentEntry.java,v 1.8 2005-04-19 09:22:18 tjc Exp $ + * @version $Id: SimpleDocumentEntry.java,v 1.9 2005-04-19 14:49:47 tjc Exp $ **/ abstract public class SimpleDocumentEntry @@ -244,8 +244,9 @@ abstract public class SimpleDocumentEntry while(gff_features.hasMoreElements()) { GFFStreamFeature feature = (GFFStreamFeature)gff_features.nextElement(); - String id = feature.getRegionName(); - if(id != null && id.equals(header_strings[i])) + Qualifier qualifier = feature.getQualifierByName("gff_seqname"); + + if(qualifier.getValues().contains(header_strings[i])) { try {