[Biojava-dev] RichSequence.Tools.enrich(..) generate NoSuchElementException

mark.schreiber at novartis.com mark.schreiber at novartis.com
Sun Jan 22 21:02:37 EST 2006


Hi -

Will have a look into this.

However, the enrich method is not the ideal way to do this. The method 
will do it's best to make a Sequence into a RichSequence but it usually 
cannot do a great job. Your best bet would be to use NCBI eutils to get 
sequences in GenBank or XML and then put them through the appropriate 
parser to directly generate a RichSequence.

As a todo, we should update GenbankSequenceDB to provide RichSequence 
instances (or deprecate it and provide an alternative).

- Mark





Janko Diminic <jdiminic at gmail.com>
Sent by: biojava-dev-bounces at portal.open-bio.org
01/21/2006 02:52 PM

 
        To:     biojava-dev at biojava.org
        cc:     (bcc: Mark Schreiber/GP/Novartis)
        Subject:        [Biojava-dev] RichSequence.Tools.enrich(..) generate 
NoSuchElementException


Hi, RichSequence.Tools.enrich(seq) generate NoSuchElementException 
exception:

// Samples.java class

    Set param = new HashSet();
    param.add("AJ278573");   // NCBI accession

    GenbankSequenceDB genBank = new GenbankSequenceDB();
    SequenceDB sequences = genBank.getSequences(param);

    sequenceIterator = sequences.sequenceIterator();

while (sequenceIterator.hasNext()) {
        try {
              Sequence seq = sequenceIterator.nextSequence();
              RichSequence enrichSeq = RichSequence.Tools.enrich(seq);
  //line:92,  here throw NoSuchElementException ???

              session.saveOrUpdate("Sequence", enrichSeq);

              } catch (NoSuchElementException e) {
                     e.printStackTrace();
              }
        }



java.util.NoSuchElementException
    at 
java.util.LinkedHashMap$LinkedHashIterator.nextEntry(LinkedHashMap.java:367)
    at java.util.LinkedHashMap$KeyIterator.next(LinkedHashMap.java:376)
    at 
org.biojavax.bio.seq.SimpleRichFeature.<init>(SimpleRichFeature.java:96)
    at 
org.biojavax.bio.seq.SimpleRichSequence.createFeature(SimpleRichSequence.java:323)
    at 
org.biojavax.bio.seq.RichSequence$Tools.enrich(RichSequence.java:434)
    at hr.Samples.main(Samples.java:92)


Do you know way?
Thanks for the help.



--
Janko Diminic

_______________________________________________
biojava-dev mailing list
biojava-dev at biojava.org
http://biojava.org/mailman/listinfo/biojava-dev





More information about the biojava-dev mailing list