#!/usr/bin/perl # microarray filtering file use strict; use warnings; my $Micro = $ARGV[0]; my $GeneList = $ARGV[1]; open(MICRO, $Micro)||die"cannot open microarray file\n"; open(LIST, $GeneList)||die"cannot open genelist file\n"; my %hash= (); while(my $line = ){ chomp($line); # print "hi", $line, "hi", "\n"; my @words = split(/\t/,$line); my $id = $words[0]; # print"$id \n"; $hash{$id} = 0; } my @keys = keys(%hash); my $num = @keys; #print $num, "\n"; while(my $gene = ) { chomp($gene); # print $gene; for(my $i=0; $i < $num; $i++) { my $key = $keys[$i]; # print $key; chomp($key); if ($gene =~ m/$key/i) { print "$gene \n"; } } #exit; } close(MICRO); close(LIST);