From 18ed4653a113640c0d10f65b353a3a52184d2f2d Mon Sep 17 00:00:00 2001 From: tjc <tjc@ee4ac58c-ac51-4696-9907-e4b3aa274f04> Date: Tue, 4 Jul 2006 15:59:38 +0000 Subject: [PATCH] changes to ChadoCanonicalGene git-svn-id: svn+ssh://svn.internal.sanger.ac.uk/repos/svn/pathsoft/artemis/trunk@4513 ee4ac58c-ac51-4696-9907-e4b3aa274f04 --- uk/ac/sanger/artemis/io/GFFDocumentEntry.java | 31 +++++++++++++------ 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/uk/ac/sanger/artemis/io/GFFDocumentEntry.java b/uk/ac/sanger/artemis/io/GFFDocumentEntry.java index 7daeda295..6ef468b6a 100644 --- a/uk/ac/sanger/artemis/io/GFFDocumentEntry.java +++ b/uk/ac/sanger/artemis/io/GFFDocumentEntry.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/GFFDocumentEntry.java,v 1.26 2006-07-04 11:05:49 tjc Exp $ + * $Header: //tmp/pathsoft/artemis/uk/ac/sanger/artemis/io/GFFDocumentEntry.java,v 1.27 2006-07-04 15:59:38 tjc Exp $ */ package uk.ac.sanger.artemis.io; @@ -37,7 +37,7 @@ import java.sql.Timestamp; * A DocumentEntry that can read an GFF entry from a Document. * * @author Kim Rutherford - * @version $Id: GFFDocumentEntry.java,v 1.26 2006-07-04 11:05:49 tjc Exp $ + * @version $Id: GFFDocumentEntry.java,v 1.27 2006-07-04 15:59:38 tjc Exp $ **/ public class GFFDocumentEntry extends SimpleDocumentEntry @@ -343,22 +343,35 @@ public class GFFDocumentEntry extends SimpleDocumentEntry **/ public void combineChadoExons(ChadoCanonicalGene gene) { - Hashtable exons = gene.getExons(); - final Enumeration enum_exons = exons.keys(); + Vector transcripts = (Vector)gene.getTranscripts(); + final RangeVector new_range_vector = new RangeVector(); QualifierVector qualifier_vector = new QualifierVector(); Hashtable id_range_store = new Hashtable(); Timestamp lasttimemodified = null; - while(enum_exons.hasMoreElements()) + + for(int i=0; i<transcripts.size(); i++) { - String transcript_id = (String)enum_exons.nextElement(); - Vector v_exons = (Vector)exons.get(transcript_id); + Feature transcript = (Feature)transcripts.get(i); + String transcript_id = null; + try + { + transcript_id = (String)(transcript.getQualifierByName("ID").getValues().get(0)); + } + catch(InvalidRelationException e1) + { + e1.printStackTrace(); + } + Vector v_exons = (Vector)gene.getExonsOfTranscript(transcript_id); + + if(v_exons == null) + continue; - for(int i=0; i<v_exons.size(); i++) + for(int j=0; j<v_exons.size(); j++) { final GFFStreamFeature this_feature = - (GFFStreamFeature)v_exons.get(i); + (GFFStreamFeature)v_exons.get(j); // use the most current lastmodified datestamp if(this_feature.getLastModified() != null && -- GitLab