Skip to content

Instantly share code, notes, and snippets.

@stephenturner
Created November 12, 2010 19:48
Show Gist options
  • Save stephenturner/674568 to your computer and use it in GitHub Desktop.
Save stephenturner/674568 to your computer and use it in GitHub Desktop.
run_step0.pl
#!/usr/bin/env perl
# runs step 0 on all chromosomes
# produces the group files and the tarballed
# sets for running step1 and step 2 on
use strict;
# create and store distributions for the top 25 models from permutation testing
# for both the model p-value and interaction p-value
my $PRGM_NAME = "run_step0.pl";
my $step0script = '/scratch/username/impute/impute_step0.sh'; #CHANGE
# Subroutine: usage
# Displays current version date and usage
sub usage{
print "\nusage:\t\t$PRGM_NAME <basename, not including .bed/bim/fam>\n\n";
print "example:\t$PRGM_NAME mydata\n\n";
}
# subroutine: check_args
# Checks number of arguments passed in and returns name of pedigree file.
sub check_args{
if(@ARGV != 1)
{ usage();
exit;}
return @ARGV;
}
my ($beginbase) = check_args();
for(my $i=1; $i<=22; $i++){
my $basefile = "$beginbase$i";
my $outbase = "$beginbase" . "_chr$i";
print "$step0script $basefile $outbase\n";
system("$step0script $basefile $outbase");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment