[Biojava-l] Getting features with the same Location

Augusto Fernandes Vellozo augustovmail-java at yahoo.com.br
Thu Dec 11 14:59:31 UTC 2008


Thanks Mark and Richard.

Yes Richard, I am using BIOSQL and Gabrielle said that she doesn't
know a solution to the problem.
Mark, if I use your suggestion, do I need to retrieve all features of
the sequence and analyze each one?

I am thinking to use direct SQL query to retrieve the features id whit
the same location start x of the sequence s and after to load each
feature of this resultset to test the equals(location). With this
filter, the quantity of the executions of equals(Location) will be
reduced a lot. The problem is: I don't have the sequence bioentry_id
to use in the direct SQL query. I have an object sequence but I don't
have access to bioentry_id.

Thanks,

Augusto

2008/12/11 Mark Schreiber <markjschreiber at gmail.com>:
> 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
>>
>



-- 
Augusto F. Vellozo



More information about the Biojava-l mailing list