def _add_meta(self, *args, **kwargs): """Add Ensembl metadata.""" metadata = SourceMeta( data_license="custom", data_license_url="https://useast.ensembl.org/info/about" "/legal/disclaimer.html", version=self._version, data_url=self._data_url, rdp_url=None, data_license_attributes={ "non_commercial": False, "share_alike": False, "attribution": False }, genome_assemblies=[self._assembly]) self._database.metadata.put_item( Item={ "src_name": SourceName.ENSEMBL.value, "data_license": metadata.data_license, "data_license_url": metadata.data_license_url, "version": metadata.version, "data_url": metadata.data_url, "rdp_url": metadata.rdp_url, "data_license_attributes": metadata.data_license_attributes, "genome_assemblies": metadata.genome_assemblies }) self._load_meta(self._database, metadata, SourceName.ENSEMBL.value)
def _add_meta(self, *args, **kwargs): """Add Ensembl metadata.""" metadata = SourceMeta( data_license='custom', data_license_url='https://useast.ensembl.org/info/about' '/legal/disclaimer.html', version=self._version, data_url=self._data_url, rdp_url=None, data_license_attributes={ 'non_commercial': False, 'share_alike': False, 'attribution': False }, genome_assemblies=[self._assembly]) self._database.metadata.put_item( Item={ 'src_name': SourceName.ENSEMBL.value, 'data_license': metadata.data_license, 'data_license_url': metadata.data_license_url, 'version': metadata.version, 'data_url': metadata.data_url, 'rdp_url': metadata.rdp_url, 'data_license_attributes': metadata.data_license_attributes, 'genome_assemblies': metadata.genome_assemblies }) self._load_meta(self._database, metadata, SourceName.ENSEMBL.value)
def _add_meta(self, *args, **kwargs): """Add HGNC metadata to the gene_metadata table.""" metadata = SourceMeta( data_license='custom', data_license_url='https://www.genenames.org/about/', version=self._version, data_url=self._data_url, rdp_url=None, data_license_attributes={ 'non_commercial': False, 'share_alike': False, 'attribution': False }, genome_assemblies=[]) self._load_meta(self._database, metadata, SourceName.HGNC.value)
def fetch_meta(self, src_name: str) -> SourceMeta: """Fetch metadata for src_name. :param str src_name: name of source to get metadata for :return: SourceMeta object containing source metadata """ if src_name in self.db.cached_sources.keys(): return self.db.cached_sources[src_name] else: try: db_response = self.db.metadata.get_item( Key={'src_name': src_name}) response = SourceMeta(**db_response['Item']) self.db.cached_sources[src_name] = response return response except ClientError as e: logger.error(e.response['Error']['Message'])
def _add_meta(self): """Load metadata""" metadata = SourceMeta( data_license="custom", data_license_url="https://www.ncbi.nlm.nih.gov/home/" "about/policies/", version=self._version, data_url=self._data_url, rdp_url="https://reusabledata.org/ncbi-gene.html", data_license_attributes={ 'non_commercial': False, 'share_alike': False, 'attribution': False }, genome_assemblies=[self._assembly]) self._load_meta(self._database, metadata, SourceName.NCBI.value)