Skip to content

Commit

Permalink
Fix Issue GenABEL-Project#21: Remove "interaction_only" option
Browse files Browse the repository at this point in the history
According to Yurii's reply on a forum topic, this option never worked as
intended and should have been removed long time ago: "Never use
'--interaction_only' option! This is something form our early
experiments with GxE, and it has proven to generate crap results (GC
lambda << 1)."
  • Loading branch information
lckarssen committed Mar 1, 2016
1 parent afb3c91 commit 44284b2
Show file tree
Hide file tree
Showing 14 changed files with 17 additions and 179 deletions.
2 changes: 2 additions & 0 deletions doc/ChangeLog
Expand Up @@ -11,6 +11,8 @@
** Overall runtime using above settings is 5
* Handles multiple variants of NaN (NA,Na,Nan,na,nan) correct while reading of
mldose/mlprob files
* Fixed Issue #21: Remove "interaction_only" option. According to Yurii's
post on the forum this option never worked as expected.
* Fixed bugs #5883 & #6010: The main effect is displayed in the output with the
`interaction_only` option. Thanks to Maksim Struchalin & Lennart Karssen for
fixing it and to Farid Radmanesh for reporting it. This was only a display
Expand Down
15 changes: 0 additions & 15 deletions doc/ProbABEL_manual.tex
Expand Up @@ -486,7 +486,6 @@ \section{Running an analysis}
--no-head : do not report header line
--allcov : report estimates for all covariates (large outputs!)
--interaction: Which covariate to use for interaction with SNP analysis (default is no interaction, 0)
--interaction_only: like previous but without covariate acting in interaction with SNP (default is no interaction, 0)
--mmscore : score test in samples of related individuals. File with inverse of variance-covariance matrix (for palinear) or inverse correlation (for palogist) as input parameter
--robust : report robust (aka sandwich, aka Hubert-White) standard errors
--help : print help
Expand Down Expand Up @@ -604,20 +603,6 @@ \subsection{Advanced analysis options}
variance should be fit as part of \GA{}'s
\texttt{polygenic} procedure.

The option \lstinline{--interaction_only} is like \lstinline{--interaction}
but does not include the main effect of the covariate which is acting
in interaction with SNP into the model. For example, if \texttt{age}
is the second covariate in the phenotype file, using the option
\lstinline{--interaction_only=2} leads to the following model:
\begin{equation*}
\textrm{trait} \sim \textrm{sex} + \textrm{SNP} +
\textrm{age} \times \mathrm{SNP}.
\end{equation*}

This option is useful when
running \lstinline{--mmscore}, in which case the main effect should
normally estimated in the polygenic model and only the interaction
term in the \PA{} analysis.

\subsection{Running multiple analyses at once: \texttt{probabel}}
The \texttt{bin/probabel} script is a handy wraper for the \PA{}
Expand Down
5 changes: 0 additions & 5 deletions doc/pacoxph.1
Expand Up @@ -62,11 +62,6 @@ Report estimates for all covariates (large outputs!).
.BI "\-b, \-\^\-interaction" " NUMBER"
Which covariate to use for interaction with SNP analysis (default is no interaction, 0). \fINUMBER\fR indicates the column number of the covariate.
.TP
.BI "\-k, \-\^\-interaction_only" " NUMBER"
Like
.B \-\^\-interaction
but excludes the covariate-only model term for the covariate acting in interaction with the SNP (default is no interaction, 0).
.TP
.B \-\^\-help
Print help.

Expand Down
5 changes: 0 additions & 5 deletions doc/palinear.1
Expand Up @@ -61,11 +61,6 @@ Report estimates for all covariates (large outputs!).
.BI "\-b, \-\^\-interaction" " NUMBER"
Which covariate to use for interaction with SNP analysis (default is no interaction, 0). \fINUMBER\fR indicates the column number of the covariate.
.TP
.BI "\-k, \-\^\-interaction_only" " NUMBER"
Like
.B \-\^\-interaction
but excludes the covariate-only model term for the covariate acting in interaction with the SNP (default is no interaction, 0).
.TP
.BI "\-v, \-\^\-mmscore" " FILE"
Score test in samples of related individuals. The FILE argument is the name of a file with the inverse of the variance-covariance matrix.
.TP
Expand Down
5 changes: 0 additions & 5 deletions doc/palogist.1
Expand Up @@ -61,11 +61,6 @@ Report estimates for all covariates (large outputs!).
.BI "\-b, \-\^\-interaction" " NUMBER"
Which covariate to use for interaction with SNP analysis (default is no interaction, 0). \fINUMBER\fR indicates the column number of the covariate.
.TP
.BI "\-k, \-\^\-interaction_only" " NUMBER"
Like
.B \-\^\-interaction
but excludes the covariate-only model term for the covariate acting in interaction with the SNP (default is no interaction, 0).
.TP
.BI "\-v, \-\^\-mmscore" " FILE"
Score test in samples of related individuals. The FILE argument is the name of a file with the inverse correlation matrix. NOTE THAT THIS FEATURE IS STILL EXPERIMENTAL!
.TP
Expand Down
18 changes: 1 addition & 17 deletions src/command_line_settings.cpp
Expand Up @@ -159,7 +159,7 @@ char* cmdvars::getPhefilename() const
void cmdvars::set_variables(int argc, char * argv[])
{
int next_option;
const char * const short_options = "p:i:d:m:n:c:o:s:t:g:a:relhb:k:v:u";
const char * const short_options = "p:i:d:m:n:c:o:s:t:g:a:relhb:v:u";
// b - interaction parameter
// ADD --fv FLAG (FILEVECTOR), IN WHICH CASE USE ALTERNATIVE
// CONSTRUCTOR FOR GENDATA
Expand All @@ -181,7 +181,6 @@ void cmdvars::set_variables(int argc, char * argv[])
{ "allcov", 0, NULL, 'l' },
{ "help", 0, NULL, 'h' },
{ "interaction", 1, NULL, 'b' },
{ "interaction_only", 1, NULL, 'k' },
{ "mmscore", 1, NULL, 'v' },
{ "robust", 0, NULL, 'u' },
{ NULL, 0, NULL, 0 } };
Expand Down Expand Up @@ -252,9 +251,6 @@ void cmdvars::set_variables(int argc, char * argv[])
case 'b':
interaction = atoi(optarg);
break;
case 'k':
interaction_excluded = atoi(optarg);
break;
case 'v':
inverse_filename = optarg;
break;
Expand All @@ -273,12 +269,6 @@ void cmdvars::set_variables(int argc, char * argv[])
} // end of function


bool cmdvars::isIsInteractionExcluded() const
{
return is_interaction_excluded;
}


void cmdvars::printinfo()
{
print_version();
Expand Down Expand Up @@ -332,7 +322,6 @@ void cmdvars::printinfo()
cout << "\t --ntraits = " << noutcomes << endl;
cout << "\t --ngpreds = " << ngpreds << endl;
cout << "\t --interaction = " << interaction << endl;
cout << "\t --interaction_only = " << interaction_excluded << endl;

if (inverse_filename != NULL)
cout << "\t --mmscore = " << inverse_filename << endl;
Expand Down Expand Up @@ -381,11 +370,6 @@ void cmdvars::printinfo()
exit(1);
}

if (interaction_excluded != 0)
{
interaction = interaction_excluded; // ups
is_interaction_excluded = true;
}
if (outfilename.compare("") == 0)
{
outfilename = string("regression");
Expand Down
5 changes: 0 additions & 5 deletions src/command_line_settings.h
Expand Up @@ -51,8 +51,6 @@ class cmdvars
int npeople;
int ngpreds;
int interaction;
int interaction_excluded;
bool is_interaction_excluded;
int robust;
string chrom;
string sep;
Expand Down Expand Up @@ -82,8 +80,6 @@ class cmdvars
npeople = -1;
ngpreds = 1;
interaction = 0;
interaction_excluded = 0;
is_interaction_excluded = false; //Oh Holy Matrix, forgive me for this!
robust = 0;
chrom = "-1";
str_genfilename = "";
Expand Down Expand Up @@ -125,7 +121,6 @@ class cmdvars
string getStrGenfilename() const;

void printinfo();
bool isIsInteractionExcluded() const;
};

#endif /* COMMAND_LINE_SETTINGS_H_ */
4 changes: 2 additions & 2 deletions src/main.cpp
Expand Up @@ -140,7 +140,7 @@ int main(int argc, char * argv[])
#if COXPH
coxph_data nrgd = coxph_data(phd, gtd, -1);
#else
regdata nrgd = regdata(phd, gtd, -1, input_var.isIsInteractionExcluded());
regdata nrgd = regdata(phd, gtd, -1);
#endif

std::cout << " loaded null data..." << std::flush;
Expand Down Expand Up @@ -175,7 +175,7 @@ int main(int argc, char * argv[])
#if COXPH
coxph_data rgd(phd, gtd, 0);
#else
regdata rgd(phd, gtd, 0, input_var.isIsInteractionExcluded());
regdata rgd(phd, gtd, 0);
#endif
std::cout << " formed regression object...\n";

Expand Down
1 change: 0 additions & 1 deletion src/main_functions_dump.cpp
Expand Up @@ -114,7 +114,6 @@ void open_files_for_output(std::vector<std::ofstream*>& outfile,

int create_phenotype(phedata& phd, const cmdvars& input_var)
{
phd.set_is_interaction_excluded(input_var.isIsInteractionExcluded());
phd.setphedata(input_var.getPhefilename(),
input_var.getNoutcomes(),
input_var.getNpeople(),
Expand Down
33 changes: 4 additions & 29 deletions src/phedata.cpp
Expand Up @@ -48,11 +48,6 @@ phedata::phedata(const char * fname, const int noutc, const int npeople,
setphedata(fname, noutc, npeople, interaction, iscox);
}

void phedata::set_is_interaction_excluded(const bool int_exl)
{
is_interaction_excluded = int_exl;
}


/**
* Read phenotype data from file.
Expand Down Expand Up @@ -160,12 +155,6 @@ void phedata::setphedata(const char * fname, const int noutc,
for (int i = (2 + noutcomes); i < nphenocols; i++)
{
infile >> tmp;
if (n_model_terms == interaction && is_interaction_excluded)
{
interaction_cov_name = tmp;
n_model_terms++;
continue;
}

model = model + " + ";
model = model + tmp;
Expand All @@ -177,27 +166,13 @@ void phedata::setphedata(const char * fname, const int noutc,
{
if (iscox)
{
if (!is_interaction_excluded)
{
model = model + " + "
+ model_terms[interaction - 1]
+ "*SNP_A1";
}
else
{
model = model + " + " + interaction_cov_name + "*SNP_A1";
}
model = model + " + "
+ model_terms[interaction - 1]
+ "*SNP_A1";
}
else
{
if (!is_interaction_excluded)
{
model = model + " + " + model_terms[interaction] + "*SNP_A1";
}
else
{
model = model + " + " + interaction_cov_name + "*SNP_A1";
}
model = model + " + " + model_terms[interaction] + "*SNP_A1";
}
}
model_terms[n_model_terms++] = "SNP_A1";
Expand Down
5 changes: 0 additions & 5 deletions src/phedata.h
Expand Up @@ -50,7 +50,6 @@ class phedata {
public:
phedata()
{
is_interaction_excluded = 0;
nids_all = 0;
nids = 0;
noutcomes = 0;
Expand All @@ -69,10 +68,6 @@ class phedata {

void setphedata(const char * fname, const int noutc, const int npeople,
const int interaction, const bool iscox);
void set_is_interaction_excluded(const bool inter_excluded);


bool is_interaction_excluded;

/**
* \brief The total number of individuals in the phenotype file,
Expand Down

0 comments on commit 44284b2

Please sign in to comment.