#!/usr/local/bin/perl -w use strict; use Getopt::Long; use Tie::IxHash; my ($bpfile , $intfile, $out); my $usage = " USAGE: perl beadpool_int.pl -bpfile -int \n"; GetOptions("bp=s" =>\$bpfile, "int=s" =>\$intfile, "out=s" =>\$out) || warn "Error $!\n"; if(!$bpfile) {die "\n$usage\n"}; my %beads; tie my %ints,"Tie::IxHash"; open BP, "<$bpfile" or die $!; open INT, "<$intfile" or die $!; open OUT, ">$out"or die $!; while (my $line= ) { chomp $line; my @bp = split(/,/,$line); $beads{$bp[0]} = $bp[2]; } close BP; #my ($snp, @array) my @intensities; while (my $line = ){ chomp $line; my $LABELS_REGEX =qr(^SNP\s+Coor); if ($line !~ $LABELS_REGEX) { my ($snp, $coor, $allele,@array) = split(/\t/,$line); $ints{$snp} = \@array; @intensities = @array; } } close INT; foreach my $snp(keys %ints) { foreach my $snpbs(keys %beads){ if($snp eq $snpbs){ my @ints; for(my $i = 0;$i