Hi, I have a script that it sort of working, but not properly snd I can't really see why. First of all, it seems that although the OUTFILE's are being created, they are only created if the input file is below a certain size. So, for example, it will run on a input file with 500 entires but not 4000, ehich is what I want.

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


In reply to misbehaving program by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.