#!/usr/bin/env bash # # Copyright (c) 2016 10x Genomics, Inc. All rights reserved. # # Site Check for 10x Genomics pipelines. # eval "$(docopts -V " " -h - : "$@" <&1 builtin read -t 20 < <( eval /usr/bin/env $cmd 1>&3 2> /dev/null builtin echo $? ) 3>&1 && exit $REPLY || { rc=$? builtin echo "timed out" builtin kill -s SIGHUP -- $! 2> /dev/null exit $rc } ) ecode=$? echo "=====================================================================" echo "" } function ifchk { if [ $ecode == 0 ]; then check "$1" "$2" fi } # Generate version banner read -d '' BANNER < /dev/null && echo 'Detected'" check "init process" "head -n 1 /proc/1/sched | cut -d ' ' -f 1" # cluster config check "SGE Submit" "which qsub" ifchk "SGE CLUSTER_NAME" "echo \$SGE_CLUSTER_NAME" ifchk "SGE JOB_NAME" "echo \$JOB_NAME" check "LSF Submit" "which bsub" ifchk "LSF LSB_JOBNAME" "echo \$LSB_JOBNAME" check "BCL2FASTQ 1" "which configureBclToFastq.pl" ifchk "BCL2FASTQ 1 Version" "ls \$(dirname \$(which configureBclToFastq.pl))/../etc" ifchk "Perl" "which perl" ifchk "Perl Version" "perl -v" check "BCL2FASTQ 2" "which bcl2fastq" ifchk "BCL2FASTQ 2 Version" "bcl2fastq --version" check "Java" "which java" ifchk "Java Version" "java -version 2>&1 | cat" check "10X Refdata" "echo \$TENX_REFDATA" ifchk "10X Refdata Version" "cat \$TENX_REFDATA/version" check "qconf" "which qconf" ifchk "qconf -sc" "qconf -sc && qconf -sconf | grep -E '(shell_start_mode|login_shells|max_jobs)'" ifchk "qhost" "which qhost" ifchk "qhost count" "qhost -l \"mem_total=20G\" | tail -n +3 | wc -l" ifchk "qhost -F" "qhost -F -q -h \$(qhost | sort -h -k 5 -r | head -n 1 | cut -d \" \" -f 1)" check "slurm info" "sinfo -O nodes,maxcpuspernode,memory,time" check "MRP" "mrp --version" ifchk "mrp templates" "ls \$(dirname \$(dirname \$(which mrp)))/jobmanagers/*.template" if [ $ecode == 0 ]; then mrp_dir=$(dirname "$(which mrp)") jobmanagers=$(dirname "$mrp_dir")/jobmanagers for template in "$jobmanagers"/*.template; do ifchk "$template" "cat $template" done fi