Currently, nucleotide-residue linking happens when the residues property of Protein is accessed for the first time. However, this may lead to confusion when trying to query the coding status of a Nucleotide object before accessing Protein.residues, since the Nucleotide will have no associated Residue by default.
Possible solution(s):
add has_orfs attribute to Transcript and explicitly warn user when trying to access Nucleotide.residue for Transcript where has_orfs is True but no ORF or Protein objects have been loaded yet
change Transcript.orfs and ORF.protein loading strategy so that ORF and Protein objects always load with Transcript (could be slow?)
use SQLAlchemy event system to automatically call ORF._link_nt_to_aa() upon loading Protein
Currently, nucleotide-residue linking happens when the
residues
property ofProtein
is accessed for the first time. However, this may lead to confusion when trying to query the coding status of aNucleotide
object before accessingProtein.residues
, since theNucleotide
will have no associatedResidue
by default.Possible solution(s):
has_orfs
attribute toTranscript
and explicitly warn user when trying to accessNucleotide.residue
forTranscript
wherehas_orfs
isTrue
but noORF
orProtein
objects have been loaded yetTranscript.orfs
andORF.protein
loading strategy so thatORF
andProtein
objects always load withTranscript
(could be slow?)ORF._link_nt_to_aa()
upon loadingProtein