RenameN37.pl

From ZhangLabWiki
Jump to navigation Jump to search
#!/usr/bin/perl
use strict;
use Cwd;
chdir getcwd;
my $sample="../sample.txt";
open F,$sample;
my %samtable;
while(<F>){
next if /ID/;
chomp;
my ($ID,$sam,undef,$index,$sym,$proxy)=split /\t/;
$samtable{$index}=$proxy;
}
my @hapinfo=glob("*.hapInfo.txt");
foreach my $hapinfo(@hapinfo){
my ($sam,undef)=split /\./,$hapinfo;
print "$hapinfo => $samtable{$sam}.hapInfo.txt\n";
system("cp $hapinfo $samtable{$sam}.hapInfo.txt");
}