From e3dbb9f39b611e09f00ffd7ee9bed45086b8c64e Mon Sep 17 00:00:00 2001 From: Laura Cook <l.cook2@student.unimelb.edu.au> Date: Thu, 15 Oct 2020 10:50:22 +1100 Subject: [PATCH] first commit --- .../scripts/array_wrapper.slurm | 48 +++++++++++++++++++ .../scripts/changeFilenameLoop.sh | 15 ++++++ cross_species_comparison/scripts/lastz.sh | 2 +- 3 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 cross_species_comparison/scripts/array_wrapper.slurm create mode 100644 cross_species_comparison/scripts/changeFilenameLoop.sh diff --git a/cross_species_comparison/scripts/array_wrapper.slurm b/cross_species_comparison/scripts/array_wrapper.slurm new file mode 100644 index 0000000..e350115 --- /dev/null +++ b/cross_species_comparison/scripts/array_wrapper.slurm @@ -0,0 +1,48 @@ +#!/bin/bash + +### Author: Laura E Cook, University of Melbourne, 22/01/2020 +### Last update: 07/02/2020 +### Purpose: basic array wrapper script + +# Array set up: +#SBATCH --array=618-718 + +# Partition for the job: + +# The project ID which this job should run under: +#SBATCH -A punim0586 + +# Maximum number of tasks/CPU cores used by the job: +#SBATCH --mem=50000 + +#SBATCH --partition mig + +# Send yourself an email when the job: +# aborts abnormally (fails) +#SBATCH --mail-type=FAIL +# ends successfully +#SBATCH --mail-type=END + +#SBATCH --mail-user=lecook@student.unimelb.edu.au + +# The maximum running time of the job in days-hours:mins:sec +#SBATCH --time=50:00:00 + +# The name of the job: +#SBATCH --job-name=array + +# Output control: +#SBATCH --error="/data/projects/punim0586/lecook/chipseq-pipeline/cross_species/logs/lastz_%a.stderr" +#SBATCH --output="/data/projects/punim0586/lecook/chipseq-pipeline/cross_species/logs/lastz_%a.stdout" + +# Load modules: + +module load foss +module load lastz +conda activate wga + +# Run the simulations: +command=`head -n $SLURM_ARRAY_TASK_ID /data/projects/punim0586/lecook/chipseq-pipeline/cross_species/scripts/lastz_commands.sh | tail -n 1` +echo "SLURM_ARRAY_TASK_ID: " $SLURM_ARRAY_TASK_ID +echo $command +eval $command \ No newline at end of file diff --git a/cross_species_comparison/scripts/changeFilenameLoop.sh b/cross_species_comparison/scripts/changeFilenameLoop.sh new file mode 100644 index 0000000..e41606c --- /dev/null +++ b/cross_species_comparison/scripts/changeFilenameLoop.sh @@ -0,0 +1,15 @@ +##!/usr/bin/env bash + +## Change file names in a loop + +TRA=($(for file in *.fa.masked; do echo $file |cut -d "." -f 1;done)) + +echo ${TRA[@]} + +for tr in ${TRA[@]}; + +do + +mv ${tr}.fa.masked ${tr}.fa + +done \ No newline at end of file diff --git a/cross_species_comparison/scripts/lastz.sh b/cross_species_comparison/scripts/lastz.sh index 6eed081..41baef6 100644 --- a/cross_species_comparison/scripts/lastz.sh +++ b/cross_species_comparison/scripts/lastz.sh @@ -12,6 +12,6 @@ for tr in ${TRA[@]}; do -echo 'lastz_32 /data/projects/punim0586/lecook/chipseq-pipeline/cross_species/data/genomes/mm10.fa[multiple] /data/projects/pun$ +echo 'lastz_32 /data/projects/punim0586/lecook/chipseq-pipeline/cross_species/data/genomes/mm10.fa[multiple] /data/projects/punim0586/lecook/chipseq-pipeline/cross_species/data/genomes/smiCra1_RM/'${tr}.fa 'H=2000 K=2400 L=3000 Y=9400 --format=maf > /data/projects/punim0586/lecook/chipseq-pipeline/cross_species/data/genomes/maf/'${tr}_mm10.smiCra1.maf done -- GitLab