Skip to content

Commit

Permalink
Add option refcorr to vpc
Browse files Browse the repository at this point in the history
  • Loading branch information
rikardn committed Oct 2, 2023
1 parent c273447 commit c23e05a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
20 changes: 20 additions & 0 deletions bin/vpc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions lib/tool/npc.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down

0 comments on commit c23e05a

Please sign in to comment.