Sha256: 528b0d38c531b38e23739a4c9bff7744d13a443ff7cf1db0a97a9a7afea35c7c
Contents?: true
Size: 495 Bytes
Versions: 58
Compression:
Stored size: 495 Bytes
Contents
#!/bin/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
58 entries across 58 versions & 1 rubygems