I have two DNA sequence ATGCATGC
and TACGTTGC
I want to write a program which gives "+" if upon comparing A
align with T
and G
with C
otherwise print "-"
Like
ATGCATGC
TACGTTGC
+++++---
Can anyone help me out?
Output which I expect is given above.
What I tried is as following:
#!/bin/bash
declare -a seq1=()
declare -a seq2=()
read -p 'Enter the ncleotide seq (charactor by charactor followe\d by space0) ' -a seq1
read -n1 seq1
read -p 'Enter the ncleotide seq (charactor by charactor followe\d by space0) ' -a seq2
read -n1 seq2
for a in ${seq1[*]} ; do
for b in ${seq2[*]} ; do
if [ $a == A ] || [ $b == T ] ; then
echo -n "+"
elif [ $a == A ] || [ $b == C ] ; then
echo -n " -"
elif [ $a == A ] || [ $b == G ] ; then
echo -n "-"
elif [ $a == T ] || [ $b == A ] ; then
echo -n "+"
elif [ $a == T ] || [ $b == C ] ; then
echo -n "-"
elif [ $a == T ] || [ $b == G ] ; then
echo -n "-"
elif [ $a == C ] || [ $b == G ] ; then
echo -n "+"
elif [ $a == C ] || [ $b == A ] ; then
echo -n "-"
elif [ $a == C ] || [ $b == T ] ; then
echo -n "-"
elif [ $a == G ] || [ $b == C ] ; then
echo -n "+"
elif [ $a == G ] || [ $b == A ] ; then
echo -n "-"
elif [ $a == G ] || [ $b == T ] ; then
echo -n "-"
else
echo $a $b
fi
done
done