95 fh_pdb.open(
fn_pdb.c_str());
102 getline(fh_pdb, line);
105 std::string kind = line.substr(0,6);
108 std::vector< std::string > results;
130 const std::string &_element,
double &weight,
double &radius)
const 174 std::cout <<
"Unknown :" << _element << std::endl;
184 addExampleLine(
"Sample at 1.6A and limit the frequency to 10A",
false);
185 addExampleLine(
" xmipp_volume_from_pdb -i 1o7d.pdb --sampling 1.6");
186 addExampleLine(
" xmipp_transform_filter -i 1o7d.vol -o 1o7dFiltered.vol --fourier low_pass 10 raised_cosine 0.05 --sampling 1.6");
190 addParamsLine(
" [--sampling <Ts=1>] : Sampling rate (Angstroms/pixel)");
191 addParamsLine(
" [--high_sampling_rate <highTs=0.08333333>]: Sampling rate before downsampling");
192 addParamsLine(
" [--size <output_dim_x=-1> <output_dim_y=-1> <output_dim_z=-1>]: Final size in pixels (must be a power of 2, if blobs are used)");
193 addParamsLine(
" [--orig <orig_x=0> <orig_y=0> <orig_z=0>]: Define origin of the output volume");
194 addParamsLine(
" : If just one dimension is introduced dim_x = dim_y = dim_z");
195 addParamsLine(
" [--centerPDB] : Center PDB with the center of mass");
198 addParamsLine(
" [--blobs] : Use blobs instead of scattering factors");
199 addParamsLine(
" [--poor_Gaussian] : Use a simple Gaussian adapted to each atom");
200 addParamsLine(
" [--fixed_Gaussian <std=-1>] : Use a fixed Gausian for each atom with");
202 addParamsLine(
" : If not given, the standard deviation is taken from the PDB file");
203 addParamsLine(
" [--intensityColumn <intensity_type=occupancy>] : Where to write the intensity in the PDB file");
204 addParamsLine(
" where <intensity_type> occupancy Bfactor : Valid values: occupancy, Bfactor");
244 std::cout <<
"PDB file: " <<
fn_pdb << std::endl
245 <<
"Sampling rate: " <<
Ts << std::endl
246 <<
"High sampling rate: " <<
highTs << std::endl
249 <<
"Center PDB: " <<
doCenter << std::endl
250 <<
"Do not Hetatm: " <<
noHet << std::endl
251 <<
"Use blobs: " <<
useBlobs << std::endl
307 int finalDim_x, finalDim_y, finalDim_z;
320 Vhigh().initZeros(finalDim_x,finalDim_y,finalDim_z);
322 Vhigh().setXmippOrigin();
330 std::cout <<
"The highly sampled volume is of size " <<
XSIZE(
Vhigh())
332 std::cout <<
"Size: ";
Vhigh().printShape(); std::cout << std::endl;
343 for (
auto& atom : centered_pdb.
atomList) {
353 double weight, radius;
356 if (
noHet && atom.record ==
"HETATM")
366 weight=atom.occupancy;
371 double GaussianSigma2=(radius/(3*
sqrt(2.0)));
374 GaussianSigma2*=GaussianSigma2;
375 double GaussianNormalization = 1.0/pow(2*
PI*GaussianSigma2,1.5);
387 for (
int k = k0;
k <= kF;
k++)
388 for (
int i = i0;
i <= iF;
i++)
389 for (
int j = j0;
j <= jF;
j++)
398 GaussianNormalization;
414 double current_Ts =
highTs;
419 current_Ts *= pow(2.0, levels);
425 new_output_dim, new_output_dim, new_output_dim);
428 Vlow().setXmippOrigin();
439 std::ofstream fh_out;
440 fh_out.open((
fn_out +
"_Fourier_profile.txt").c_str());
443 fh_out <<
"# Freq(1/A) 10*log10(|Blob(f)|^2) Ts=" <<
highTs << std::endl;
450 fh_out <<
w <<
" " << 10*
log10(H*H) << std::endl;
461 Vlow().setXmippOrigin();
479 for (
auto& atom : centered_pdb.
atomList) {
481 if (
noHet && atom.record ==
"HETATM")
496 double radius2=radius*radius;
508 for (
int k = k0;
k <= kF;
k++)
510 double zdiff=
ZZ(r) -
k;
511 double zdiff2=zdiff*zdiff;
512 for (
int i = i0;
i <= iF;
i++)
514 double ydiff=
YY(r) -
i;
515 double zydiff2=zdiff2+ydiff*ydiff;
516 for (
int j = j0;
j <= jF;
j++)
518 double xdiff=
XX(r) -
j;
519 double rdiffModule2=zydiff2+xdiff*xdiff;
520 if (rdiffModule2<radius2)
522 double rdiffModule=
sqrt(rdiffModule2);
524 atom.atomType[0],rdiffModule);
533 std::cerr <<
"Ignoring atom of type *" << atom.atomType <<
"*" << std::endl;
void read(const FileName &fnPDB, const bool pseudoatoms=false, const double threshold=0.0)
Read rich phantom from either a PDB of CIF file.
double alpha
Smoothness parameter.
double getDoubleParam(const char *param, int arg=0)
#define REPORT_ERROR(nerr, ErrormMsg)
void write(const FileName &fnPDB, const bool renumber=false)
Write rich phantom to PDB or CIF file.
void atomBlobDescription(const std::string &_element, double &weight, double &radius) const
void sqrt(Image< double > &op)
Couldn't write to file.
void write(const FileName &name="", size_t select_img=ALL_IMAGES, bool isStack=false, int mode=WRITE_OVERWRITE, CastWriteMode castMode=CW_CAST, int _swapWrite=0)
void createProteinAtLowSamplingRate()
std::string intensityColumn
Column for the intensity (if any). Only valid for fixed_gaussians.
ql0001_ & k(htemp+1),(cvec+1),(atemp+1),(bj+1),(bl+1),(bu+1),(x+1),(clamda+1), &iout, infoqp, &zero,(w+1), &lenw,(iw+1), &leniw, &glob_grd.epsmac
int atomCharge(const std::string &atom)
void setup(int m, double hights, bool computeProjection=false)
#define A3D_ELEM(V, k, i, j)
const char * getParam(const char *param, int arg=0)
float textToFloat(const char *str)
int splitString(const String &input, const String &delimiter, StringVector &results, bool includeEmpties)
#define XMIPP_EQUAL_ACCURACY
void resize(size_t Xdim, bool copy=true)
void computeProteinGeometry()
void computePDBgeometry(const std::string &fnPDB, Matrix1D< double > ¢erOfMass, Matrix1D< double > &limit0, Matrix1D< double > &limitF, const std::string &intensityColumn)
Matrix1D< double > centerOfMass
Error related to numerical calculation.
void createProteinUsingScatteringProfiles()
void addExampleLine(const char *example, bool verbatim=true)
File or directory does not exist.
void createProteinAtHighSamplingRate()
void log10(Image< double > &op)
int verbose
Verbosity level.
#define NEXT_POWER_OF_2(x)
double kaiser_Fourier_value(double w, double a, double alpha, int m)
AtomInterpolator atomProfiles
std::vector< RichAtom > atomList
List of atoms.
double atomRadius(const std::string &atom)
FileName withoutExtension() const
void blobProperties() const
#define FIRST_XMIPP_INDEX(size)
#define VECTOR_R3(v, x, y, z)
int order
Derivation order and Bessel function order.
bool checkParam(const char *param)
double volumeAtDistance(char atom, double r) const
double atomRadius(char atom) const
void addUsageLine(const char *line, bool verbatim=false)
#define blob_val(r, blob)
#define LAST_XMIPP_INDEX(size)
Matrix2D< double > periodicTable
int getIntParam(const char *param, int arg=0)
double radius
Spatial radius in Universal System units.
void resize(size_t Ydim, size_t Xdim, bool noCopy=false)
void addParamsLine(const String &line)
double basvolume(double a, double alpha, int m, int n)