[Biojava-l] Getting features with the same Location

Mark Schreiber markjschreiber at gmail.com
Thu Dec 11 14:19:02 UTC 2008


You might also want to use the LocationTools class to determine if the
locations of the two features intersect or if one wholey contains
another.

- Mark

On Thu, Dec 11, 2008 at 6:55 PM, Richard Holland
<holland at eaglegenomics.com> wrote:
> 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/
> _______________________________________________
> Biojava-l mailing list  -  Biojava-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/biojava-l
>



More information about the Biojava-l mailing list