A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/sls__pvalues_8cpp_source.html below:

NCBI C++ ToolKit: src/algo/blast/gumbel_params/sls_pvalues.cpp Source File

56  if

(v1_error_>=1e100||v2_error_>=1e100)

61  return

sqrt(v1_error_*v1_error_+v2_error_*v2_error_);

70  if

(v1_error_>=1e100||v2_error_>=1e100)

75  double

a1=(v1_+v1_error_)*(v2_+v2_error_);

76  double

a2=(v1_-v1_error_)*(v2_+v2_error_);

77  double

a3=(v1_+v1_error_)*(v2_-v2_error_);

78  double

a4=(v1_-v1_error_)*(v2_-v2_error_);

91  if

(v1_error_>=1e100||v1_<0)

109  if

(v1_error_>=1e100||v2_error_>=1e100)

120  if

(v1_==0&&v1_error_==0)

128  if

(((v2_+v2_error_)*v2_<=0))

130  double

a3=(v1_+v1_error_)/(v2_-v2_error_);

131  double

a4=(v1_-v1_error_)/(v2_-v2_error_);

135  if

(((v2_-v2_error_)*v2_<=0))

137  double

a1=(v1_+v1_error_)/(v2_+v2_error_);

138  double

a2=(v1_-v1_error_)/(v2_+v2_error_);

143  double

a1=(v1_+v1_error_)/(v2_+v2_error_);

144  double

a2=(v1_-v1_error_)/(v2_+v2_error_);

145  double

a3=(v1_+v1_error_)/(v2_-v2_error_);

146  double

a4=(v1_-v1_error_)/(v2_-v2_error_);

163  return

-(y_+y_*y_/2.0+y_*y_*y_/6.0+y_*y_*y_*y_/24.0);

172  double pi

=3.1415926535897932384626433832795;

186  double

x=x_/sqrt(2.0);

187  return

1-0.5*exp(-x*x)/(x*sqrt(

pi

))*(1-1.0/(2*x*2*x));

192  double

x=x_/sqrt(2.0);

193  return

0.5*exp(-x*x)/(-x*sqrt(

pi

))*(1-1.0/(2*x*2*x));

197  double

const_val=1/sqrt(2.0*

pi

);

203  double

h=x_/(double)

N

;

209  for

(

i

=0;

i

<=

N

;

i

++)

212  double tmp

=exp(-0.5*y*y);

213  if

(

i

==0||

i

==

N

)

225  return

0.5+const_val*(res);

244  return

p_[x_n]+(p_[x_n+1]-p_[x_n])*(x_-(h_*x_n+a_))/h_;

255  return

-val_-val_*val_/2.0-val_*val_*val_/3.0;

278 bool

&area_is_1_flag_)

282  double

lambda_=par_.

lambda

;

285  double

k_error_=par_.

K_error

;

287  double

ai_hat_=par_.

a_I

;

291  double

alphai_hat_=par_.

alpha_I

;

296  double

aj_hat_=par_.

a_J

;

300  double

alphaj_hat_=par_.

alpha_J

;

305  double

sigma_hat_=par_.

sigma

;

311  bool

where_it_is_works_flag=

false

;

312  bool

negative_flag=

false

;

333  double

const_val=1/sqrt(2.0*3.1415926535897932384626433832795);

334  double eps

=0.000001;

338  double

m_li_y_error = 0.0;

346  if

(where_it_is_works_flag)

348  if

(ai_hat_*y_+bi_hat_<0)

350

negative_flag=

true

;

357  double

vi_y_error = 0.0;

360  bool

flag_Mii=

true

;

362  if

(flag_Mii||blast_)

364

vi_y_error=

error_of_the_sum

(y_*alphai_hat_,

fabs

(y_)*alphai_hat_error_,betai_hat_,betai_hat_error_);

366  if

(where_it_is_works_flag)

368  if

(alphai_hat_*y_+betai_hat_<0)

370

negative_flag=

true

;

376  double

sqrt_vi_y=sqrt(vi_y);

381  if

(sqrt_vi_y==0.0||blast_)

389

m_F=m_li_y/sqrt_vi_y;

394  double

P_m_F_error=const_val*exp(-0.5*m_F*m_F)*m_F_error;

396  double

E_m_F=-const_val*exp(-0.5*m_F*m_F);

397  double

E_m_F_error=

fabs

(-E_m_F*m_F)*m_F_error;

400  double

m_li_y_P_m_F=m_li_y*P_m_F;

402  double

sqrt_vi_y_E_m_F_error=

error_of_the_product

(sqrt_vi_y,sqrt_vi_y_error,E_m_F,E_m_F_error);

403  double

sqrt_vi_y_E_m_F=sqrt_vi_y*E_m_F;

405  double

p1_error=

error_of_the_sum

(m_li_y_P_m_F,m_li_y_P_m_F_error,sqrt_vi_y_E_m_F,sqrt_vi_y_E_m_F_error);

406  double

p1=m_li_y_P_m_F-sqrt_vi_y_E_m_F;

409  double

n_lj_y_error = 0.0;

420  if

(where_it_is_works_flag)

422  if

(aj_hat_*y_+bj_hat_<0)

424

negative_flag=

true

;

430  double

vj_y_error = 0.0;

433  bool

flag_Mjj=

true

;

435  if

(flag_Mjj||blast_)

437

vj_y_error=

error_of_the_sum

(y_*alphaj_hat_,

fabs

(y_)*alphaj_hat_error_,betaj_hat_,betaj_hat_error_);

440  if

(where_it_is_works_flag)

442  if

(alphaj_hat_*y_+betaj_hat_<0)

444

negative_flag=

true

;

453  double

sqrt_vj_y=sqrt(vj_y);

458  if

(sqrt_vj_y==0.0||blast_)

466

n_F=n_lj_y/sqrt_vj_y;

470  double

P_n_F_error=const_val*exp(-0.5*n_F*n_F)*n_F_error;

472  double

E_n_F=-const_val*exp(-0.5*n_F*n_F);

473  double

E_n_F_error=

fabs

(-E_n_F*n_F)*n_F_error;

476  double

n_lj_y_P_n_F=n_lj_y*P_n_F;

478  double

sqrt_vj_y_E_n_F_error=

error_of_the_product

(sqrt_vj_y,sqrt_vj_y_error,E_n_F,E_n_F_error);

479  double

sqrt_vj_y_E_n_F=sqrt_vj_y*E_n_F;

481  double

p2_error=

error_of_the_sum

(n_lj_y_P_n_F,n_lj_y_P_n_F_error,sqrt_vj_y_E_n_F,sqrt_vj_y_E_n_F_error);

482  double

p2=n_lj_y_P_n_F-sqrt_vj_y_E_n_F;

487  double

c_y_error = 0.0;

490  bool

flag_Mij=

true

;

492  if

(flag_Mij||blast_)

494

c_y_error=

error_of_the_sum

(sigma_hat_*y_,sigma_hat_error_*y_,tau_hat_,tau_hat_error_);

497  if

(where_it_is_works_flag)

499  if

(sigma_hat_*y_+tau_hat_<0)

501

negative_flag=

true

;

508  double

P_m_F_P_n_F=P_m_F*P_n_F;

510  double

c_y_P_m_F_P_n_F_error=

error_of_the_product

(c_y,c_y_error,P_m_F_P_n_F,P_m_F_P_n_F_error);

511  double

c_y_P_m_F_P_n_F=c_y*P_m_F_P_n_F;

519  double

area_error=

error_of_the_sum

(p1_p2,p1_p2_error,c_y_P_m_F_P_n_F,c_y_P_m_F_P_n_F_error);

520  double

area=p1_p2+c_y_P_m_F_P_n_F;

533

area_is_1_flag_=

true

;

542  if

(negative_flag&&where_it_is_works_flag)

549  double

exp_lambda_y_error=

fabs

(lambda_error_*y_*exp(-lambda_*y_));

550  double

exp_lambda_y=exp(-lambda_*y_);

553  double

area_k=area*k_;

555  double

area_k_exp_lambda_y_error=

error_of_the_product

(area_k,area_k_error,exp_lambda_y,exp_lambda_y_error);

556  double

area_k_exp_lambda_y=-area_k*exp_lambda_y;

558

P_error_=exp(area_k_exp_lambda_y)*area_k_exp_lambda_y_error;

590 bool

&area_is_1_flag_)

595  double

lambda_=par_.

lambda

;

598  double

ai_hat_=par_.

a_I

;

600  double

alphai_hat_=par_.

alpha_I

;

603  double

aj_hat_=par_.

a_J

;

605  double

alphaj_hat_=par_.

alpha_J

;

608  double

sigma_hat_=par_.

sigma

;

612  bool

where_it_is_works_flag=

false

;

613  bool

negative_flag=

false

;

628  double

const_val=1/sqrt(2.0*3.1415926535897932384626433832795);

629  double eps

=0.000001;

639  if

(where_it_is_works_flag)

641  if

(ai_hat_*y_+bi_hat_<0)

643

negative_flag=

true

;

651  bool

flag_Mii=

true

;

653  if

(flag_Mii||blast_)

656  if

(where_it_is_works_flag)

658  if

(alphai_hat_*y_+betai_hat_<0)

660

negative_flag=

true

;

665  double

sqrt_vi_y=sqrt(vi_y);

669  if

(sqrt_vi_y==0.0||blast_)

675

m_F=m_li_y/sqrt_vi_y;

681  double

E_m_F=-const_val*exp(-0.5*m_F*m_F);

683  double

m_li_y_P_m_F=m_li_y*P_m_F;

685  double

sqrt_vi_y_E_m_F=sqrt_vi_y*E_m_F;

687  double

p1=m_li_y_P_m_F-sqrt_vi_y_E_m_F;

699  if

(where_it_is_works_flag)

701  if

(aj_hat_*y_+bj_hat_<0)

703

negative_flag=

true

;

711  bool

flag_Mjj=

true

;

713  if

(flag_Mjj||blast_)

717  if

(where_it_is_works_flag)

719  if

(alphaj_hat_*y_+betaj_hat_<0)

721

negative_flag=

true

;

729  double

sqrt_vj_y=sqrt(vj_y);

733  if

(sqrt_vj_y==0.0||blast_)

739

n_F=n_lj_y/sqrt_vj_y;

744  double

E_n_F=-const_val*exp(-0.5*n_F*n_F);

746  double

n_lj_y_P_n_F=n_lj_y*P_n_F;

748  double

sqrt_vj_y_E_n_F=sqrt_vj_y*E_n_F;

750  double

p2=n_lj_y_P_n_F-sqrt_vj_y_E_n_F;

757  bool

flag_Mij=

true

;

759  if

(flag_Mij||blast_)

763  if

(where_it_is_works_flag)

765  if

(sigma_hat_*y_+tau_hat_<0)

767

negative_flag=

true

;

773  double

P_m_F_P_n_F=P_m_F*P_n_F;

775  double

c_y_P_m_F_P_n_F=c_y*P_m_F_P_n_F;

782  double

area=p1_p2+c_y_P_m_F_P_n_F;

795

area_is_1_flag_=

true

;

804  if

(negative_flag&&where_it_is_works_flag)

811  double

exp_lambda_y=exp(-lambda_*y_);

813  double

area_k=area*k_;

815  double

area_k_exp_lambda_y=-area_k*exp_lambda_y;

842 bool

&area_is_1_flag_)

847  throw error

(

"Unexpected error in get_P_error_using_splitting_method\n"

,1);

854

vector<double> P_values(dim);

857  for

(

i

=0;

i

<dim;

i

++)

872

par_tmp.

a

=0.5*(par_tmp.

a_I

+par_tmp.

a_J

);

902

par_tmp.

G

=par_.

G

;

904  double

P_tmp,P_tmp_error,area_tmp;

945  for

(

i

=0;

i

<dim;

i

++)

947  double tmp

=P_values[

i

]/P_;

951

P_error_/=(double)dim;

963  bool

ee_error_flag=

false

;

964  error

ee_error(

""

,0);

984

ee_error_flag=

true

;

990

ee_error_flag=

true

;

991

ee_error=

error

(

"Internal error in the program\n"

,1);

1017

vector<double> &P_values,

1018

vector<double> &P_values_errors)

1022  throw error

(

"Error - Score2<Score1\n"

,2);

1025  if

(Seq1Len<=0||Seq2Len<=0)

1027  throw error

(

"Error - Seq1Len<=0||Seq2Len<=0\n"

,2);

1036

P_values.resize(ymax_-ymin_+1);

1037

P_values_errors.resize(ymax_-ymin_+1);

1042  for

(y=ymin_;y<=ymax_;y++)

1048  bool

area_is_1_flag=

false

;

1075  double

P_tmp,area_tmp;

1100

P_error=P_error/P_tmp*

P

;

1103

P_values_errors[y-ymin_]=P_error;

1107

P_values_errors[y-ymin_]=-DBL_MAX;

1133

P_values_errors[y-ymin_]=P_error;

1138

P_values[y-ymin_]=

P

;

static double round(const double &x_)

static T Tmax(T i_, T j_)

static T Tmin(T i_, T j_)

static double sqrt_for_errors(double x_)

static double ln_one_minus_val(double val_)

static double one_minus_exp_function(double y_)

static void get_appr_tail_prob_with_cov(set_of_parameters &par_, bool blast_, double y_, Int4 m_, Int4 n_, double &P_, double &P_error_, double &area_, double a_normal_, double b_normal_, double h_normal_, Int4 N_normal_, double *p_normal_, bool &area_is_1_flag_)

static double error_of_the_ratio(double v1_, double v1_error_, double v2_, double v2_error_)

static double normal_probability(double x_, double eps_)

static double error_of_the_product(double v1_, double v1_error_, double v2_, double v2_error_)

static void get_P_error_using_splitting_method(set_of_parameters &par_, bool blast_, double y_, Int4 m_, Int4 n_, double &P_, double &P_error_, double &area_, double a_normal_, double b_normal_, double h_normal_, Int4 N_normal_, double *p_normal_, bool &area_is_1_flag_)

static double error_of_the_sum(double v1_, double v1_error_, double v2_, double v2_error_)

static double error_of_the_sqrt(double v1_, double v1_error_)

static void get_appr_tail_prob_with_cov_without_errors(set_of_parameters &par_, bool blast_, double y_, Int4 m_, Int4 n_, double &P_, double &P_error_, double &area_, double a_normal_, double b_normal_, double h_normal_, Int4 N_normal_, double *p_normal_, bool &area_is_1_flag_)

void calculate_P_values(Int4 Score1, Int4 Score2, Int4 Seq1Len, Int4 Seq2Len, set_of_parameters &ParametersSet, std::vector< double > &P_values, std::vector< double > &P_values_errors)

int32_t Int4

4-byte (32-bit) signed integer

#define NORMAL_DISTR_ARRAY_DIM

double * GetNormalDistrArrayForPvaluesCalculation(void)

const bool read_Sbs_par_flag

std::vector< double > m_KSbs

std::vector< double > m_SigmaSbs

std::vector< double > m_AlphaJSbs

std::vector< double > m_CSbs

std::vector< double > m_AlphaISbs

std::vector< double > m_AJSbs

std::vector< double > m_LambdaSbs

std::vector< double > m_AISbs

double gapless_alpha_error


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4