#FIND UNIQUE ATTRIBUTES use Parallel::ForkManager; my $keycat = square my $specialcat = triangle my $pfm = new Parallel::ForkManager(40); $pfm->run_on_finish( sub { my ($pid, $exit_code, $ident, $exit_signal, $core_dump, $data_structure_reference) = @_; my $data = ${$data_structure_reference}; #foreach loop here my $pid = $pfm->start and next; #Next steps: #Need to find unique attributes for each category. #Foreach attribute, Foreach Category, If Pcent Category > .5 AND <.1 Foreach Pcent Category that is not first category, then #Attribute=TRUE or 1. (Every category needs to be evaluated for each attribute.) #**For an attribute to be unique it should exist in a category greater than or equal to 50% of the time, but not exist in other #categories more than 10% of the time, or #in the key category ($keycat) greater than 1/n (number of key items in key category), and not in the specialized category ($specialcat) greater than 10% #of the time (Based on input for specialized category) #****Key category is static. It will have a label that doesn't change. The specialized category will be defined before the script #runs. (ie. square, or circle, or triangle...etc.) #Create counts for how many "hits" exist per sample, per category in attributes identified as unique. (eg. If 200 attributes are #found to be unique for the square category, but an item may only have a portion of those attributes present.) #calculate average amount of hits per category from unique attribute group. (Take the average hits from all of the members of a #category from the calculation above.) #store values for future use in follow on script. $pfm->finish( 0, { data => \$data, #} #$pfm->wait_all_children;