[Biojava-l] Remove features from a sequence

Keith James kdj at sanger.ac.uk
Mon Jun 23 10:25:27 EDT 2003


>>>>> "Mark" == Schreiber, Mark <mark.schreiber at agresearch.co.nz> writes:

    Mark> Hi - As this is the second time this has come up, Keith, can
    Mark> I put your solution on Biojava in Anger?

[...]

Hi,

Sure, feel free to do anything you like with it. Perhaps a link could
be added to the Iterator page at Sun's java site.

It may also be worth noting that you /can/ do this:

while (seqI.hasNext())
{
    Sequence seq = seqI.nextSequence();

    for (Iterator i = seq.features(); i.hasNext();)
    {
        i.next();
        i.remove();
    }
}

which is a way to avoid ConcurrentModificationException, but also a
way to avoid informing any listeners to Sequence that all its Features
have been stripped - and is likely to be bad.

cheers,

Keith

-- 

- Keith James <kdj at sanger.ac.uk> bioinformatics programming support -
- Pathogen Sequencing Unit, The Wellcome Trust Sanger Institute, UK -



More information about the Biojava-l mailing list