Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Nicola Soranzo
    @nsoranzo
    Hi all, just a quick heads-up about 2 recent changes in the BioBlend repository on GitHub:
    • We changed the default branch from master to main
    • We moved the Continuous Integration (CI) from TravisCI to GitHub workflows (thanks to Oleg Zharkov!)
    Nolan Woods
    @innovate-invent
    Why the change from master to main?
    Nicola Soranzo
    @nsoranzo
    @innovate-invent galaxyproject/galaxy#10850
    Nolan Woods
    @innovate-invent
    Huh, I wasn't aware git was on that bandwagon
    Andrew Mcgregor
    @Mcgregor381
    @simonbray
    Simon Bray
    @simonbray
    Hello
    (You can also send me a PM if you want?)
    Nicola Soranzo
    @nsoranzo
    Forgot to mention here that BioBlend 0.15.0 was released about 3 weeks ago, see https://github.com/galaxyproject/bioblend/releases/tag/v0.15.0 for the Changelog. As usual, it's available also on PyPI and Bioconda.
    Björn Grüning
    @bgruening
    :100:
    Nicola Soranzo
    @nsoranzo
    @mvdbeek (or any other with experience with this) Do you think it would make sense to add Py3 type annotations to the BioBlend API?
    Ghost
    @ghost~5772e7e2c2f0db084a206e1b
    I think overall that's a good idea, but if I had to prioritize time and effort I’d explore in how far bioblend can take advantage of the openapi schema to do some semi-automated typing ?
    Nicola Soranzo
    @nsoranzo
    For now I'll create an issue :)
    Simon Bray
    @simonbray:matrix.org
    [m]
    Hello, it seems there's no way in bioblend to (un)publish a dataset, is that correct? The relevant API seems to be https://github.com/galaxyproject/galaxy/blob/dev/lib/galaxy/webapps/galaxy/api/history_contents.py#L579, not sure if there is another way
    dkolbe
    @dkolbe
    Hi - I'm running workflows using invoke_workflow and need to set some explicit parameters in the code rather in the workflow UI. Using the params={TOOL_ID: PARAM_DICT, ...} (deprecated I know) is working well when the step in question is in the top-level workflow, but not when it is nested in a subworkflow (bioblend v0.15). In a subworkflow, the parameter gets set to things like "ltgalaxy.tools.parameters.basic.RuntimeValue object at 0x7fd582cefed0gt". I noticed this function has a new parameters_normalized option in the pre-release dev code that explicitly mentions subworkflows - is this likely to solve my issue? Or should I investigate other fixes? Identify the step ID and switching to the newer params format?
    Nicola Soranzo
    @nsoranzo
    @simonbray:matrix.org Do you have any suggestion here? ^
    Simon Bray
    @simonbray:matrix.org
    [m]
    @dkolbe your issue sounds similar to this one: galaxyproject/bioblend#321
    so I think it might help. Do you get the same error message as reported in that issue?
    dkolbe
    @dkolbe
    No, actually I don't get an error at all, just the parameter getting set to a python object description rather than my variable's value. However, I'm connecting to a notably old Galaxy server version - 18.09, so there may be significant differences in handling on that end? (Clinical use means stuff gets frozen in place once it's approved; we are planning a current server build this year. Some of the other improvements should give me support for variables as input parameters; just had been hoping to get stuff done in the meantime.)
    Simon Bray
    @simonbray:matrix.org
    [m]
    I'm not sure I have any good ideas but maybe this issue is related: galaxyproject/galaxy#2007
    dkolbe
    @dkolbe
    I seem to have gotten it working for now with some combination of explicitly specifying the step ids and using the current dev codebase. This note was helpful on how to describe subworkflow params galaxyproject/bioblend#322
    Björn Grüning
    @bgruening
    @dkolbe glad its working.
    If you have some time, please feel free to spin up a PR with docs improvements
    Anne Fouilloux
    @annefou
    I would like to understand how you can download data from the Galaxy history to a github action for creating a plot with bioblend. I tried gi.datasets.download_dataset with a dataset id but I always get an error (500); the code I am using is at https://github.com/NordicESMhub/smart_heating_workflow/blob/planemo/get_dataset_from_history.py Is there anything else I should do? Do you have an example on how to download a dataset from a Galaxy history to a local machine?
    Nicola Soranzo
    @nsoranzo:matrix.org
    [m]
    @annefou: Try replacing gi.datasets.download_dataset(ds['dataset_id'] with gi.datasets.download_dataset(ds['id']
    Anne Fouilloux
    @annefou
    Great! Yes it works! what is the difference between dataset_id and id? Thank you so much!
    Simon Bray
    @simonbray:matrix.org
    [m]
    @annefou the id refers to a history dataset association (HDA), i.e. the dataset in the context of a particular history, whereas the dataset_id refers to the dataset itself. Concretely, if you copy a dataset, the dataset_id will be the same for both copies, but the id will be different.
    I think it's safe to ignore dataset_id, I don't think I have ever needed to use it
    Anne Fouilloux
    @annefou
    Ok. id is definitely what I need. Thanks for your explanation!
    Keith Suderman
    @ksuderman
    Is there a way to publish a history with BioBliend? I see a publish_dataset method, but nothing that seems to allow me to publish an entire history.
    2 replies
    And a follow up: any ideas why I am getting 403 errors (from Main) when I try to publish_dataset on a dataset from a shared history I have imported?
    Fred
    @FredericBGA
    Hello
    Fred
    @FredericBGA
    I try to export histories (bioblend==0.14.0 and Galaxy 20.05) and it seems that the parameter include_hidden=False of export_history does not work. The archive (downloaded by download_history) contains the hidden files.
    quacksawbones
    @quacksawbones
    @FredericBGA - Would you believe, I have just encountered a problem with the same parameter (Bioblend==0.16.0, Galaxy 20.01 and 21.05, Python 3.6 and 3.9), but I'm finding that if you use include_hidden=True, the only data files included are the hidden ones. This is the GitHub issue I've created if you want to contribute to it: galaxyproject/bioblend#418
    2 replies
    Nicola Soranzo
    @nsoranzo:matrix.org
    [m]
    @quacksawbones: I was looking at the Galaxy code and that's the (wrong) behaviour I was expecting. I'll work on a test and fix.
    Fred
    @FredericBGA
    @nsoranzo:matrix.org - Thank you.
    Kasun Buddika
    @KasunBuddika7_twitter

    Hello, I am trying to run a Galaxy tool using Bioblend. I am a bit confused with constructing the tool_inputs dictionary. Can some one please advise? For instance, here is the tool information for Add column tool on Galaxy.

    {'model_class': 'Tool', 'id': 'addValue', 'name': 'Add column', 'version': '1.0.0', 'description': 'to an existing dataset', 'labels': [], 'edam_operations': ['operation_3096'], 'edam_topics': [], 'hidden': '', 'is_workflow_compatible': True, 'xrefs': [], 'inputs': [{'model_class': 'TextToolParameter', 'name': 'exp', 'argument': None, 'type': 'text', 'label': 'Add this value', 'help': '', 'refresh_on_change': False, 'optional': False, 'hidden': False, 'is_dynamic': False, 'value': '1', 'area': False, 'datalist': []}, {'model_class': 'DataToolParameter', 'name': 'input', 'argument': None, 'type': 'data', 'label': 'to Dataset', 'help': 'Dataset missing? See TIP below', 'refresh_on_change': True, 'optional': False, 'hidden': False, 'is_dynamic': False, 'value': None, 'extensions': ['tabular'], 'edam': {'edam_formats': ['format_3475'], 'edam_data': ['data_0006']}, 'multiple': False, 'options': {'hda': [], 'hdca': []}}, {'model_class': 'SelectToolParameter', 'name': 'iterate', 'argument': None, 'type': 'select', 'label': 'Iterate?', 'help': '', 'refresh_on_change': False, 'optional': False, 'hidden': False, 'is_dynamic': False, 'value': 'no', 'options': [['NO', 'no', False], ['YES', 'yes', False]], 'display': None, 'multiple': False, 'textable': False}], 'outputs': [{'model_class': 'ToolOutput', 'name': 'out_file1', 'format': 'input', 'label': '', 'hidden': False, 'output_type': 'data', 'format_source': None, 'default_identifier_source': 'None', 'metadata_source': 'input', 'parent': None, 'count': 1, 'from_work_dir': None, 'discover_datasets': [{'discover_via': 'pattern', 'dbkey': '__input__', 'format': None, 'visible': False, 'assign_primary_output': False, 'directory': None, 'recurse': False, 'match_relative_path': False, 'sort_key': 'filename', 'sort_comp': 'lexical', 'pattern': 'primary_DATASET_ID_(?P<designation>[^_]+)_(?P<visible>[^_]+)_(?P<ext>[^_]+)(_(?P<dbkey>[^_]+))?', 'sort_by': 'filename'}]}], 'panel_section_id': 'textutil', 'panel_section_name': 'Text Manipulation', 'form_style': 'regular’}

    When I use tool_inputs={'input': content[0]['dataset_id’]} I got this following error:

    bioblend.ConnectionError: Unexpected HTTP status code: 400: {"err_msg": "parameter 'input': invalid dataset supplied to single input dataset parameter", "err_code": 400008, "err_data": {"input": "parameter 'input': invalid dataset supplied to single input dataset parameter"}, "param_errors": {"input": {"message": "parameter 'input': invalid dataset supplied to single input dataset parameter", "message_suffix": "invalid dataset supplied to single input dataset parameter", "parameter_name": "input"}}}
    ERROR conda.cli.main_run:execute(41): `conda run python /Users/kbuddika/Documents/galaxy_api/galaxy_test.py` failed. (See above for error)

    I am using Bioblend v0.16.0 and Python v3.9.11. I look forward to hearing from someone. Thanks!

    Simon Bray
    @simonbray:matrix.org
    [m]
    Hey @KasunBuddika7_twitter, what is content?
    Can you try tool_inputs={'input': content[0]['id’]}?
    Kasun Buddika
    @KasunBuddika7_twitter

    @simonbray:matrix.org, it still produces the same error.

    content = gi.histories.show_history(history_id=new_hist['id'], contents=True)

    The content variable stores the content of the new_hist (new history) I created. Here are all my commands:

    from bioblend.galaxy import GalaxyInstance
    
    gi = GalaxyInstance(url=<URL>, key=<MY_KEY>)
    new_hist = gi.histories.create_history(name=“API_Test_1")
    hda = gi.tools.upload_file(path="./test_data.txt", history_id=new_hist["id"], type="txt”)
    tools = gi.tools.get_tools(name="Add column")
    add_col = gi.tools.show_tool(tool_id=tools[0]["id"], io_details=True)
    content = gi.histories.show_history(history_id=new_hist["id"], contents=True)
    tool_inputs={"input": content[0]["id"]}
    gi.tools.run_tool(history_id=new_hist["id"], tool_id=add_col["id"], tool_inputs=tool_inputs)

    I can see that the new history is being created and the test_data file is being uploaded to the new history. Thank you for looking into this.

    Simon Bray
    @simonbray:matrix.org
    [m]
    Can you try tool_inputs={"input": {"values": [{"id": content[0]["id"], "src": "hda"}]}}?
    Nicola Soranzo
    @nsoranzo:matrix.org
    [m]
    tool_inputs={"input": {"id": content[0]["id"], "src": "hda"}} maybe?
    There are helpers in bioblend.galaxy.tools.inputs , you can see how to use them by looking at https://github.com/galaxyproject/bioblend/blob/main/bioblend/_tests/TestGalaxyTools.py
    Kasun Buddika
    @KasunBuddika7_twitter
    Thank you @simonbray:matrix.org and @nsoranzo:matrix.org. I no longer see the error and the tool gets executed as intended. Thank you for pointing me to the helper as well.
    Nicola Soranzo
    @nsoranzo:matrix.org
    [m]
    Great to hear!
    wm75 (Wolfgang Maier)
    @wm75:matrix.org
    [m]
    Is it possible that for datasets.get_datasets the extension argument cannot be a list of strs contrary to what the docs say?
    Nicola Soranzo
    @nsoranzo:matrix.org
    [m]
    wm75 (Wolfgang Maier): There wasn't a test for it and it looks broken on Galaxy dev, running tests now to see when it broke: https://github.com/nsoranzo/bioblend/actions/runs/2664227731
    Nicola Soranzo
    @nsoranzo:matrix.org
    [m]
    Turns out it never worked! But I have a patch for Galaxy that seems to make it work.
    Nicola Soranzo
    @nsoranzo:matrix.org
    [m]
    wm75 (Wolfgang Maier): Any specific Galaxy version I should target for your convenience?
    wm75 (Wolfgang Maier)
    @wm75:matrix.org
    [m]
    Wow, if you offer me the choice then 22.01 would be ideal. Thanks a lot for the ultrafast response :-)
    Nicola Soranzo
    @nsoranzo:matrix.org
    [m]
    FYI we have dropped support for CloudMan in BioBlend (see galaxyproject/bioblend#459 ) because it's deprecated upstream. I am planning to do a release including this change in the next few days.