Created
August 7, 2015 10:28
-
-
Save nuada/283629d5cab3f81ab00a to your computer and use it in GitHub Desktop.
Merge MiSeq diagnostic images for easy eyeballing
This file contains hidden or 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 | |
| # usage: $0 <MiSeq output dir> <output dir> | |
| dir=$1/Thumbnail_Images/L001 | |
| output=$2 | |
| number_of_tiles=$(grep FlowcellLayout ${1}/RunInfo.xml | cut -d = -f 5 | sed -e 's/[^0-9]*//g') | |
| if [[ ! -d ${output} ]]; then | |
| mkdir ${output} | |
| fi | |
| for i in $(seq 1 $(ls -1 ${dir} | cut -c 2- | cut -d . -f 1 | sort -n | tail -n 1)); do | |
| for base in a c g t; do | |
| montage ${dir}/C${i}.1/*_${base}.jpg -tile ${number_of_tiles}x3 -geometry +0+0 ${dir}/tmp_${i}_${base}.jpg | |
| done | |
| montage ${dir}/tmp_${i}_?.jpg -tile 1x4 -geometry +0+0 -quality 25 ${output}/C$(printf '%03d' ${i}).jpg | |
| rm ${dir}/tmp_${i}_?.jpg | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment