[Biojava-l] make feature to create embl or genbank file

Richard Holland holland at eaglegenomics.com
Thu Jun 30 09:36:12 UTC 2011


There is a coding problem in ThinRichSequence (from which SimpleRichSequence and others extend) that allow only Set<Feature> as input, but require the Feature objects to actually be RichFeature objects. This was for a number of reasons that probably seemed good at the time but I have now forgotten what they were. The workaround is to declare your set as a Set<Feature> but populate it with RichFeature objects (as RichFeature extends Feature and so the Set will still accept them).

The code is being phased out in favour of the new BJ3 model so it is unlikely to be fixed, but hopefully this workaround solves your particular case.

cheers,
Richard

On 30 Jun 2011, at 10:02, Hedwig Kurka wrote:

> I already built the set<RichFeature> and populated it.
> Now I want to give it the RichSequence. But when I do that in that line:
> 
> rs.setRichFeatureSet(rfeatSet);
> 
> It says, that it needs a Set<Feature>
> 
> Regards,
> Hedwig
> 
>> I'm not sure what you're trying to do - if you want to build a Set, you can just use the standard Java Collections API to create and populate a Set?
>> 
>> cheers,
>> Richard
>> 
>> On 30 Jun 2011, at 09:12, Hedwig Kurka wrote:
>> 
>> 
>>> Hi Richard,
>>> 
>>> Thank you for your answer.
>>> If I create RichFeature objects, then I have to do conversions in that line:
>>> RichFeature f = (RichFeature) seq.createFeature(t);
>>> and then I have in that line:
>>> rs.setRichFeatureSet(rfeatSet);
>>> the problem, that I have a Set<RichFeature> and not Set<Feature>, but I
>>> didn't find a method builds a Set containing RichFeature objects on a
>>> RichSequence. Is there one?
>>> 
>>> 
>>> 
>>>> The conversion from Feature to RichFeature does its best but is not
>>>> ideal. As you already have a RichSequence object to work with then you
>>>> would be better creating native RichFeature objects instead of doing
>>>> conversions.
>>>> 
>>>> Richard Holland
>>>> Eagle Genomics Ltd
>>>> Sent from my HTC
>>>> 
>>>> 
>>>> 
>>>> 
>>> 
>> --
>> Richard Holland, BSc MBCS
>> Operations and Delivery Director, Eagle Genomics Ltd
>> T: +44 (0)1223 654481 ext 3 | E: holland at eaglegenomics.com
>> http://www.eaglegenomics.com/
>> 
>> 
>> 
>> 
> 

--
Richard Holland, BSc MBCS
Operations and Delivery Director, Eagle Genomics Ltd
T: +44 (0)1223 654481 ext 3 | E: holland at eaglegenomics.com
http://www.eaglegenomics.com/





More information about the Biojava-l mailing list