cat ../../targ_domains.txt | perl -ne 'chomp; my $t=$_;  if(/^(T....)\_(\d+)/) { $full=$1; $dom="d$2"; if(/\.new$/) { $indir = "/home/syshi_3/casp/Sep27newdomain/domainrun"; } else { $indir = "/home/syshi_3/casp/Sep8domainrun"; } } else { $full=$t; $dom=""; $indir = "/home/syshi_3/casp/Sep8chainrun/"; } open(FOUT, "> $t\.lga.dat") || die "Cannot open output $t\.lga.dat : $!\n"; my @files = glob("$indir\/$full\/*\.$full*$dom\.pdb\.d4\.0\.res"); for $file(@files) { $file =~ /$indir\/$full\/(.*?)\.(.*?)\.pdb\.d4\.0\.res/ || die "Weird LGA file name: $file\n"; my $serv=$1; my $lgatarg=$2; open(F, $file) || die "Cannot open $file : $!\n"; $/="\nSUMMARY(GDT)"; my @chunks=<F>; close(F); $/="\n"; my @lines = split /\n/, $chunks[1]; $line = $lines[0]; $line=~ s/^\s+//; $line =~ s/\s+/\t/g; print FOUT "$t\t$lgatarg\t$serv\t$line\n";   } close(FOUT)
; ' > & log.tmp &
