コード例 #1
0
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";
}
コード例 #2
0
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
                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() << "chi2_SNP_2df\n";  // "loglik\n";
        *outfile[1] << input_var.getSep() << "chi2_SNP_A1\n";   // "loglik\n";
        *outfile[2] << input_var.getSep() << "chi2_SNP_domA1\n";// "loglik\n";
        *outfile[3] << input_var.getSep() << "chi2_SNP_recA1\n";// "loglik\n";
        *outfile[4] << input_var.getSep() << "chi2_SNP_odomA1\n"; // "loglik\n";
    } // End: ngpreds == 2
    else
    {
        cerr << "Error: create_header(): ngpreds != 1 or 2.\n";
    }
}
コード例 #3
0
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";
}