6 # Don't edit the line below, it must look exactly like this.
7 # Everything above this line will be replaced #
14 use vars qw/ $opt_help /;
15 use vars qw/ $opt_model
21 $opt_debug_subroutine /;
23 ## Configure the command line parsing
24 Getopt::Long::config("auto_abbrev");
26 ## Declare the options
27 my $res = GetOptions("help", # Display help message
34 "debug_subroutine:s");
38 if($opt_help or not defined $opt_model) {
41 create_extra_data_model.pl
43 Perl script that creates and adds the necessary code for extra data
44 files (useful when the number of columns exceeds 20)
48 create_extra_data_model -model=filename
49 -extra_data=extra_data_filename
51 [-new_model_name=new_filename]
56 ./create_extra_data_model -mod=pheno.mod -extra=cov.dta -header='ID,WGT,APGR'
63 ## Check that we do have a model file
64 unless ( $opt_model ) {
65 exit "A model file must be specified\n";
68 ui
-> category
( 'model' );
70 debug
-> level
( $opt_debug );
71 debug
-> package( $opt_debug_package );
72 debug
-> subroutine
( $opt_debug_subroutine );
74 my @header = split(',',$opt_header);
76 my $model = model
-> new
( filename
=> $opt_model,
78 my $mcopy = $model -> copy
( filename
=> $opt_new_model_name,
80 $mcopy -> extra_data_files
( [$opt_extra_data] );
81 $mcopy -> extra_data_headers
( [\
@header] );
83 $mcopy -> add_extra_data_code
;
84 $mcopy -> write_get_subs
;
85 $mcopy -> write_readers
;