Skip to content

Commit

Permalink
Merge pull request #12 from bebatut/exclude-curl
Browse files Browse the repository at this point in the history
Modify one argument, add curl for microgalaxy files in bash script
  • Loading branch information
nsoranzo authored Oct 31, 2023
2 parents 171cf89 + 54c39ad commit 6855da8
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 21 deletions.
42 changes: 24 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,26 +51,10 @@ Galaxy Tool extractor
--api <GitHub API key> \
--output <Path to output file> \
[--categories <Path to ToolShed category file>] \
[--excluded <Path to excluded tool file category file>]\
[--exclude <Path to excluded tool file category file>]\
[--keep <Path to to-keep tool file category file>]
```
For microGalaxy, a Bash script in `bin` can used by:
1. Exporting the GitHub API key as an environment variable:
```
$ export GITHUB_API_KEY=<your GitHub API key>
```
2. Running the script
```
$ bash bin/extract_microgalaxy_tools.sh
```
It will take the files in the `data/microgalaxy` folder and export the tools into `microgalaxy_tools.csv`
The script will generate a CSV file with each tool found in the list of GitHub repository and several information for these tools:
1. Galaxy wrapper id
Expand All @@ -90,4 +74,26 @@ The script will generate a CSV file with each tool found in the list of GitHub r
15. Conda id
16. Conda version
17. Reviewed
18. To keep
18. To keep
## For microbial related tools
For microGalaxy, a Bash script in `bin` can used by:
1. Exporting the GitHub API key as an environment variable:
```
$ export GITHUB_API_KEY=<your GitHub API key>
```
2. Running the script
```
$ bash bin/extract_microgalaxy_tools.sh
```
It will:
1. Update the files in the `data/microgalaxy` folder
2. Export the tools into `microgalaxy_tools.csv`
4 changes: 2 additions & 2 deletions bin/extract_galaxy_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ def export_tools(tools, output_fp):
parser.add_argument('--api', '-a', required=True, help="GitHub access token")
parser.add_argument('--output', '-o', required=True, help="Output filepath")
parser.add_argument('--categories', '-c', help="Path to a file with ToolShed category to keep in the extraction (one per line)")
parser.add_argument('--excluded', '-e', help="Path to a file with ToolShed ids of tools to exclude (one per line)")
parser.add_argument('--exclude', '-e', help="Path to a file with ToolShed ids of tools to exclude (one per line)")
parser.add_argument('--keep', '-ek', help="Path to a file with ToolShed ids of tools to keep (one per line)")
args = parser.parse_args()

Expand All @@ -369,7 +369,7 @@ def export_tools(tools, output_fp):

# get categories and tools to exclude
categories = read_file(args.categories)
excl_tools = read_file(args.excluded)
excl_tools = read_file(args.exclude)
keep_tools = read_file(args.keep)

# parse tools in GitHub repositories to extract metada, filter by TS categories and export to output file
Expand Down
12 changes: 11 additions & 1 deletion bin/extract_microgalaxy_tools.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
#!/usr/bin/env bash

curl \
-L \
"https://docs.google.com/spreadsheets/d/1Nq_g-CPc8t_eC4M1NAS9XFJDflA7yE3b9hfSg3zu9L4/export?format=tsv&gid=1533244711" \
-o "data/microgalaxy/tools_to_keep"

curl \
-L \
"https://docs.google.com/spreadsheets/d/1Nq_g-CPc8t_eC4M1NAS9XFJDflA7yE3b9hfSg3zu9L4/export?format=tsv&gid=672552331" \
-o "data/microgalaxy/tools_to_exclude"

python bin/extract_galaxy_tools.py \
--api $GITHUB_API_KEY \
--output microgalaxy_tools.csv \
--categories "data/microgalaxy/categories" \
--excluded "data/microgalaxy/tools_to_exclude" \
--exclude "data/microgalaxy/tools_to_exclude" \
--keep "data/microgalaxy/tools_to_keep"
1 change: 1 addition & 0 deletions data/microgalaxy/tools_to_exclude
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ transit
trinity
trinotate
trycycler
tsebra
ucsc_blat
umi_tools
verkko
Expand Down
1 change: 1 addition & 0 deletions data/microgalaxy/tools_to_keep
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ krocus
legsta
lineagespot
lorikeet
m6anet
maaslin2
maker
mapseq
Expand Down

0 comments on commit 6855da8

Please sign in to comment.