[Biojava-l] Cannot edit RichSequence larger than 16Kbp

Ian Yi-Feng Chang cif077 at gmail.com
Tue Apr 21 08:59:06 UTC 2009


Dear All,
I try to edit the sequence in GenBank flat file and try to preserve all
Annotations and Features of it.
Therefore I use following code to edit RichSequence.
However, the following code only works with sequence length < 16Kbp.
Is anything wrong in my code?

Thanks for your help.

import java.io.*;
import org.biojava.bio.seq.*;
import org.biojava.bio.symbol.*;
import org.biojavax.*;
import org.biojavax.bio.seq.*;
import org.biojavax.bio.seq.RichSequence.*;
import org.biojavax.bio.seq.io.*;
public class RichSequenceTest {
    public static void main(String[] args) throws Exception{
        SimpleRichSequenceBuilderFactory srsbf = new
SimpleRichSequenceBuilderFactory(new SimpleSymbolListFactory(),100000);
        RichSequence seq = IOTools.readGenbank(
                                           new BufferedReader(new
FileReader("/data/gbk/NC_011995q.gbk")),
                                          IOTools.getDNAParser(),
                                          srsbf,

RichObjectFactory.getDefaultNamespace()
                                          ).nextRichSequence();
         Edit ed = new Edit(3, 2, DNATools.createDNA("aatagaa"));
         seq.edit(ed);
         System.out.println(seq.seqString());
    }
}


Exception in thread "main" org.biojava.utils.ChangeVetoException:
AbstractSymbolList is immutable
    at
org.biojava.bio.symbol.AbstractSymbolList.edit(AbstractSymbolList.java:113)
    at
org.biojavax.bio.seq.DummyRichSequenceHandler.edit(DummyRichSequenceHandler.java:31)
    at org.biojavax.bio.seq.ThinRichSequence.edit(ThinRichSequence.java:163)
    at gizmo.test.RichSequenceTest.main(RichSequenceTest.java:20



More information about the Biojava-l mailing list