-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.pl
44 lines (35 loc) · 1.15 KB
/
script.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
#!/usr/bin/perl
#This is the wrapper script for running the introgression analsis.
#It will take all of the genera listed in the sample_type.txt file and test these one at a time as potential sources of introgression
#The data analysis script identify_introgressions.pl is called for each genus in the final foreach loop below.
$min = 1;
open(IN, "sample_type.txt");
$head = <IN>;
while(<IN>)
{
chomp;
($id, $type, @other) = split(/\t/, $_);
$species = pop(@other);
$genus = pop(@other);
$type = "${genus}_$species";
print "$type\n";
if($type !~ /Triticum_aestivum/){$types{$type}++;}
}
foreach $type(sort keys %types){$n = $types{$type}; $type_by_count{$n}{$type}++;}
close IN;
foreach $n (sort {$b <=>$a} keys %type_by_count)
{
$ref = $type_by_count{$n};
%hash = %$ref;
foreach $type(sort keys %hash)
{
if($n >= $min)
{
print "$n\tRunning analysis for $type\n";
if(-e $type){} else{`mkdir $type`;}
#Introgression finding script is called here for the current genus (potential introgression donor)
$out = `./identify_introgressions.pl $type`;
print $out;
}
}
}