[Biojava-l] Getting features with the same Location
Richard Holland
holland at eaglegenomics.com
Thu Dec 11 10:55:47 UTC 2008
Are you using BioSQL?
If you are, take a look at the BioSQLFeatureFilter classes. These will
construct a query which will only return the features you are
specifically interested in.
This bit of code should work once you've connected your BioJava instance
to BioSQL (from an earlier post by Gabrielle Doan):
public FeatureHolder filterFeature(String name, int startpos, int
endpos) {
RichLocation rl = new SimpleRichLocation(new
SimplePosition(startpos),
new SimplePosition(endpos), 0);
BioSQLFeatureFilter filter = new BioSQLFeatureFilter.And(
new
BioSQLFeatureFilter.BySequenceName(name),
new
BioSQLFeatureFilter.OverlapsRichLocation(rl));
return BioSQLRichSequenceDB.filter(filter);
}
However, please note that Gabrielle reported a bug on the mailing list
back in October with the above code. It's unclear whether or not it's
yet been fixed as I can't find the entry in BugZilla.
cheers,
Richard
Augusto Fernandes Vellozo wrote:
> Hi everyone.
>
> I need to get all features of a sequence that are on the same location L.
> I was thinking to do this getting all features of the sequence and
> after executing the equals(L) for each one.
> But, I have a lot of features in a sequence. I am trying to reduce the
> resultset of features to test the equals, getting only the features
> that start in the position L.getMin()
>
> Please, someone knows how can I do this?
>
> Thanks,
>
--
Richard Holland, BSc MBCS
Finance Director, Eagle Genomics Ltd
M: +44 7500 438846 | E: holland at eaglegenomics.com
http://www.eaglegenomics.com/
More information about the Biojava-l
mailing list