filter-sort
来自「mfold」· 代码 · 共 34 行
TXT
34 行
#!/bin/sh# 2/1/97 - Rewrite. Old version causing some errors on mfold server# when not all levels present. Old version was also too slow.# Sorts energy dot plot file $1 and removes helices of length# less than $SIZE, where SIZE = $2 (3 if $2 not defined). # No optimal helices are removed.# 8/26/05 - Redone using awk in July 05 and now corrected.if [ $# -lt 1 ]; then echo -e "\t*** Usage: filter-sort input_file size" exit 1fiif [ ! -s $1 ]; then echo -e "$1 does not exist or is empty." exit 1else if [ $# -lt 2 ]; then SIZE=3 else SIZE=$2 fifiecho -e "Removing non-optimal helices of length less than $SIZE"head -1 $1|tr -s "\011 " "\011\011" > tmp1-$1tail +2 $1|tr -s "\011 " "\011\011"|\ awk -v SIZE=$SIZE '{if($1 == 1 || $2 >= SIZE) print $0}'|sort -n +4 >> tmp1-$1mv tmp1-$1 $1echo -e "$1 replaced by new file."
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?