def run(self): sequence_index = self.coord.sequence id = self.target.sequence_information.setdefault('uniprot-id')[sequence_index] if not id: id = UniprotID.from_msa_sequence(self.target, sequence_index) self.target.sequence_information.add_entries(id) url = 'http://pfam.sanger.ac.uk/protein?output=xml&entry=' xml = urllib2.urlopen(url + id.sequence_id) root = etree.parse(xml, NamespaceIgnorantXMLTreeBuilder()).getroot() features = parse_pfam_protein_etree(root, self.target, sequence_index, id.sequence_id) if features is None: raise ValueError('the Pfam sequence does not match/contain the MSA sequence') self.target.features.add_features(features)
def applicable(cls, target, coord=None): if not coord or coord.sequence is None: return if target.msaview_classname != 'data.msa': return entry = target.sequence_information.get_entry('uniprot-id', coord.sequence) if not entry: entry = UniprotID.from_msa_sequence(target, coord.sequence) if not entry.sequence_id: return a = cls(target, coord) a.path = list(cls.path) a.path[-1] %= entry.sequence_id return a
def run(self): sequence_index = self.coord.sequence etree_category = self.target.sequence_information.setdefault('uniprot-etree') etree_entry = etree_category[sequence_index] if not etree_entry: id_category = self.target.sequence_information.setdefault('uniprot-id') id_entry = id_category[sequence_index] if not id_entry: id_entry = UniprotID.from_msa_sequence(self.target, self.coord.sequence) self.target.sequence_information.add_entries(id_entry) etree_entry = dbfetch_uniprot_xml_for_sequence(self.target, sequence_index) self.target.sequence_information.add_entries(etree_entry) structures_entry = PDBStructures.from_uniprot_etree(etree_entry) self.target.sequence_information.setdefault('pdb-ids') self.target.sequence_information.add_entries(structures_entry)
def applicable(cls, target, coord=None): if not coord or coord.sequence is None: return if target.msaview_classname != 'data.msa': return etree_entry = target.sequence_information.get_entry('uniprot-etree', coord.sequence) if etree_entry: if etree_entry.root is None: return return cls(target, coord) id_entry = target.sequence_information.get_entry('uniprot-id', coord.sequence) if not id_entry: id_entry = UniprotID.from_msa_sequence(target, coord.sequence) if not id_entry.sequence_id: return return cls(target, coord)