I want to run ext software (hmmer) commands through perl in a loop for input files (in linux).

I used this line

system "hmmbuild  $outfile $files";

where $outfile is my output file and $files in my input files. hmmbuild is the command for the ext software.

When I run the program it gives me error code for the output file GLOB(0x1b94b220).

Can any one help me where I am wrong and how can it be corrected?

I tried exec command also with back tick and brackets.

This is the exact output message i got. How can I print my result to output file ($outfile)?

sh: -c: line 0: syntax error near unexpected token `('
sh: -c: line 0: `hmmbuild --amino GLOB(0x11eb3220) aproNOG00001'

script goes here..

 #!/usr/bin/perl
 use Bio::AlignIO;
 use Bio::Align::AlignI;

 my $allfiles= 'allfilenames_alpha_hmms.txt';
  system "module load hmmer/3.1b1";
print "loaded hmmer\n";
 open(FIH, $allfiles);
 while ($min=<FIH>)
{ chomp($min);   my @pats=split " ",$min;
     foreach my $files(@pats)  {

     print $files; print "\n";

open(my $outfile,  '>',"$prefix.hmm");  

system "hmmbuild --amino $outfile $files";

print $outfile;
print "file saved\n";

# }
  }
 }
  print "\n\n\n\t   ###\tDONE\t###   \n\n";
有帮助吗?

解决方案

how can i print my result to output file ($outfile)

I take it hmmbuild expects a path to a file? Pass the path to the file rather than what's in $outfile.

system "hmmbuild --amino $prefix.hmm $files";
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top