[GenABEL-dev] [Genabel-commits] r1803 - pkg/ProbABEL/src
L.C. Karssen
lennart at karssen.org
Fri Aug 22 14:29:02 CEST 2014
Hi Maksim,
Thank you for fixing bug #5883!
I noticed that the patch wasn't following our coding style guidelines
(see http://genabel.r-forge.r-project.org/codingstyle.html). For example
you had a couple of very long lines and no spaces around operators (i.e.
<<). I've fixed those in r1805.
Regarding the output that print I have a few questions. If I run
ProbABLE now, I get this (partial) output:
Actual number of people in phenofile = 200; using all of these
nphenocols=4
i=3, is_interaction_excluded=0, interaction=1, n_model_terms=2
model=( height ) ~ mu + sex + age
Linear model: ( height ) ~ mu + sex + age + SNP_A1 + sex*SNP_A1
Can you please explain why you print the variables in the line that
starts with "i=3"? Is that just debug output that shouldn't have been
committed?
And about the line starting with "model=": is that also debug output
(the next line prints the same information)?
Thanks for clearing this up,
Lennart.
On 21-08-14 07:57, noreply at r-forge.r-project.org wrote:
> Author: maksim
> Date: 2014-08-21 07:57:37 +0200 (Thu, 21 Aug 2014)
> New Revision: 1803
>
> Modified:
> pkg/ProbABEL/src/phedata.cpp
> Log:
> Fixed an issue with --interaction_only when ProbABEL reported wrong model (the same as for --intreaction) while analysis was done correctly for --interaction_only.
>
> Modified: pkg/ProbABEL/src/phedata.cpp
> ===================================================================
> --- pkg/ProbABEL/src/phedata.cpp 2014-08-15 12:59:56 UTC (rev 1802)
> +++ pkg/ProbABEL/src/phedata.cpp 2014-08-21 05:57:37 UTC (rev 1803)
> @@ -27,6 +27,7 @@
> #include <fstream>
> #include <cstdarg>
> #include <cstdlib>
> +#include <cstring>
>
> using std::cout;
> using std::cerr;
> @@ -66,6 +67,7 @@
> std::ifstream myfile(fname);
> char *line = new char[BFS];
> char *tmp = new char[BFS];
> + char *interaction_cov_name = new char[BFS];
> noutcomes = noutc;
> is_interaction_excluded = false;
>
> @@ -146,6 +148,11 @@
> model_terms[n_model_terms++] = "mu";
> #endif
>
> +
> +
> +
> +
> +
> if (nphenocols > noutcomes + 1)
> {
> infile >> tmp;
> @@ -154,12 +161,18 @@
> for (int i = (2 + noutcomes); i < nphenocols; i++)
> {
> infile >> tmp;
> + std::cout << "nphenocols="<<nphenocols<<"\n";
> + std::cout<<"i="<<i<<", is_interaction_excluded="<<is_interaction_excluded<<", interaction="<<interaction<<", n_model_terms="<<n_model_terms<<"\n";
> + if(n_model_terms == interaction && is_interaction_excluded)
> + {
> + strcpy(interaction_cov_name, tmp);
> + continue;
> + }
>
> - // if(iscox && ) {if(n_model_terms+1 == interaction-1) {continue;} }
> - // else {if(n_model_terms+1 == interaction) {continue;} }
> model = model + " + ";
> model = model + tmp;
> model_terms[n_model_terms++] = tmp;
> + std::cout << "model="<<model<<"\n";
> }
> }
> model = model + " + SNP_A1";
> @@ -167,29 +180,27 @@
> {
> if (iscox)
> {
> - model = model + " + " + model_terms[interaction - 1] + "*SNP_A1";
> + if(!is_interaction_excluded) model = model + " + " + model_terms[interaction - 1] + "*SNP_A1";
> + else model = model + " + " + interaction_cov_name + "*SNP_A1";
> }
> else
> {
> - model = model + " + " + model_terms[interaction] + "*SNP_A1";
> + if(!is_interaction_excluded) model = model + " + " + model_terms[interaction] + "*SNP_A1";
> + else model = model + " + " + interaction_cov_name + "*SNP_A1";
> }
> }
> model_terms[n_model_terms++] = "SNP_A1";
>
> - if (is_interaction_excluded) // exclude covariates from covariate names
> - {
> - if (iscox)
> - {
> - std::cout << "model is running without "
> - << model_terms[interaction - 1] << ", term\n";
> - }
> - else
> - {
> - std::cout << "model is running without " << model_terms[interaction]
> - << ", term\n";
> - }
> - }
>
> +
> +
> +
> +
> +
> +
> +
> +
> +
> #if LOGISTIC
> std::cout << "Logistic ";
> #elif LINEAR
>
> _______________________________________________
> Genabel-commits mailing list
> Genabel-commits at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/genabel-commits
>
--
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
L.C. Karssen
Utrecht
The Netherlands
lennart at karssen.org
http://blog.karssen.org
GPG key ID: A88F554A
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 213 bytes
Desc: OpenPGP digital signature
URL: <http://lists.r-forge.r-project.org/pipermail/genabel-devel/attachments/20140822/83106273/attachment.sig>
More information about the genabel-devel
mailing list