Difference between revisions of "Combine multiple pdb files into NMR-style model"

From CCP4 wiki
Jump to navigationJump to search
(Created page with "An example here assumes that you have 10 pdb files generated by the simulated annealing in CNS, i.e. the files are named model_anneal_1.pdb, model_anneal_2.pdb, ..., model_anneal...")
 
 
Line 5: Line 5:
  
 
Well, technically it's a bash script but it's formatted as a one-liner.
 
Well, technically it's a bash script but it's formatted as a one-liner.
 +
 +
'''Notice that  if you have a file named output.pdb in the folder, it will be overwritten!'''
  
 
echo -n > output.pdb; for i in {1..10}; do printf "MODEL    %4d\n" $i >> output.pdb; grep ATOM model_anneal_$i.pdb >> output.pdb; printf "ENDMDL\n" >> output.pdb; done
 
echo -n > output.pdb; for i in {1..10}; do printf "MODEL    %4d\n" $i >> output.pdb; grep ATOM model_anneal_$i.pdb >> output.pdb; printf "ENDMDL\n" >> output.pdb; done

Latest revision as of 18:12, 6 October 2011

An example here assumes that you have 10 pdb files generated by the simulated annealing in CNS, i.e. the files are named model_anneal_1.pdb, model_anneal_2.pdb, ..., model_anneal_10.pdb. Modify accordingly.


Bash one-liner[edit | edit source]

Well, technically it's a bash script but it's formatted as a one-liner.

Notice that if you have a file named output.pdb in the folder, it will be overwritten!

echo -n > output.pdb; for i in {1..10}; do printf "MODEL %4d\n" $i >> output.pdb; grep ATOM model_anneal_$i.pdb >> output.pdb; printf "ENDMDL\n" >> output.pdb; done


Back to Useful scripts (aka smart piece of code)