예제 #1
0
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];
    }
}
예제 #2
0
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];
    }
}