shell中实现查找NDA的motif
001、
[root@pc1 test02]# ls a.txt test.sh [root@pc1 test02]# cat a.txt ## 测试序列 GATATATGCATATACTT [root@pc1 test02]# cat test.sh ## 计算程序 #!/bin/bash length=$(awk '{print length}' a.txt) for i in $(seq $length) do let tmp=$i+3 cut -c $i-$tmp a.txt | grep -x "ATAT" > /dev/null if [ $? -eq 0 ] then printf "%d\t" $i fi done printf "\n" [root@pc1 test02]# bash test.sh ## 计算结果 2 4 10

。

浙公网安备 33010602011771号