Quick navigation:        Home   |    Site Map   ||    References   |    Biography   ||    Copyright   |    Other copyright   |    Contact us   |   
Protein structure
 

Re: [ccp4bb] density histogram

 

Basic tutorials:
 
 

CCP4bb navigation

CCP4bb <-- 2007 <-- August 2007 <-- 03 August 2007
Previous message:
Subject: density histogram
From: Bernhard Rupp bernhardrupp {- at -} SBCGLOBAL {- dot -} NET
Date: 2007-08-02
Next message:
Subject: Re: density histogram
From: Adam Ralph aralph {- at -} MATHS {- dot -} NUIM {- dot -} IE
Date: 2007-08-03


Subject: Re: density histogram
From: Peter Zwart PHZwart {- at -} LBL {- dot -} GOV
Date: 2007-08-03

Hi Bernard, it this is relatively easy. Copy this text:


#phil __ON__
xmanip {
input {
xray_data {
file_name = porin.mtz
labels = FOFCWT
name = map_coef
write_out =False
}
}
parameters {
action = *manipulate_miller
manipulate_miller {
task = *custom
custom{
code = """
import math
map = map_coef.fft_map().real_map_unpadded()
data = map.as_1d()
mean = flex.mean( data )
std = flex.mean( data*data-mean*mean)
std = math.sqrt( std )
data = (data-mean)/std
histo = flex.histogram(data,n_slots=30)
histo.show()
"""
}
}
}
}
#phil __END__





into something called rupp.def
Change the input mtz file and input labels into whatever you need/have .
Make sure you have downloaded the latest version of phenix, cci_apps or
the cctbx.
Then run

mmtbx.xmanip rupp.def

to get a histogram printed out:

-4.3615799 - -3.917308: 81
-3.917308 - -3.4730361: 408
-3.4730361 - -3.0287643: 1965
-3.0287643 - -2.5844924: 9006
-2.5844924 - -2.1402205: 28548
-2.1402205 - -1.6959486: 77763
-1.6959486 - -1.2516767: 186741
-1.2516767 - -0.80740483: 386079
-0.80740483 - -0.36313295: 634365
-0.36313295 - 0.08113894: 785736
0.08113894 - 0.52541082: 698574
0.52541082 - 0.96968271: 451065
0.96968271 - 1.4139546: 221478
1.4139546 - 1.8582265: 96711
1.8582265 - 2.3024984: 52725
2.3024984 - 2.7467702: 35046
2.7467702 - 3.1910421: 25470
3.1910421 - 3.635314: 18111
3.635314 - 4.0795859: 10530
4.0795859 - 4.5238578: 6165
4.5238578 - 4.9681297: 3366
4.9681297 - 5.4124016: 1476
5.4124016 - 5.8566734: 630
5.8566734 - 6.3009453: 252
6.3009453 - 6.7452172: 108
6.7452172 - 7.1894891: 36
7.1894891 - 7.633761: 18
7.633761 - 8.0780329: 9
8.0780329 - 8.5223048: 9
8.5223048 - 8.9665766: 9



Some background: xmanip has a 'custom' function that allows you to push
in snippets of python code that deal with models or reflection files.
The custom code I wrote is fairly simple as you can see. It saves you
the overhead of writing an interface that deals with reading in data etc
etc.
in the above text, the code that does the histogram stuff is:

import math
map = map_coef.fft_map().real_map_unpadded()
data = map.as_1d()
mean = flex.mean( data )
std = flex.mean( data*data-mean*mean)
std = math.sqrt( std )
data = (data-mean)/std
histo = flex.histogram(data,n_slots=30)
histo.show()

It should be obvious what is going on.
Other parts of rupp.def deal only with reading in the data and telling
the jiffy what to do.

HTH

Peter









Bernhard Rupp wrote:
>
> 2007/8/2, Bernhard Rupp :
>
>> Dear All -
>>
>> before I code ahead - is there a simple program/script available where
>> I can read in a map and it gives me a basic 1d density histogram (or
>> the tabular data at least) in return?
>>
>> Thx, br
>> -----------------------------------------------------------------
>> Bernhard Rupp
>> http://www.ruppweb.org/
>> -----------------------------------------------------------------
>> It is not your aptitude but your attitude that determines your
>> altitude.
>> -----------------------------------------------------------------
>>
>>

CCP4bb navigation

CCP4bb <-- 2007 <-- August 2007 <-- 03 August 2007
Previous message:
Subject: density histogram
From: Bernhard Rupp bernhardrupp {- at -} SBCGLOBAL {- dot -} NET
Date: 2007-08-02
Next message:
Subject: Re: density histogram
From: Adam Ralph aralph {- at -} MATHS {- dot -} NUIM {- dot -} IE
Date: 2007-08-03



ProteinCrystallography.org: Copyright 2006-2008 by Quid United Ltd