Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to update test instance #202

Closed
wants to merge 31 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
fc2b5ca
Add data_manager_mode argument fort IDC use
mvdbeek Mar 28, 2023
77978eb
Not sure if that was necessary
mvdbeek Apr 18, 2023
1b3df9b
All setting history name in run_data_managers.py
mvdbeek Jun 29, 2023
943b737
Pass args to get_or_create_history()
natefoo Jun 29, 2023
bb4494e
split genomes for IDC
jmchilton Jun 29, 2023
b808e90
Actually return the parser
natefoo Jun 30, 2023
6c01e0c
Fix _idc_split_data_manager_genomes parser
natefoo Jul 1, 2023
55157a8
Include description in fetch
natefoo Jul 1, 2023
b3de919
Add logging
natefoo Jul 1, 2023
3e96318
Set defaults compatible with run-data-managers
natefoo Jul 1, 2023
6c0ed8b
Handle empty items and data reload fields in run_data_managers.
jmchilton Jul 1, 2023
33f6b28
Don't serialize unset fields when splitting genomes.yml into run tasks.
jmchilton Jul 1, 2023
5e06467
Lint fixes & fix for adding __init__ in tests.
jmchilton Jul 1, 2023
542a883
Improved IDC linting...
jmchilton Jul 1, 2023
3a822dd
More shed linting...
jmchilton Jul 1, 2023
b0d0a0b
Test case for data manager tools YAML generation.
jmchilton Jul 1, 2023
7285560
Implement stages and filtering in IDC split script.
jmchilton Jul 1, 2023
7dc7107
New defaults... EPHEMERIS_GALAXY and EPHEMERIS_API_KEY
jmchilton Jul 1, 2023
fc3511a
Skip broken data table checking logic if no data table reloads are fo…
jmchilton Jul 1, 2023
d1752f8
Implement --tool-id-mode=short option to get short IDs for run-data-m…
jmchilton Jul 1, 2023
0ca7489
Try a newer galaxy.
jmchilton Jul 2, 2023
6fc5d9b
parameterize strategy for build tracking...
jmchilton Jul 2, 2023
7bac876
Refactor splitting for reuse in ephemeris data running.
jmchilton Jul 3, 2023
0d822f1
Create a user for key.
jmchilton Jul 5, 2023
661acff
Parameterize history build tracking prefix.
jmchilton Jul 5, 2023
c03fb9c
Lets actually setup an admin user and set ...
jmchilton Jul 5, 2023
2db92d6
Lets try this?
jmchilton Jul 5, 2023
b5e46f2
...
jmchilton Jul 5, 2023
e28eea4
Debugging...
jmchilton Jul 5, 2023
1e57e2d
...
jmchilton Jul 5, 2023
0308e77
Umm?
jmchilton Jul 5, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ def get_var(var_name):
install_tool_deps=ephemeris.install_tool_deps:main
install-tool-deps=ephemeris.install_tool_deps:main
set-library-permissions=ephemeris.set_library_permissions:main
_idc-lint=ephemeris._idc_lint:main
_idc-split-data-manager-genomes=ephemeris._idc_split_data_manager_genomes:main
_idc-data-managers-to-tools=ephemeris._idc_data_managers_to_tools:main
'''
PACKAGE_DATA = {
# Be sure to update MANIFEST.in for source dist.
Expand Down
11 changes: 10 additions & 1 deletion src/ephemeris/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
import os

import yaml
from bioblend import galaxy
Expand All @@ -16,6 +17,14 @@
)


def get_or_create_history(history_name: str, gi: galaxy.GalaxyInstance):
histories = gi.histories.get_histories(name=history_name)
if histories:
return histories[0]
else:
return gi.histories.create_history(name=history_name)


def check_url(url, log=None):
if not url.startswith("http"):
if log:
Expand All @@ -39,7 +48,7 @@ def get_galaxy_connection(args, file=None, log=None, login_required=True):

url = args.galaxy or file_content.get("galaxy_instance")
galaxy_url = check_url(url, log)
api_key = args.api_key or file_content.get("api_key")
api_key = args.api_key or file_content.get("api_key") or os.environ.get("EPHEMERIS_API_KEY")

if args.user and args.password:
return galaxy.GalaxyInstance(
Expand Down
83 changes: 83 additions & 0 deletions src/ephemeris/_config_models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
from pathlib import Path
from typing import (
Dict,
List,
Optional,
Union,
)

import yaml
from pydantic import (
BaseModel,
Extra,
)


StrOrPath = Union[Path, str]


class RepositoryInstallTarget(BaseModel):
name: str
owner: str
tool_shed_url: Optional[str]
tool_panel_section_id: Optional[str]
tool_panel_section_label: Optional[str]
revisions: Optional[List[str]]
install_tool_dependencies: Optional[bool]
install_repository_dependencies: Optional[bool]
install_resolver_dependencies: Optional[bool]


class RepositoryInstallTargets(BaseModel):
""" """
api_key: Optional[str]
galaxy_instance: Optional[str]
tools: List[RepositoryInstallTarget]


class DataManager(BaseModel, extra=Extra.forbid):
tags: List[str]
tool_id: str


class DataManagers(BaseModel, extra=Extra.forbid):
__root__: Dict[str, DataManager]


class Genome(BaseModel):
id: str # The unique id of the data in Galaxy
description: str # The description of the data, including its taxonomy, version and date
dbkey: Optional[str]
source: Optional[str] # The source of the data. Can be: 'ucsc', an NCBI accession number or a URL to a fasta file.

# The following fields are currently purely for human consumption and unused by
# IDC infrastructure.
doi: Optional[str] # Any DOI associated with the data
blob: Optional[str] # A blob for any other pertinent information
checksum: Optional[str] # A SHA256 checksum of the original
version: Optional[str] # Any version information associated with the data

# Description of actions (data managers) to run on target genome.
indexers: Optional[List[str]] # indexers to run - keyed on repository name - see data_managers.yml for how to resolve these to tools
skiplist: Optional[List[str]] # unimplemented: but if we implement classes of indexers, these will be ones to skip


class Genomes(BaseModel):
genomes: List[Genome]


def _read_yaml(path: StrOrPath):
with open(path, "r") as f:
return yaml.safe_load(f)


def read_data_managers(path: StrOrPath) -> DataManagers:
return DataManagers(__root__=_read_yaml(path))


def read_genomes(path: StrOrPath) -> Genomes:
return Genomes(**_read_yaml(path))


def read_tools(path: StrOrPath) -> RepositoryInstallTargets:
return RepositoryInstallTargets(**_read_yaml(path))
Loading
Loading