diff --git a/bin/vpc b/bin/vpc index e85ca3b2..ee09ce34 100755 --- a/bin/vpc +++ b/bin/vpc @@ -68,6 +68,7 @@ my %optional_options = ( 'idv:s' => undef, 'min_points_in_bin:i' => undef, 'so!' => undef, 'mix!' => undef, + 'refcorr:s' => undef, ); my $res = GetOptions( \%options, @@ -501,6 +502,15 @@ $help_text{-rawres_input} = <<'EOF'; outside of PsN, as long as the file follows the format rules. EOF +$help_text{-refcorr} = <<'EOF'; + -refcorr + + Perform reference correction on dependent variable values before computing + vpc results. The option takes a comma separated list of equals separated pairs + of column names and reference values. + Cannot be used together with -predcorr or -varcorr. +EOF + $help_text{-refstrat} = <<'EOF'; -refstrat=number @@ -668,6 +678,15 @@ if ($dummymodel){ } +my %refcorr; +if (defined $options{'refcorr'}) { + my @a = split ',', $options{'refcorr'}; + for my $e (@a) { + my @pair = split '=', $e; + $refcorr{$pair[0]} = $pair[1]; + } +} + input_checking::check_options(tool => 'vpc', options => \%options, model => $model); my $vpc = @@ -720,6 +739,7 @@ my $vpc = min_points_in_bin => $options{'min_points_in_bin'}, directory_name_prefix => 'vpc', mix => $options{'mix'}, + refcorr => \%refcorr, ); $vpc-> print_options (cmd_line => $cmd_line, diff --git a/lib/tool/npc.pm b/lib/tool/npc.pm index c7c23c66..7ac215d4 100644 --- a/lib/tool/npc.pm +++ b/lib/tool/npc.pm @@ -106,6 +106,7 @@ has 'logfile' => ( is => 'rw', isa => 'ArrayRef[Str]', default => sub { ['npc.lo has 'results_file' => ( is => 'rw', isa => 'Str', default => 'npc_results.csv' ); has 'nca' => ( is => 'rw', isa => 'Bool', default => 0 ); has 'mix' => ( is => 'rw', isa => 'Bool', default => 0 ); +has 'refcorr' => ( is => 'rw', isa => 'HashRef' ); sub BUILD {