Note that there are some explanatory texts on larger screens.

plurals
  1. POPerl Shell Wrapper for piping scripts and commands
    primarykey
    data
    text
    <p>I'm working on a bioinformatics project that involves piping together different scripts and input parameters for the analysis of Next-Gen Sequencing Illumina data. I need help with the wrapper script. Recall that a <em>wrapper</em> is a shell script that embeds a system command or utility, that accepts and passes a set of parameters to that command. Wrapping a script around a complex command-line simplifies invoking it.</p> <p>Here's a minimal representation of the code:</p> <pre><code>#!/usr/bin/perl use strict; use warnings; my $barcode_file= shift; unless($barcode_file){ die "missing barcode file location, aborting.\n"; } my $raw_data_location = '/data/local/samples/'; my $components_location= '~/read_cleanup/'; my $tmp_dir= '/tmp/'; open (FILEIN, $barcode_file) or die "couldn't open $barcode_file for read: $!\n"; while(&lt;FILEIN&gt;){ # input file format (tab delimited): # Sample_Name barcode enzyme size paired seq_file /^$/ and next; chomp; my ($sample, $barcode, $enzyme, $size, $pe, $seq_file)= split; $raw_file_data = "${raw_data_location}$seq_file"; #/data/local/samples/301.fq for instance # final output file my $final_output_file = "${tmp_dir}${sample}_reconciled_ends.fq"; # /tmp/D1_reconciled_ends.fq for instance # if the sample is paired ( 1 - paired, 0 - unpaired) if ($pe) { my $pipe_cmd= "${components_location}script01.pl $raw_data_file $barcode | ${components_location}script02.pl $enzyme | ${components_location}script03.pl $size &gt; $final_output_file"; } system($pipe_cmd); # at this point, $final_output_file should be saved in the # tmp folder and contain the paired fastq data output } close (FILEIN); </code></pre> <p>Basically the wrapper reads the barcode.txt file and loops through each line (sample name) of the file. For each sample name, it generates the input parameters for each script in the the piped run. If the sample is paired data, then we do a piped run. The piping scheme goes like this: </p> <pre><code># the input parameters are "fed" into the script and the output is piped # as STDIN to the next script. script01.pl [input parameters] | script02.pl [input parameters] | script03.pl [input parameters] &gt; file.txt </code></pre> <p><code>system($piped_cmd)</code> executes the piped run in the terminal.</p> <p>Here's where I'm getting trouble, when I try to run the wrapper script from the terminal:</p> <p><code>./wrapper_example.pl barcode.txt</code></p> <p>It returns the following error message:</p> <p><code>sh: 1: /home/user/read_cleanup/script01.pl: not found</code></p> <p>Does anyone know what's wrong or how to fix this? thanks. Any suggestions are greatly appreciated. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload