biopython/biopython — pull request #366 by ctSkennerton (2014-10-05 05:58:22+00:00)
Title: Added ability to change the seqfeature source

Added a new kwarg to BioSQL.Loader._load_seqfeature_basic that
allows the source to be changed dynamically based on the value
of the source qualifier found in the annotations of the SeqRecord

Background:
GFF files set aside column 2 for the source of the feature that
is set to the value of the program/algorithm that generated that
feature. Parsing a gff file using BCBio.GFF returns a SeqRecord
object that contains the source as a qualifier key-value pair.
Normally these key-value pairs are loaded into the
seqfeature_qualifier_value table, but the BioSQL wiki suggests that the
source should instead go into the term table.

The current code in biopython sets the value of source for a
seqfeature to be the same value regardless of whether the SeqRecord
object contains the source qualifier. This change adds in code that
will search for a source qualifier in the SeqRecord, set the value to
the source of the seqfeature and remove the key from the SeqRecord
qualifiers dict so that it is not mistakenly added to the
seqfeature_qualifier_value table