Entering edit mode
7.1 years ago
Ali HEBRA
•
0
Hi guys, Within last few hours I had a problem with extracting coordinates from pdb files in a batch mode with my script. Anyone can suggest me a tricky way to skip that?
my script :
#!/bin/bash
while read line
do
echo $line
iden=echo $line | awk -F "," {'print $1'}
pos=echo $line | awk -F "," {'print $2'}
echo $iden
file=$iden".pdb"
x=cat $file | tr 'A' ' ' | awk '/ATOM/ && $3 == "CA" && $4 == "GLU" && $5 == $pos {print $6}'
y=cat $file | tr 'A' ' ' | awk '/ATOM/ && $3 == "CA" && $4 == "GLU" && $5 == $pos {print $7}'
z=cat $file | tr 'A' ' ' | awk '/ATOM/ && $3 == "CA" && $4 == "GLU" && $5 == $pos {print $8}'
echo $iden","$x","$y","$z",," >> loci.csv;
done < "locations.txt"
and the response in cygwin is :
location.sh: line 6: A0A010PSQ8,182: command not found
location.sh: line 7: A0A010PSQ8,182: command not found
location.sh: line 10: .pdb: command not found
location.sh: line 11: .pdb: command not found
location.sh: line 12: .pdb: command not found
my locations.txt file :
A0A010PSQ8,182
...
Can anybody help me please? I really appreciate an answer that can help me fast
Thanks a lot for your guidance :) it resolved the first lines of getting identifier and 'pos' but in getting x,y,z coordinates again this error occured :
and i guess this was about not getting the awk command informations. thanks again
As you can see it is the same error, try to put your code line between `` like:
`cat $file | tr 'A' ' ' | awk '/ATOM/ && $3 == "CA" && $4 == "GLU" && $5 == $pos {print $6}'`
alternatively you can use
$()