[Biojava-dev] Filter features of a sequence from SequenceDB

Y D Sun nys1 at exch-srv.ncl.ac.uk
Tue May 27 12:54:56 EDT 2003


Dear all,

I create a sequence database and add EMBL sequences to it using
BioSQLSequenceDB() and addSequence().

Then, I read a sequence from the database using getSequence() and filter
its features like CDS using the code:

    //make a Filter for "CDS" types
    FeatureFilter ff = new FeatureFilter.ByType("CDS");

    //get the filtered Features
    FeatureHolder fh = seq.filter(ff);

    //iterate over the Features in fh
    for (Iterator i = fh.features(); i.hasNext(); ) {
      Feature f = (Feature)i.next();
      String s = f.getAnnotation().toString();
	System.out.println(s);
    }

The output is incorrect:

org.biojava.bio.seq.db.biosql.BioSQLFeatureAnnotation at 1f2ee1
org.biojava.bio.seq.db.biosql.BioSQLFeatureAnnotation at 3ecfff
org.biojava.bio.seq.db.biosql.BioSQLFeatureAnnotation at c99159
org.biojava.bio.seq.db.biosql.BioSQLFeatureAnnotation at 65a77f
org.biojava.bio.seq.db.biosql.BioSQLFeatureAnnotation at d7ad1c
... ...

If applying the code to a sequence read from a EMBL file using
readEmbl(), it can get CDS feature rightly. So, I think this problem may
be caused by the format of sequence. I haven't specified the format when
creating DB, addSequence and getSequence. 

I want to know the correct method to get the feature of a sequence from
SequenceDB, how to specify the format.

Thanks.

George Sun



More information about the biojava-dev mailing list