#!/usr/bin/perl $dir="D:/cagenome/consig/package"; #directory of the package $genelist="Mitelman2008.all.id"; #fusion (Mitelman2008.all.id) or point mutation gene list (CGC_Mutation_2008-11-05.id) $concept2gene="concepts2gene_v111808.delparent"; #concept2gene mapping open (A,"$dir/$genelist"); while () { chomp; my @l=split(/\t/); if (exists $l[0] and $l[0]=~/\d+/) { $input{$l[0]}=1; } } my $i=0; foreach $gene (keys %input) { $i++; } open (C,"$dir/$concept2gene"); while () { chomp; my @l=split(/\t/); $map{$l[0]}{$l[1]}=1; $term{$l[0]}="$l[2]\t$l[3]\t$l[4]"; } open (RE,">$dir/$genelist.concepts"); foreach $concept (keys %map) { my ($t,$n)=(0,0); foreach $geneid(keys %{$map{$concept}}) { if (exists $input{$geneid}) { $t++; } $n++; } print RE "$concept\t$term{$concept}\t$t\t$n\t$i\n"; } print "done";