Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Secondly, its not deleting the .out and .dssp files at the end .. the naming strategy is correct as far as I am aware.
I would very much appreciate someone looking at my code to see where the problems might be. Thanks in advance.
#!/usr/bin/perl $pdbprep = "/home/users/alison/pdb_folder/pdb"; $pdbext = ".ent"; $dssp = ".dssp"; $pdblist = $ARGV[0]; $combodir = $ARGV[1]; $out = ".out"; open(PDBLIST, "$pdblist") || die "ERROR: Unable to open $pdblist for r +eading: $!\n"; while(<PDBLIST>) { my @fields = split; my $pdbcode = $fields[0]; $pdbcode =~ tr/[A-Z]/[a-z]/; my $dsspfile = "$pdbcode$dssp"; my $pdbstructure = "$pdbprep$pdbcode$pdbext"; $residuecombofile = "$combodir$residue1$residue2$residue3$out"; $outfile = "$pdbcode$out"; if(open(PDB,"$pdbstructure")) { system("dsspcmbi $pdbstructure $dsspfile"); CreateUniqueResidueFile($pdbstructure, $outfile); } else { $flag = 1; } if($flag == 0) { open(UNIQUE,"$outfile") || die "ERROR: Unable to open $outfile for + reading: $!\n"; @file = <UNIQUE>; $items = @file; for($j = 0; $j <$items-2; $j++) { $residuenumber1 = substr($file[$j], 1, 4); $residuename1 = substr($file[$j], 7, 3); $residuenumber2 = substr($file[$j+1], 1, 4); $residuename2 = substr($file[$j+1], 7, 3); $residuenumber3 = substr($file[$j+2], 1, 4); $residuename3 = substr($file[$j+2], 7, 3); $residuecombofile = "$combodir$residuename1$residuename2$resid +uename3$out"; ($phiangle, $psiangle) = ExtractFromDssp($residuenumber1, $re +siduenumber2, $residuenumber3, $dsspfile); if($phiangle != 0) { if($phiangle != 360) { if($psiangle !=360) { open(OUTFILE, ">>$residuecombofile") || die "ERROR: Unable + to open $residuecomdofile for writing: $!\n"; print OUTFILE "$phiangle\t$psiangle $pdbcode\n"; } } } } system("rm $dsspfile"); system("rm $outfile"); } else { print "No structure file. Moving to next structure in list\n"; } }
Janitored by Arunbear - added readmore tags, as per Monastery guidelines
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: misbehaving program
by reasonablekeith (Deacon) on Apr 20, 2005 at 10:39 UTC | |
|
Re: misbehaving program
by reneeb (Chaplain) on Apr 20, 2005 at 10:44 UTC | |
by Anonymous Monk on Apr 20, 2005 at 11:21 UTC | |
|
Re: misbehaving program
by bofh_of_oz (Hermit) on Apr 20, 2005 at 13:23 UTC | |
|
Re: misbehaving program
by tlm (Prior) on Apr 20, 2005 at 13:11 UTC | |
by BazB (Priest) on Apr 22, 2005 at 23:48 UTC |