コード例 #1
0
ファイル: drepo.py プロジェクト: pharmacome/taubase
    def __init__(
        self,
        *,
        name: str,
        version: str,
        repositories: List[Union[BELRepository, BELSheetsRepository]],
        directory: Optional[str] = None,
    ) -> None:
        """Initialize a distributed repository.

        :param name: The name of the distributed repository
        :param version: The version of the distributed repository, independent of the constituent
         repositories' versions
        :param repositories: A list of BEL repositories
        """
        self.name = name
        self.repositories = repositories
        self.directory = directory

        for repository in self.repositories:
            if not hasattr(repository, 'metadata'):
                raise TypeError(f'Missing metadata: {repository}')

        self.dependency_version = '/'.join(repository.metadata.version
                                           for repository in self.repositories)
        self.version = f'{version} ({self.dependency_version})'
        self.authors = serialize_authors({
            author.strip()
            for repository in self.repositories
            for author in repository.metadata.authors.split(',')
        })
        self.description = """A distributed repository of several repositories: {}""".format(
            f'{repository.metadata.name} v{repository.metadata.version}'
            for repository in self.repositories)
        self.metadata = BELMetadata(
            name=self.name,
            version=self.version,
            authors=self.authors,
            description=self.description,
        )
コード例 #2
0
ファイル: __init__.py プロジェクト: shounakbaksi2/covid19kg
# Author list will be sorted by name
AUTHORS = [
    'Alpha Tom Kodamullil',
    'Daniel Domingo-Fernández',
    'Martin Hofmann-Apitius',
    'Reagon Karki',
    'Shounak Baksi',
    'Yojana Gadiya',
]

# All metadata is grouped here
metadata = BELMetadata(
    name='COVID-19 Knowledge Graph',
    version=VERSION,
    authors=serialize_authors(AUTHORS),
    contact='*****@*****.**',
    description=
    "Knowledge graph for analysis of COVID-19 disease and potential drug and drug-targets.",
    license='Creative Commons Zero v1.0 Universal',
)

repository = BELRepository(
    HERE,
    metadata=metadata,
)

get_graph = repository.get_graph
get_graphs = repository.get_graphs
get_summary_df = repository.get_summary_df
コード例 #3
0
    'repository',
    'main',
]

AUTHORS = [
    'Charles Tapley Hoyt',
    'Daniel Domingo-Fernández',
    'Esther Wollert',
    'Sandra Spalek',
    'Keerthika Lohanadan',
    'Rana Al Disi',
    'Lingling Xu',
    'Kristian Kolpeja',
]

AUTHOR_STRING = serialize_authors(AUTHORS)

# Folder pointers
HERE = os.path.abspath(os.path.dirname(__file__))
CURATION_DIRECTORY = os.path.join(HERE, 'curation')

VERSION = '0.1.1'

metadata = BELMetadata(
    name='HBP Semi-Automated Curation',
    version=VERSION,
    description="This knowledge graph contains content generated with the semi-automated curation workflow"
                "in the Human Brain Pharmacome project.",
    authors=AUTHOR_STRING,
    contact='*****@*****.**',
    license='CC BY 4.0',