[Biojava-l] SortedFeatureHolder (by location)

pootle monster pootle_monster@hotmail.com
Tue, 02 Jul 2002 15:44:29 +0000


>The simple and dirty solution here, is to just have your Sequence class 
>have a constructor that takes an object of type Sequence.
>The constructor just copies the data from the Sequence class ( that you get 
>from SeqIOTools.readEMBL(br) ) into your own
>class. It will be about 20 lines of code or so ( from a quick look at my 
>own code that does just this ).
>

I have made my own OrderedSequence Object
constructed thus

Sequence sequenceLoaded = null;
SequenceIterator stream = SeqIOTools.readEmbl(br);
stream = SeqIOTools
while (stream.hasNext())
  sequenceLoaded = stream.nextSequence();

Sequence orderedSequence = new 
OrderedSequence(sequenceLoaded.subList(1,sequenceLoaded.length()), 
sequenceLoaded.getURN(), sequenceLoaded.getName(), 
sequenceLoaded.getAnnotation());


that is all fine but I now can not see how to add features to it
I would like to do somthing like this:

Iterator featureIterator = sequenceLoaded.features();
while(featureIterator.hasNext()){
orderedSequence.add(featureIterator.next());
}

but there is no add in the Sequence interface
so I am going to have to use

orderedSequence.createFeature(Feature.Template ft);

the problem with this is that I would have to create the Templates and there 
are several different types (eg StrandedFeature and RNAFeature) so I would 
have to check which it is then construct that type - seems nasty?

ps
how do I find/join/logon  biojava on irc.openprojects.net

_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com