def metadata_path(self, m_path):
"""Provide pointers to the paths of the metadata file
Args:
m_path: Path to metadata file
"""
if not m_path:
self.metadata_dir = None
self.metadata_file = None
else:
if not op.exists(m_path):
raise OSError('{}: file does not exist!'.format(m_path))
if not op.dirname(m_path):
self.metadata_dir = '.'
else:
self.metadata_dir = op.dirname(m_path)
self.metadata_file = op.basename(m_path)
# Parse the metadata file using Biopython's built in SeqRecord parser
# Just updating IDs and stuff
tmp_sr = SeqIO.read(self.metadata_path, 'uniprot-xml')
parsed = parse_uniprot_xml_metadata(tmp_sr)
self.update(parsed, overwrite=True)
评论列表
文章目录