Skip to content

Instantly share code, notes, and snippets.

@flekschas
Created November 9, 2018 19:53
Show Gist options
  • Save flekschas/929a2e014406cb02a06c57bde919b54d to your computer and use it in GitHub Desktop.
Save flekschas/929a2e014406cb02a06c57bde919b54d to your computer and use it in GitHub Desktop.
Script to do convert data with Clodius in the cloud cleanly. Created by Alex Reynolds
#!/bin/bash
ENVIRONMENT=$1
ASSEMBLY=$2
RESOLUTION=$3
STATES=$4
STATESFN=$5
MARKSFN=$6
FILETOMOVESRC=$7
FILETOMOVEDEST=$8
>&2 echo "CREATE ${ENVIRONMENT}"
conda create -n ${ENVIRONMENT} python=3.6 --no-default-packages --yes
>&2 echo "ACTIVATE ${ENVIRONMENT}"
source activate ${ENVIRONMENT}
>&2 echo "INSTALL ${ENVIRONMENT}"
pip install --upgrade pip
pip install --ignore-installed scipy==1.1.0
pip install --ignore-installed numpy==1.12.0
pip install --ignore-installed h5py==2.6.0
pip install clodius==0.9.3
>&2 echo "RUN ${ENVIRONMENT}"
clodius convert bedfile-to-multivec ${MARKSFN} \
--assembly ${ASSEMBLY} \
--starting-resolution ${RESOLUTION} \
--row-infos-filename ${STATESFN} \
--num-rows ${STATES} \
--format epilogos
mv ${FILETOMOVESRC} ${FILETOMOVEDEST}
>&2 echo "DEACTIVATE ${ENVIRONMENT}"
source deactivate ${ENVIRONMENT}
>&2 echo "REMOVE ${ENVIRONMENT}"
conda remove -n ${ENVIRONMENT} --all --yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment