Created
October 7, 2013 22:24
-
-
Save vmirly/6876041 to your computer and use it in GitHub Desktop.
AWK: randomly change 10% of water residues from TIP3 to TIPT
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| awk ' | |
| function prpdb(anum, aname, rnum, x,y,z) { | |
| if(rnum<1000) { | |
| printf "ATOM %5d %-3s TIPT0%4d %8.3f%8.3f%8.3f 1.00 0.00 WT00\n",anum, aname, rnum, x, y, z | |
| }else{ | |
| printf "ATOM %5d %-3s TIPT0%5d %8.3f%8.3f%8.3f 1.00 0.00 WT00\n",anum, aname, rnum, x, y, z | |
| } | |
| } | |
| BEGIN { srand() } | |
| !/^$/ { | |
| if($3=="OH2" && rand()<=0.1) { | |
| prpdb($2, $3, $5, $6, $7, $8) | |
| for(i=2; i<=3; i++) { | |
| getline; | |
| prpdb($2, $3, $5, $6, $7, $8) | |
| } | |
| }else{ | |
| print $0 | |
| } | |
| } ' min.pdb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment