本文整理汇总了C++中cmdvars类的典型用法代码示例。如果您正苦于以下问题:C++ cmdvars类的具体用法?C++ cmdvars怎么用?C++ cmdvars使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了cmdvars类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: create_phenotype
int create_phenotype(phedata& phd, cmdvars& input_var)
{
phd.set_is_interaction_excluded(input_var.isIsInteractionExcluded());
phd.setphedata(input_var.getPhefilename(),
input_var.getNoutcomes(),
input_var.getNpeople(),
input_var.getInteraction(),
input_var.isIscox());
int interaction_cox = input_var.getInteraction();
#if COXPH
interaction_cox--;
#endif
if (input_var.getInteraction() < 0 ||
input_var.getInteraction() > phd.ncov ||
interaction_cox > phd.ncov)
{
std::cerr << "error: Interaction parameter is out of range "
<< "(interaction="
<< input_var.getInteraction()
<< ") \n";
exit(1);
}
return interaction_cox;
}
示例2: create_header2
void create_header2(std::vector<std::ofstream*>& outfile, cmdvars& input_var,
phedata& phd, int interaction_cox)
{
create_start_of_header(outfile, input_var, phd);
*outfile[0] << input_var.getSep() << "beta_SNP_add"
<< input_var.getSep() << "sebeta_SNP_add";
if (input_var.getInteraction() != 0)
{
*outfile[0] << input_var.getSep() << "beta_SNP_"
<< phd.model_terms[interaction_cox]
<< input_var.getSep() << "sebeta_SNP_"
<< phd.model_terms[interaction_cox];
}
if (input_var.getInverseFilename() == NULL)
{
//Han Chen
#if !COXPH
if (input_var.getInteraction() != 0 && !input_var.getAllcov())
{
*outfile[0] << input_var.getSep() << "cov_SNP_int_SNP_"
<< phd.model_terms[interaction_cox];
}
#endif
*outfile[0] << input_var.getSep() << "loglik"; //"chi2_SNP";
}
//Oct 26, 2009
*outfile[0] << "\n";
}
示例3: loadInvSigma
void loadInvSigma(cmdvars& input_var, phedata& phd, masked_matrix& invvarmatrix)
{
std::cout << "you are running mmscore...\n";
InvSigma inv(input_var.getInverseFilename(), &phd);
// invvarmatrix = inv.get_matrix();
//double par = 1.; //var(phd.Y)*phd.nids/(phd.nids-phd.ncov-1);
invvarmatrix.set_matrix(inv.get_matrix()); // = invvarmatrix * par;
std::cout << " loaded InvSigma ..." << std::flush;
}
示例4: get_start_position
int get_start_position(const cmdvars& input_var, int model,
int number_of_rows_or_columns)
{
int start_pos;
if (!input_var.getAllcov() &&
model == 0 &&
input_var.getInteraction() == 0)
{
if (input_var.getNgpreds() == 2)
{
start_pos = number_of_rows_or_columns - 2;
} else
{
start_pos = number_of_rows_or_columns - 1;
}
} else if (!input_var.getAllcov() && model == 0
&& input_var.getInteraction() != 0)
{
if (input_var.getNgpreds() == 2)
{
start_pos = number_of_rows_or_columns - 4;
} else
{
start_pos = number_of_rows_or_columns - 2;
}
} else if (!input_var.getAllcov() && model != 0
&& input_var.getInteraction() == 0)
{
start_pos = number_of_rows_or_columns - 1;
} else if (!input_var.getAllcov() && model != 0
&& input_var.getInteraction() != 0)
{
start_pos = number_of_rows_or_columns - 2;
} else
{
start_pos = 0;
}
return start_pos;
}
示例5: write_mlinfo
void write_mlinfo(const std::vector<std::ofstream*>& outfile, unsigned int file,
const mlinfo& mli, int csnp, const cmdvars& input_var,
int gcount, double freq)
{
*outfile[file] << mli.name[csnp]
<< input_var.getSep()
<< mli.A1[csnp]
<< input_var.getSep()
<< mli.A2[csnp]
<< input_var.getSep()
<< mli.Freq1[csnp]
<< input_var.getSep()
<< mli.MAF[csnp]
<< input_var.getSep()
<< mli.Quality[csnp]
<< input_var.getSep()
<< mli.Rsq[csnp]
<< input_var.getSep()
<< gcount
<< input_var.getSep()
<< freq;
if (input_var.getChrom() != "-1")
{
*outfile[file] << input_var.getSep() << input_var.getChrom();
}
if (input_var.getMapfilename() != NULL)
{
*outfile[file] << input_var.getSep() << mli.map[csnp];
}
}
示例6: create_header
void create_header(std::vector<std::ofstream*>& outfile, cmdvars& input_var,
phedata& phd, int& interaction_cox)
{
create_start_of_header(outfile, input_var, phd);
if (input_var.getNgpreds() == 1) // dose data: only additive model
{
*outfile[0] << input_var.getSep()
<< "beta_SNP_add"
<< input_var.getSep()
<< "sebeta_SNP_add";
if (input_var.getInteraction() != 0)
{
*outfile[0] << input_var.getSep()
<< "beta_SNP_"
<< phd.model_terms[interaction_cox]
<< input_var.getSep()
<< "sebeta_SNP_"
<< phd.model_terms[interaction_cox];
}
if (input_var.getInverseFilename() == NULL)
{
//Han Chen
#if !COXPH
if (input_var.getInteraction() != 0 && !input_var.getAllcov())
{
*outfile[0] << input_var.getSep()
<< "cov_SNP_int_SNP_"
<< phd.model_terms[interaction_cox];
}
#endif
}
*outfile[0] << input_var.getSep() << "chi2_SNP";
*outfile[0] << "\n";
} // ngpreds == 1
else if (input_var.getNgpreds() == 2) // prob data: all models
{
*outfile[0] << input_var.getSep()
<< "beta_SNP_A1A2"
<< input_var.getSep()
<< "sebeta_SNP_A1A2"
<< input_var.getSep()
<< "beta_SNP_A1A1"
<< input_var.getSep()
<< "sebeta_SNP_A1A1";
*outfile[1] << input_var.getSep()
<< "beta_SNP_addA1"
<< input_var.getSep()
<< "sebeta_SNP_addA1";
*outfile[2] << input_var.getSep()
<< "beta_SNP_domA1"
<< input_var.getSep()
<< "sebeta_SNP_domA1";
*outfile[3] << input_var.getSep()
<< "beta_SNP_recA1"
<< input_var.getSep()
<< "sebeta_SNP_recA1";
*outfile[4] << input_var.getSep()
<< "beta_SNP_odomA1"
<< input_var.getSep()
<< "sebeta_SNP_odomA1";
if (input_var.getInteraction() != 0)
{
//Han Chen
*outfile[0] << input_var.getSep()
<< "beta_SNP_A1A2_"
<< phd.model_terms[interaction_cox]
<< input_var.getSep()
<< "sebeta_SNP_A1A2_"
<< phd.model_terms[interaction_cox]
<< input_var.getSep()
<< "beta_SNP_A1A1_"
<< phd.model_terms[interaction_cox]
<< input_var.getSep()
<< "sebeta_SNP_A1A1_"
<< phd.model_terms[interaction_cox];
#if !COXPH
if (input_var.getInverseFilename() == NULL && !input_var.getAllcov())
{
*outfile[0] << input_var.getSep()
<< "cov_SNP_A1A2_int_SNP_"
<< phd.model_terms[interaction_cox]
<< input_var.getSep()
<< "cov_SNP_A1A1_int_SNP_"
<< phd.model_terms[interaction_cox];
}
#endif
//Oct 26, 2009
for (unsigned int file = 1; file < outfile.size(); file++)
{
*outfile[file] << input_var.getSep()
<< "beta_SNP_"
<< phd.model_terms[interaction_cox]
<< input_var.getSep()
<< "sebeta_SNP_"
<< phd.model_terms[interaction_cox];
//Han Chen
#if !COXPH
//.........这里部分代码省略.........
示例7: create_start_of_header
void create_start_of_header(std::vector<std::ofstream*>& outfile,
cmdvars& input_var, phedata& phd)
{
for (unsigned int i = 0; i < outfile.size(); i++)
{
(*outfile[i]) << "name"
<< input_var.getSep()
<< "A1"
<< input_var.getSep()
<< "A2"
<< input_var.getSep()
<< "Freq1"
<< input_var.getSep()
<< "MAF"
<< input_var.getSep()
<< "Quality"
<< input_var.getSep()
<< "Rsq"
<< input_var.getSep()
<< "n"
<< input_var.getSep()
<< "Mean_predictor_allele";
if (input_var.getChrom() != "-1")
(*outfile[i]) << input_var.getSep() << "chrom";
if (input_var.getMapfilename() != NULL)
(*outfile[i]) << input_var.getSep() << "position";
}
if (input_var.getAllcov()) //All covariates in output
{
for (unsigned int file = 0; file < outfile.size(); file++)
for (int i = 0; i < phd.n_model_terms - 1; i++)
*outfile[file] << input_var.getSep()
<< "beta_"
<< phd.model_terms[i]
<< input_var.getSep()
<< "sebeta_"
<< phd.model_terms[i];
}
}
示例8: create_header_1
void create_header_1(std::vector<std::ofstream*>& outfile, cmdvars& input_var,
phedata& phd, int& interaction_cox)
{
create_start_of_header(outfile, input_var, phd);
*outfile[0] << input_var.getSep() << "beta_SNP_A1A2" << input_var.getSep()
<< "beta_SNP_A1A1" << input_var.getSep() << "sebeta_SNP_A1A2"
<< input_var.getSep() << "sebeta_SNP_A1A1";
*outfile[1] << input_var.getSep() << "beta_SNP_addA1" << input_var.getSep()
<< "sebeta_SNP_addA1";
*outfile[2] << input_var.getSep() << "beta_SNP_domA1" << input_var.getSep()
<< "sebeta_SNP_domA1";
*outfile[3] << input_var.getSep() << "beta_SNP_recA1" << input_var.getSep()
<< "sebeta_SNP_recA1";
*outfile[4] << input_var.getSep() << "beta_SNP_odom" << input_var.getSep()
<< "sebeta_SNP_odom";
if (input_var.getInteraction() != 0)
{
//Han Chen
*outfile[0] << input_var.getSep() << "beta_SNP_A1A2_"
<< phd.model_terms[interaction_cox]
<< input_var.getSep() << "sebeta_SNP_A1A2_"
<< phd.model_terms[interaction_cox]
<< input_var.getSep() << "beta_SNP_A1A1_"
<< phd.model_terms[interaction_cox]
<< input_var.getSep() << "sebeta_SNP_A1A1_"
<< phd.model_terms[interaction_cox];
#if !COXPH
if (input_var.getInverseFilename() == NULL && !input_var.getAllcov())
{
*outfile[0] << input_var.getSep() << "cov_SNP_A1A2_int_SNP_"
<< phd.model_terms[interaction_cox]
<< input_var.getSep() << "cov_SNP_A1A1_int_SNP_"
<< phd.model_terms[interaction_cox];
}
#endif
//Oct 26, 2009
for (unsigned int file = 1; file < outfile.size(); file++)
{
*outfile[file] << input_var.getSep() << "beta_SNP_"
<< phd.model_terms[interaction_cox]
<< input_var.getSep() << "sebeta_SNP_"
<< phd.model_terms[interaction_cox];
//Han Chen
#if !COXPH
if (input_var.getInverseFilename() == NULL
&& !input_var.getAllcov())
{
*outfile[file] << input_var.getSep() << "cov_SNP_int_SNP_"
<< phd.model_terms[interaction_cox];
}
#endif
//Oct 26, 2009
}
}
*outfile[0] << input_var.getSep() << "loglik\n"; //"chi2_SNP_2df\n";
*outfile[1] << input_var.getSep() << "loglik\n"; //"chi2_SNP_A1\n";
*outfile[2] << input_var.getSep() << "loglik\n"; //"chi2_SNP_domA1\n";
*outfile[3] << input_var.getSep() << "loglik\n"; //"chi2_SNP_recA1\n";
*outfile[4] << input_var.getSep() << "loglik\n"; //"chi2_SNP_odom\n";
}