[Biojava-dev] new biojava3-ws feature Hmmer searches

Scooter Willis HWillis at scripps.edu
Mon Dec 19 16:04:32 UTC 2011


Andreas

Check out QuantityFeature and TextFeature in core as two implementations I
use to track Features  associated with a peptide.

If you run SequenceFeaturePanel in the biojava3-sequence-gui library you
will see how it is used. I don't think we list that as one of the modules
and got checked into an odd path in the source tree. The Sequence Feature
Renderer code is very cool in that I tried to handle the ability to wrap
sequences and have the feature renderers auto adjust. The difficulty is
dealing with a unknown number of overlapping features of the same type.
Probably worth putting up the SequenceFeaturePanel as a cookbook example
if it currently isn't listed.

Example code from SequenceFeaturePanel

ProteinSequence proteinSequence = new
ProteinSequence("ARNDCEQGHILKMFPSTWYVBZJXARNDCEQGHILKMFPSTWYVBZJXARNDCEQGHI
LKMFPSTWYVBZJXARNDCEQGHILKMFPSTWYVBZJXARNDCEQGHILKMFPSTWYVBZJXARNDCEQGHILKM
FPSTWYVBZJXARNDCEQGHILKMFPSTWYVBZJXARNDCEQGHILKMFPSTWYVBZJXARNDCEQGHILKMFPS
TWYVBZJX");
            QuantityFeature f1 = new QuantityFeature("HDX", "");
            f1.addQuantity(10);
            proteinSequence.addFeature(26, 34, f1);
            f1 = new QuantityFeature("HDX", "");
            f1.addQuantity(20);
            proteinSequence.addFeature(26, 45, f1);



You can then getFeatures() by type, position etc against the Sequence.
Since you can have a collection of different feature types that can be
returned you will need to use instanceof to find the one that you are
interested in. 

Let me know if you run into any problems or need anything specific to what
you are working on.

Scooter

On 12/19/11 10:47 AM, "Andreas Prlic" <andreas at sdsc.edu> wrote:

>Hi,
>
>I am currently working on a new feature for the web service module, It
>allows to submit a ProteinSequence to the Hmmer3 web site and returns
>Pfam domains that have been found on the sequence. At the present the
>class  responds with a  SortedSet<HmmerResult>, which wraps the data
>that is responded from the Hmmer web service. Instead I would like to
>use the FeatureInterface from the core module. Do we have  example
>code somewhere for how to correctly use this?
>
>Thanks,
>
>Andreas





More information about the biojava-dev mailing list