Last active
February 5, 2016 16:20
-
-
Save calizarr/28f32624c584f12d22bc to your computer and use it in GitHub Desktop.
Bash script to parallelize ConPADE
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
#!/bin/bash | |
declare -a scaffolds | |
for ((i=$2; i<=$3; i++)); do | |
scaffolds+=("scaffold_$i") | |
done | |
for ((i=$2; i<=$3; i+=1000)); do | |
j=$((i+1000)) | |
if [ -f scaffolds_$j.temp ]; then | |
echo "Scaffolds temp file already exists: $((i+1000))" | |
else | |
slice=( "${scaffolds[@]:$i:1000}" ) | |
# samtools view -b $1 $slice > scaffolds_$j.temp | |
echo "Current i: $i" | |
echo "Next i: $j" | |
echo "Last scaffold in slice: ${slice[-1]}" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment