in reply to Re: Confused when reading Input within Perl and Shell Scripts
in thread Confused when reading Input within Perl and Shell Scripts
Ok, bear with me. I have used the suggestion:
my $dssp_obj = new Bio::Structure::SecStr::DSSP::Res('-file'=>$ARGV[0] +);
Which works (and I'm ignoring several filehandle warnings). Now, I have written a shell script:
#!/bin/bash while read DSSPLine ; do echo $DSSPLine DSSP_Output.pl $DSSPLine.dssp done
QUESTION: In each interation, the output of DSSP_Output.pl is written to a CSV file. Is there a way such that (in perl) this output is written for all 30,000 iterations to one file only?
The very obvious answer is to use a DSSP array like you mentioned, I have tried that (in a way):
use strict; # 'use strict' requires that you use 'my' for all local va +riables, or explicitely qualify all globals. use warnings; use Bio::Structure::SecStr::DSSP::Res; my @dssp_objs =(); foreach my $file (@ARGV) { push @dssp_objs, Bio::Structure::SecStr::DSSP::Res->new('-file'=>$file +); } foreach my $dssp_obj(@dssp_objs) { #Get PDB ID and Compound representation for each file my $pdb_id = $dssp_obj->pdbID(); print "Analysis of PDB:: ". $pdb_id. "\n"; my $cmpd = $dssp_obj->pdbCompound(); print "Representing:: ". $cmpd. "\n"; etc... }
But when I do this, and run the commandline with a txt file of the DSSP filenames:
DSSP_Output.pl DSSP_codes.txtI get an exception!
Please let me know what you think...apologies for all the headache...
A <slowly deconfusing> InfoSeeker
|
|---|