Skip to content

Commit

Permalink
Commit wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmymathews committed Sep 23, 2024
1 parent c3d3846 commit 1ac7a3a
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
2 changes: 1 addition & 1 deletion data_curation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Make sure that you have installed:
- [Nextflow](https://nextflow.io)

```sh
./import_datasets.sh ~/.spt_db.config.local --drop-first moldoveanu
./import_dataset.sh ~/.spt_db.config.local --drop-first moldoveanu
```

- `~/.spt_db.config.local` is an example name of a [database configuration file](https://github.com/nadeemlab/SPT/blob/main/spatialprofilingtoolbox/workflow/assets/.spt_db.config.template).
Expand Down
37 changes: 37 additions & 0 deletions data_curation/import_dataset.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash

source convenience_scripts/verifications_and_configurations.sh
source convenience_scripts/import_functions.sh

dbconfigargument=$1
dbconfig=$(handle_dbconfig_argument $dbconfigargument)

drop_first=$( if [[ "$2" == "--drop-first" ]]; then echo "yes"; else echo "no" ; fi; )

one_inclusion="$3"

available_datasets=$(get_available_dataset_handles)
configured_datasets=$(get_configured_run_handles)
if [[ ! "$available_datasets" == "$configured_datasets" ]];
then
bash convenience_scripts/configure_all_imports.sh "$dbconfigargument" "$one_inclusion"
var=$?
if [ $var -ne 0 ];
then
echo "Configuration had some error. $var"
exit 1
fi
fi

SECONDS=0
if [[ "$one_inclusion" == "" ]];
then
configured_datasets=$(get_configured_run_handles)
else
configured_datasets=$(get_configured_run_handles | grep -o "$one_inclusion")
fi
echo "Will import from configured run directories:"
echo "$configured_datasets" | sed 's/ /\n /g'
echo "Command: import_datasets '$configured_datasets' $PWD $drop_first $dbconfig"
import_datasets "$configured_datasets" "$PWD" "$drop_first" "$dbconfig"
echo "Dataset import took $SECONDS seconds ("$(( SECONDS / 60 ))" minutes)."

0 comments on commit 1ac7a3a

Please sign in to comment.