I'm trying to undergo pdbqt-flexible files merge into one pdb using following script:
http://prosciens.com/prosciens/oldproscienssarl/files/flexrigidpdbqt2pdb_template.sh
Problematic fragment:
Let's merge the files
First we clean up the model PDB
grep ATOM ${FLEXPDBQT}_${MODEL}.pdb > ${FLEXPDBQT}_${MODEL}.pdb.tmp
Next we create a list of residues
cut -c 18-27 ${FLEXPDBQT}_${MODEL}.pdb.tmp > residuelistraw.tmp` cat residuelistraw.tmp | uniq > residuelist.tmp
Then we split the model file into residues
while read r do rns= echo $r | sed 's/ //g' egrep "[ \t]$r[ \t]" ${FLEXPDBQT}_${MODEL}.pdb.tmp > $rns.pdb.tmp sed -i 's/'$FLEXPDBQT'_'$MODEL'.pdb.tmp://' $rns.pdb.tmp
Currently it fails at #3 step yielding following error:
/flexrigidpdbqt2pdb_template.sh: line 133: $ rns.pdb.tmp: ambiguous redirect
sed: -e expression # 1, character 9: unknown option for the `s' command
I tried fix the error using some sed substitution:
rns=`echo "${r/ /}"`
echo $rns
egrep "[ \t]$r[ \t]" ${FLEXPDBQT}_${MODEL}.pdb.tmp > $rns.pdb.tmp
sed -i 's/'$FLEXPDBQT'_'$MODEL'.pdb.tmp://' $rns.pdb.tmp
But so far nothing changed.
My sed version is 4.4