<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Peter,<div class=""><br class=""></div><div class="">So that code submitted by <span style="color: rgb(85, 85, 85); font-family: Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 14px; font-weight: bold; line-height: 20px; white-space: nowrap; background-color: rgb(255, 255, 255);" class="">ctSkennerton </span>would certainly work for me as well. Looks like you had no problem with the change, can the merge conflict be resolved?</div><div class=""><br class=""></div><div class="">Thanks again,</div><div class=""><br class=""></div><div class="">Brian O.</div><div class=""><span style="color: rgb(85, 85, 85); font-family: Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 14px; font-weight: bold; line-height: 20px; white-space: nowrap; background-color: rgb(255, 255, 255);" class=""><br class=""></span></div><div class=""><span style="color: rgb(85, 85, 85); font-family: Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 14px; font-weight: bold; line-height: 20px; white-space: nowrap; background-color: rgb(255, 255, 255);" class=""><br class=""></span></div><div class=""><div><blockquote type="cite" class=""><div class="">On Jun 22, 2015, at 5:22 PM, Brian Osborne <<a href="mailto:bosborne11@verizon.net" class="">bosborne11@verizon.net</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">Peter,<br class=""><br class="">Interesting exchange, was not aware of it.<br class=""><br class="">Yes, in BioPerl there’s a source_tag() method.<br class=""><br class="">Thanks again,<br class=""><br class="">Brian O.<br class=""><br class=""><blockquote type="cite" class="">On Jun 22, 2015, at 4:44 PM, Peter Cock <<a href="mailto:p.j.a.cock@googlemail.com" class="">p.j.a.cock@googlemail.com</a>> wrote:<br class=""><br class="">Hi Brian,<br class=""><br class="">Are you familiar with the logic BioPerl uses to set this field?<br class="">See also <a href="https://github.com/biopython/biopython/pull/366" class="">https://github.com/biopython/biopython/pull/366</a><br class=""><br class="">Peter<br class=""><br class="">On Mon, Jun 22, 2015 at 9:11 PM, Brian Osborne <<a href="mailto:bosborne11@verizon.net" class="">bosborne11@verizon.net</a>> wrote:<br class=""><blockquote type="cite" class="">All,<br class=""><br class="">I’ve been using the BioSQL schema with Bioperl and would like to start doing<br class="">the same with Biopython, but there’s a limitation I’d like to fix. Here’s<br class="">the relevant table in the BioSQL schema, seqfeature:<br class=""><br class=""> Column | Type | Modifiers<br class="">| Storage | Stats target | Description<br class="">----------------+-----------------------+---------------------------------------------------------+----------+--------------+-------------<br class="">seqfeature_id | integer | not null default<br class="">nextval('seqfeature_pk_seq'::regclass) | plain | |<br class="">bioentry_id | integer | not null<br class="">| plain | |<br class="">type_term_id | integer | not null<br class="">| plain | |<br class="">source_term_id | integer | not null<br class="">| plain | |<br class="">display_name | character varying(64) |<br class="">| extended | |<br class="">rank | integer | not null default 0<br class="">| plain | |<br class=""><br class="">Note that required field, source_term_id. In the work I’ve been doing with<br class="">Bioperl I’ve been setting this “source term” to different values (e.g.<br class="">“NCBI”) depending on where the tag/value data in the feature comes from.<br class=""><br class="">But here’s the code that makes a persistent feature, from BioSQL/Loader.py:<br class=""><br class=""> def _load_seqfeature_basic(self, feature_type, feature_rank,<br class="">bioentry_id):<br class=""> """Load the first tables of a seqfeature and returns the id<br class="">(PRIVATE).<br class=""><br class=""> This loads the "key" of the seqfeature (ie. CDS, gene) and<br class=""> the basic seqfeature table itself.<br class=""> """<br class=""> ontology_id = self._get_ontology_id('SeqFeature Keys')<br class=""> seqfeature_key_id = self._get_term_id(feature_type,<br class=""> ontology_id=ontology_id)<br class=""> # XXX source is always EMBL/GenBank/SwissProt here; it should depend<br class="">on<br class=""> # the record (how?)<br class=""> source_cat_id = self._get_ontology_id('SeqFeature Sources')<br class=""> source_term_id = self._get_term_id('EMBL/GenBank/SwissProt',<br class=""> ontology_id=source_cat_id)<br class=""><br class=""> sql = r"INSERT INTO seqfeature (bioentry_id, type_term_id, " \<br class=""> r"source_term_id, rank) VALUES (%s, %s, %s, %s)"<br class=""> self.adaptor.execute(sql, (bioentry_id, seqfeature_key_id,<br class=""> source_term_id, feature_rank + 1))<br class=""> seqfeature_id = self.adaptor.last_id('seqfeature')<br class=""><br class=""> return seqfeature_id<br class=""><br class="">This code always sets the source term to “ EMBL/GenBank/SwissProt”, and it<br class="">can not be set to anything else. A better idea is to have a method to set<br class="">and get this, e.g. source(), just as you can set the “type” of the feature.<br class="">The way to do this is to subclass SeqFeature to make DBSeqFeature, just as<br class="">Seq is subclassed to make DBSeq and SeqRecord is subclassed to make<br class="">DBSeqRecord in BioSQL/Seq.py.<br class=""><br class="">So I propose to fork, code, and send a pull request for this. What do you<br class="">think?<br class=""><br class="">Thanks again,<br class=""><br class="">Brian O.<br class=""><br class="">_______________________________________________<br class="">Biopython-dev mailing list<br class=""><a href="mailto:Biopython-dev@mailman.open-bio.org" class="">Biopython-dev@mailman.open-bio.org</a><br class="">http://mailman.open-bio.org/mailman/listinfo/biopython-dev<br class=""></blockquote></blockquote><br class=""><br class="">_______________________________________________<br class="">Biopython-dev mailing list<br class=""><a href="mailto:Biopython-dev@mailman.open-bio.org" class="">Biopython-dev@mailman.open-bio.org</a><br class="">http://mailman.open-bio.org/mailman/listinfo/biopython-dev</div></blockquote></div><br class=""></div></body></html>