-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTestBimFileHandler.pl
executable file
·60 lines (39 loc) · 1.42 KB
/
TestBimFileHandler.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/perl -w
use strict;
use warnings;
use BimFileHandler;
my $selectedOption;
my $methodCounter = 0;
my $maxMethodCounter = 2;
print "Which methods to do you want to test? PLEASE Enter one of TWO Valid Options ((1,A)):";
$selectedOption = <STDIN>;
chomp($selectedOption);
while($selectedOption !~ /[1Aa]/){
print "Entered Option Is Illegal. PLEASE Enter one of TWO Valid Options ((1,A)):";
$selectedOption = <STDIN>;
chomp($selectedOption);
}
if($selectedOption =~ /1/){
$maxMethodCounter = $selectedOption;
}
print "TEST::: Instantiating BimFileHandler\n";
my $bfh = BimFileHandler->new();
# 1000 Genes ----> "../imputation/plink/chr7From1000Genes/chr7From1000Genes.bim";
# Metabo Chip ---> "../imputation/plink/CAP838metabochipChr7ForJoe/CAP838metabochipChr7ForJoe.bim"
# Illumina Chip -> "../imputation/plink/CAP300and610Kchr7forJoe/CAP300and610Kchr7forJoe.bim"
print "TEST::: Extracting SNPs From BIM files\n";
my %snpMap1 = $bfh->getSNPsFromBimFile();
++$methodCounter;
if($methodCounter >= $maxMethodCounter){
exit;
}
my %snpMap2 = $bfh->getSNPsFromBimFile();
my @keys1 = keys %snpMap1;
my @keys2 = keys %snpMap2;
print "TEST::: Finding Difference Between SNP sets\n";
my @diff = $bfh->findDifferenceBetweenSnpSets(\%snpMap1, \%snpMap2);
my @snps1 = keys %snpMap1;
my @snps2 = keys %snpMap2;
print "TEST::: Writing to File\n";
$bfh-> writeFile(\@diff);
print "TEST::: ENDING TEST EXECUTION: $#snps1\t$#snps2\t$#diff\n";