barcode update #713
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: barcode update | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: '30 0 * * *' | |
jobs: | |
testsuite: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@main | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: update | |
shell: bash -l {0} | |
run: | | |
wget https://raw.githubusercontent.com/andersen-lab/Freyja/main/freyja/data/lineage_mutations.json -O lineage_mutations.json | |
wget https://raw.githubusercontent.com/andersen-lab/Freyja/main/freyja/data/usher_barcodes.feather -O usher_barcodes.feather | |
wget https://raw.githubusercontent.com/andersen-lab/Freyja/main/freyja/data/curated_lineages.json -O curated_lineages.json | |
wget https://raw.githubusercontent.com/andersen-lab/Freyja/main/freyja/data/lineages.yml -O lineages.yml | |
- name: update history if output is different | |
run: | | |
echo "running git diff, committing if different" | |
if [[($(git status usher_barcodes.feather --porcelain | wc -c) -ne 0)]]; then | |
echo "changes were made, updating barcodes" | |
git config --local user.name "$GITHUB_ACTOR" | |
git config --local user.email "[email protected]" | |
timestamp=$(date +"%m_%d_%Y-%H-%M") | |
cp usher_barcodes.feather history_barcodes/usher_barcodes${timestamp}.feather | |
cp curated_lineages.json history_metadata/curated_lineages${timestamp}.json | |
cp lineages.yml history_lineage_hierarchy/lineages${timestamp}.yml | |
# if [[($(git status lineage_mutations.json --porcelain | wc -c) -ne 0)]]; then | |
# git diff -U0 lineage_mutations.json | grep '^[+-]' | grep -Ev '^(--- a/|\+\+\+ b/)' > history_barcode_diffs/barcode_diff${timestamp}.txt | |
# git add history_barcode_diffs/barcode_diff${timestamp}.txt | |
# fi | |
git add usher_barcodes.feather | |
pip install pandas pyarrow | |
python update_csv.py | |
git add usher_barcodes.csv | |
git add curated_lineages.json | |
git add lineages.yml | |
git add lineage_mutations.json | |
git add history_barcodes/usher_barcodes${timestamp}.feather | |
git add history_metadata/curated_lineages${timestamp}.json | |
git add history_lineage_hierarchy/lineages${timestamp}.yml | |
git commit -m "updating historic data" | |
git push origin main | |
else | |
echo "no changes were made, doing nothing." | |
fi; |