Skip to content
Snippets Groups Projects
Commit d5973e9d authored by tjc's avatar tjc
Browse files

ID fixed and id_range_store fix

git-svn-id: svn+ssh://svn.internal.sanger.ac.uk/repos/svn/pathsoft/artemis/trunk@4602 ee4ac58c-ac51-4696-9907-e4b3aa274f04
parent 12b02edc
Branches
Tags
No related merge requests found
......@@ -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.30 2006-07-28 08:34:30 tjc Exp $
* $Header: //tmp/pathsoft/artemis/uk/ac/sanger/artemis/io/GFFDocumentEntry.java,v 1.31 2006-08-01 15:34:22 tjc Exp $
*/
package uk.ac.sanger.artemis.io;
......@@ -38,7 +38,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.30 2006-07-28 08:34:30 tjc Exp $
* @version $Id: GFFDocumentEntry.java,v 1.31 2006-08-01 15:34:22 tjc Exp $
**/
public class GFFDocumentEntry extends SimpleDocumentEntry
......@@ -354,31 +354,25 @@ public class GFFDocumentEntry extends SimpleDocumentEntry
RangeVector new_range_vector;
QualifierVector qualifier_vector;
Hashtable id_range_store = new Hashtable();
Hashtable id_range_store;
Timestamp lasttimemodified = null;
Hashtable new_exon_set = new Hashtable();
for(int i=0; i<transcripts.size(); i++)
{
id_range_store = new Hashtable();
new_range_vector = new RangeVector();
qualifier_vector = new QualifierVector();
Feature transcript = (Feature)transcripts.get(i);
GFFStreamFeature transcript = (GFFStreamFeature)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 j=0; j<v_exons.size(); j++)
{
final GFFStreamFeature this_feature =
......@@ -405,7 +399,7 @@ public class GFFDocumentEntry extends SimpleDocumentEntry
if(id_qualifier != null)
{
String id = (String)(id_qualifier.getValues()).elementAt(0);
id_range_store.put(new_range, id);
id_range_store.put(id, new_range);
}
......@@ -434,6 +428,13 @@ public class GFFDocumentEntry extends SimpleDocumentEntry
new_feature.setLastModified(lasttimemodified);
new_feature.setSegmentRangeStore(id_range_store);
// set the ID
String ID = new_feature.getSegmentID(new_feature.getLocation().getRanges() );
Qualifier id_qualifier = new_feature.getQualifierByName("ID");
id_qualifier.removeValue( (String)(id_qualifier.getValues()).elementAt(0) );
id_qualifier.addValue(ID);
try
{
new_feature.setLocation(new_location);
......@@ -477,6 +478,7 @@ public class GFFDocumentEntry extends SimpleDocumentEntry
}
// now merge the exons in the ChadoCanonicalGene feature
Enumeration enum_exon_set = new_exon_set.keys();
int num = 0;
......@@ -640,14 +642,10 @@ public class GFFDocumentEntry extends SimpleDocumentEntry
else if(!qual.getName().equals("ID") &&
!qual.getName().equals("Alias"))
merge_qualifier_vector.setQualifier(qual);
else
else if(qual.getName().equals("Alias"))
{
final Qualifier id_qualifier;
if(qual.getName().equals("ID"))
id_qualifier = merge_qualifier_vector.getQualifierByName("ID");
else
id_qualifier = merge_qualifier_vector.getQualifierByName("Alias");
final Qualifier id_qualifier =
merge_qualifier_vector.getQualifierByName("Alias");
if(id_qualifier == null)
merge_qualifier_vector.addElement(qual);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment