[Biopython-dev] A modification to BioSQL

Brian Osborne bosborne11 at verizon.net
Wed Jun 24 17:10:32 UTC 2015


Peter,

This feature is equivalent to the second BioPython feature I showed:

my $feat = Bio::SeqFeature::Generic->new(
    -primary_tag => "test_domain",
    -start       => 8,
    -end         => 15,
    -strand      => 1,
    -host => 'human’, 
    -source => 'NCBI' 
);

This works, the source term is set to ‘NCBI’, like in BioPython.

This also works in the same way, no surprise:

my $feat = Bio::SeqFeature::Generic->new(
    -primary_tag => "test_domain",
    -start       => 8,
    -end         => 15,
    -strand      => 1,
    -host        =>  ‘human'
);
$feat->source_tag('NCBI');

This does not work, although it should, IMO:

my $feat = Bio::SeqFeature::Generic->new(
    -primary_tag => "test_domain",
    -start       => 8,
    -end         => 15,
    -strand      => 1,
    -tag         => { host => 'human', source => 'NCBI' }
);

Have to admit, it’s debatable whether this should work or not.

And this does not work:

my $feat = Bio::SeqFeature::Generic->new(
    -primary_tag => "test_domain",
    -start       => 8,
    -end         => 15,
    -strand      => 1,
    -host => 'human’, 
);

Error:

MSG: insert in Bio::DB::BioSQL::SeqFeatureAdaptor (driver) failed, values were ("","1") FKs (34926,5443,<NULL>)
Column 'source_term_id' cannot be null

So, 2 differences:

- BioPython supplies that default source term, and BioPerl does not
- Bioperl has source_tag() to help you add a source term

Don’t know about BioRuby, BioJava.

Thanks again,

Brian O.


> On Jun 24, 2015, at 12:17 PM, Peter Cock <p.j.a.cock at googlemail.com> wrote:
> 
> Thanks Brian,
> 
> OK, good. Now since you also seem familiar with the
> BioPerl/BioSQL setup, does it also look for a special
> qualifier "source" in the same way?
> 
> i.e. Is this equivalent to the BioPerl source_tag() method.
> mentioned earlier?
> 
> (You could probably test this with a hand edited GenBank
> file adding a "source" qualifier to a pre-existant feature
> then loading it into BioSQL with BioPerl - I don't think I
> have a suitable test setup up and running the moment
> to try that myself.)
> 
> If so, then I'll look at getting the PR updated, tested,
> and merged in.
> 
> Peter
> 
> On Wed, Jun 24, 2015 at 4:58 PM, Brian Osborne <bosborne11 at verizon.net> wrote:
>> Peter,
>> 
>> Tested the ctSkennerton code, it does what you’d expect. When a SeqRecord is loaded with a feature like this:
>> 
>> feat = SeqFeature(loc, qualifiers={"host": "human"}, type="test_domain")
>> 
>> the SeqFeature in the database has the default “source_term” of 'EMBL/GenBank/SwissProt’.
>> 
>> But this:
>> 
>> feat = SeqFeature(loc, qualifiers={"source": "NCBI", "host": "human"}, type="test_domain”)
>> 
>> sets the source_term to “NCBI”.
>> 
>> Thanks again,
>> 
>> Brian O.
>> 
>>> On Jun 23, 2015, at 9:49 AM, Brian Osborne <bosborne11 at verizon.net> wrote:
>>> 
>>> Peter,
>>> 
>>> Yes, will test.
>>> 
>>> Thanks once again.
>>> 
>>> BIO
>>> 
>>> 
>>>> On Jun 23, 2015, at 9:41 AM, Peter Cock <p.j.a.cock at googlemail.com> wrote:
>>>> 
>>>> On Tue, Jun 23, 2015 at 2:34 PM, Brian Osborne <bosborne11 at verizon.net> wrote:
>>>>> Peter,
>>>>> 
>>>>> So that code submitted by ctSkennerton would certainly work for me as well.
>>>>> Looks like you had no problem with the change, can the merge conflict be
>>>>> resolved?
>>>>> 
>>>>> Thanks again,
>>>>> 
>>>>> Brian O.
>>>> 
>>>> I'm not sure what's up with TravisCI and a possible merge conflict.
>>>> Any conflict is likely just cosmetic.
>>>> 
>>>> Could you try testing if ctSkennerton's branch works for you?
>>>> 
>>>> (You'd need to know basic git, and be able to install Biopython
>>>> from source - fairly easy under Linux or Mac OS X)
>>>> 
>>>> Peter
>>> 
>>> 
>>> _______________________________________________
>>> Biopython-dev mailing list
>>> Biopython-dev at mailman.open-bio.org
>>> http://mailman.open-bio.org/mailman/listinfo/biopython-dev
>> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.open-bio.org/pipermail/biopython-dev/attachments/20150624/41ea1d11/attachment.html>


More information about the Biopython-dev mailing list