the same with bash oneliner:
pdb='2pcy.pdb; percent=0.1; N=`grep -c '^ATOM' $pdb`; grep '^ATOM' $pdb| shuf |tail -n`echo "($percent * $N)/1"|bc`
(or add HETATM, like: grep '^ATOM\|^HETATM' [sometimes with egrem or -e
flag)
Michał
Dnia 2016-07-06, o godz. 22:42:01
Reza Khayat <[log in to unmask]> napisał(a):
> Hi Pavel,
>
> Thanks a bunch!
>
>
> Best wishes,
> Reza
>
>
> Reza Khayat, PhD
>
> Hi Reza,
>
>
> Is there a program that can select a random percentage of atoms in a
> pdb file and set their B/Q-factors to 0?
>
> I just wrote a script for you to do this (attached). To run:
>
> phenix.python run_set_random.py model.pdb 0.1
>
> The last argument ain the command above is the random fraction; in
> this example 10% of randomly selected atoms will have occupancy and B
> set to 0.
>
> For the script to run you need to have Phenix installed and defined
> in the command line environment.
>
> Pavel
|