Automate LabKey to Snakemake config
Background
Currently there are two scripts that obtain sample metadata from LabKey (see !8 (merged)) and prepare input files (a sample table and Snakemake config) for the workflow (see !10 (merged)), respectively. Currently, the former script only prints out the LabKey data table (as a pandas
data frame) to the screen, requiring the user to manually copy and paste the contents in a correctly formatted input file for the latter script. This is cumbersome and error-prone.
Proposed solution
Generating the required inputs could be automated in one of the following ways:
- the two scripts are merged, such that only one script needs to be executed to prepare a workflow run based on a LabKey data table
- the LabKey API client script is modified in such a way that it writes out the data as a tab-separated file in the form that the Snakemake preparation script expects/understands
To choose between the options, it is important to consider whether any of the individual scripts has valid and likely use cases outside of the common one described above. If not, it is likely better to merge the scripts.
In either case, it is highly desirable that the resulting solution allows the user to choose which of the samples on LabKey he/she would like to process. A test for either the modified LabKey API client script or a test for the merged script (replacing the current one available only for the Snakemake preparation script) should be added and the docs should be updated accordingly (removing any script-specific documentation currently available in scripts/
).
Additional context
See notes in merge requests !8 (merged) & !10 (merged), issues #2 (closed), #3 (closed), #25 (closed) & #39 (closed), as well as section "Configuring workflow runs via LabKey tables" in README.md
. Resolving this issue should also solve #1 (closed) (if not solved already/before).