Skip to content

Commit

Permalink
Merge pull request #26 from bebatut/script-community-tools
Browse files Browse the repository at this point in the history
thanks @bebatut
  • Loading branch information
paulzierep authored Nov 2, 2023
2 parents c1da781 + 2d8ad6e commit 86de36b
Show file tree
Hide file tree
Showing 9 changed files with 27,189 additions and 87 deletions.
5 changes: 4 additions & 1 deletion bin/create_interactive_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ def generate_table(
output_path: str,
) -> None:
df = pd.read_csv(tsv_path, sep="\t").assign(Expand=lambda df: "").fillna("")
df = df[df["To keep"]].loc[:, COLUMNS].reindex(columns=COLUMNS)
if "To keep" in df.columns:
df["To keep"] = df["To keep"].replace("", True)
df = df.query("`To keep`")
df = df.loc[:, COLUMNS].reindex(columns=COLUMNS)
table = df.to_html(border=0, table_id="dataframe", classes=["display", "nowrap"], index=False)

with open(template_path) as template_file:
Expand Down
7 changes: 6 additions & 1 deletion bin/extract_all_tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,9 @@ mkdir -p 'results/'
python bin/extract_galaxy_tools.py \
extractools \
--api $GITHUB_API_KEY \
--all_tools 'results/all_tools.tsv'
--all_tools 'results/all_tools.tsv'

python bin/create_interactive_table.py \
--table "results/all_tools.tsv" \
--template "data/interactive_table_template.html" \
--output "results/index.html"
39 changes: 39 additions & 0 deletions bin/get_community_tools.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env bash


for com_data_fp in data/* ; do
if [[ -d "$com_data_fp" && ! -L "$com_data_fp" ]]; then
community=`basename "$com_data_fp"`

echo "$community";

if [[ "$community" == *"microgalaxy"* ]]; then
curl \
-L \
"https://docs.google.com/spreadsheets/d/1Nq_g-CPc8t_eC4M1NAS9XFJDflA7yE3b9hfSg3zu9L4/export?format=tsv&gid=1533244711" \
-o "data/$community/tools_to_keep"

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


mkdir -p "results/$community"

python bin/extract_galaxy_tools.py \
filtertools \
--tools "results/all_tools.tsv" \
--filtered_tools "results/$community/tools.tsv" \
--categories "data/$community/categories" \
--exclude "data/$community/tools_to_exclude" \
--keep "data/$community/tools_to_keep"

python bin/create_interactive_table.py \
--table "results/$community/tools.tsv" \
--template "data/interactive_table_template.html" \
--output "results/$community/index.html"

fi;
done
26 changes: 0 additions & 26 deletions bin/get_microgalaxy_tools.sh

This file was deleted.

58 changes: 0 additions & 58 deletions data/datatable_template.html

This file was deleted.

2 changes: 1 addition & 1 deletion data/interactive_table_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
background-color: #00FFFF;
color: #000000;
min-width: 400px;
}
}
</style>

<script>
Expand Down
Loading

0 comments on commit 86de36b

Please sign in to comment.