Sha256: 8cae1bb52cccbf07f6dc1b805a999da56996aeea278953e2998be527b4375cb6
Contents?: true
Size: 503 Bytes
Versions: 96
Compression:
Stored size: 503 Bytes
Contents
#!/usr/bin/env bash input="$1"; a=0 c=0 g=0 t=0 function end() { echo "A: ${a}" echo "C: ${c}" echo "G: ${g}" echo "T: ${t}" exit } if [ ! -n "$input" ]; then end fi for i in $(seq 1 ${#input}); do char=${input:i-1:1} if [ "${char}" = "A" ]; then a=$((a+1)) elif [ "${char}" = "C" ]; then c=$((c+1)) elif [ "${char}" = "G" ]; then g=$((g+1)) elif [ "${char}" = "T" ]; then t=$((t+1)) else echo "Invalid nucleotide in strand" exit 1 fi done end
Version data entries
96 entries across 96 versions & 1 rubygems