Это возможно в bash, но это действительно не очень хороший инструмент для этого:
#!/bin/bash
# Read the sequence into the variable $seq
seq=$1
## Check all three frames
for ((frame=0; frame<=3; frame++)); do
## Read the sequence in groups of 3
for ((i=$frame;i<=${#seq};i+=3)); do
## The codon: three nucleotides starting from the current position.
codon=${seq:i:3}
## set isORF to 1 if this is an ATG
if [[ ${seq:i:3} = "ATG" ]]; then
isORF=1
fi
## If we're in an ORF
if [[ $isORF = 1 ]]; then
## Add this codon to the ORF's sequence
ORF="${ORF}${codon}"
## Is this a STOP?
if [[ ${seq:i:3} = "TGA" ||
${seq:i:3} = "TAA" ||
${seq:i:3} = "TAG" ]];
then
## Print the ORF
echo "ORF: $ORF"
## Set isORF to 0 and empty the ORF variable to repeat the process
isORF=0
ORF=""
fi
fi
done
done
Сохраните это как foo.sh
, сделайте его исполняемым(chmod a+x foo.sh
)и запустите так:
/path/to/foo.sh AAAGCATATGCTAGCCCGTATAGCGATACTAGCTATACGATATATATGATCAATGCCCGTATAG
Добавление -noxfixes
в x11vnc
командную строку сервера решает проблему.