root221 [~/gcg]>ls a28086.pep gdec.pep gdpg.blastp glut28.strings gcgtest.pl gdec.pepsort gdpg.fasta orf15.pep gdec.bestfit gdec.pir1 gdpg.gap test.list gdec.coilscan gdec.seg gdpg.netblastp test5.pep gdec.gap gdec.spscan gi-79882.pep tests.pep gdec.hmmerpfam gdec.tfa glut104.strings txec.motifs gdec.hthscan gdechwheel.png glut27.msf gdec.motifs gdecp2s.png glut27.strings gdec.p2s gdpg.bestfit glut27pileup.png root222 [~/gcg]>ls *.composition ls: No match. root223 [~/gcg]>more gcgtest.pl #!/opt/local/bin/perl -w #program to run gcg modules # gcg is assumed to be initialized $testfile = "tests.pep"; $output = `fromfasta $testfile`; #run fromfasta gcg command @lines = split (/\n/, $output); # create a gcg format .list file $newlines[0]="!!"; $count = 1; foreach $i (@lines) { if ($i =~/.pep/) { $newlines[$count] = $i; $count ++; } } $filename = "test.list"; #open file and associate it with a "filehandle" open (LISTFILE, ">$filename"); foreach $i (@newlines) { print LISTFILE $i,"\n"; } close (LISTFILE); #run the composition gcg module for each protein foreach $i (@newlines) { if ($i ne "!!") {$index = index ($i, ".pep") + 4; $pepname = substr ($i, 0, $index); $output = `composition $pepname -Default `; print $output; } } exit; root224 [~/gcg]>perl gcgtest.pl root225 [~/gcg]>ls *.composition a28086.composition gi-79882.composition orf15.composition root226 [~/gcg]>ls *.list test.list root227 [~/gcg]>more test.list !! a28086.pep 104 aa. gi-79882.pep 161 aa. orf15.pep 485 aa. root228 [~/gcg]>more a28086.composition (Peptide) COMPOSITION of: a28086.pep Check: 7776 from: 1 to: 104 October 8, 2002 11:26 ***** A: 8 C: 5 D: 7 E: 10 F: 10 G: 5 H: 1 I: 5 K: 13 L: 6 M: 2 N: 4 P: 3 Q: 4 S: 6 T: 3 V: 11 W: 1 Other: 0 Total: 104 ***** ***** ***** root229 [~/gcg]>