changeset 60:9645d995fb3c draft

Fix for spaces in datasets names.
author pierre.pouchin
date Wed, 24 Oct 2018 07:40:20 -0400
parents eeb89c3331ad
children 9185ca0a7b43
files bin/align.pm bin/html.pm bin/ppp.pm bin/sRNAPipe.pl sRNAPipe.xml
diffstat 5 files changed, 132 insertions(+), 133 deletions(-) [+]
line wrap: on
line diff
--- a/bin/align.pm	Tue Oct 23 11:02:17 2018 -0400
+++ b/bin/align.pm	Wed Oct 24 07:40:20 2018 -0400
@@ -34,7 +34,7 @@
 	my $to_index = shift;
 	my $log = shift;
 	my $index_log = $to_index.'_index.err';
-	`bwa index $to_index 2> $index_log`;
+	`bwa index '$to_index' 2> '$index_log'`;
 	print $log "Creating index for $to_index\n";
 }
 
@@ -412,9 +412,9 @@
 		$view_err = $1.'_view.err';
 		$sort_err = $1.'_sort.err';
 	}	
-	`samtools view -Shb   --threads $number_of_cpus $sam 2> $view_err | samtools sort  -O BAM --threads $number_of_cpus  /dev/stdin 2> $sort_err  > $bam_sorted`;
-	`bedtools genomecov -scale $scale -strand + -bga -ibam $bam_sorted > $bedgraphP`;	
-	`bedtools genomecov -scale $scale -strand - -bga -ibam $bam_sorted > $bedgraphM`;
+	`samtools view -Shb   --threads $number_of_cpus '$sam' 2> '$view_err' | samtools sort  -O BAM --threads $number_of_cpus  /dev/stdin 2> '$sort_err'  > '$bam_sorted'`;
+	`bedtools genomecov -scale $scale -strand + -bga -ibam '$bam_sorted' > '$bedgraphP'`;
+	`bedtools genomecov -scale $scale -strand - -bga -ibam '$bam_sorted' > '$bedgraphM'`;
 }
 
 sub sam_sorted_bam
@@ -428,7 +428,7 @@
 		$sort_err = $1.'_sort.err';
 
 	}
-	`samtools view -Shb   --threads $number_of_cpus $sam 2> $view_err | samtools sort  -O BAM --threads $number_of_cpus  /dev/stdin  2> $sort_err  > $bam_sorted`;
+	`samtools view -Shb   --threads $number_of_cpus '$sam' 2> '$view_err' | samtools sort  -O BAM --threads $number_of_cpus  /dev/stdin  2> '$sort_err'  > '$bam_sorted'`;
 }
 
 sub BWA_call
@@ -436,8 +436,8 @@
 	my ( $index, $fastq, $sam, $mismatches, $number_of_cpus, $report ) = @_;
 	my ( $aln_err, $samse_err, $seq_num ) = ( $sam.'_aln.err', $sam.'_samse.err', 0 );
 	print $report "-----------------------------\n";
-	print $report "bwa aln -t $number_of_cpus -n $mismatches $index $fastq 2> $aln_err | bwa samse $index /dev/stdin $fastq 2> $samse_err > $sam\n";
-	`bwa aln -t $number_of_cpus -n $mismatches $index $fastq 2> $aln_err | bwa samse $index /dev/stdin $fastq 2> $samse_err > $sam `;
+	print $report "bwa aln -t $number_of_cpus -n $mismatches '$index' '$fastq' 2> '$aln_err' | bwa samse $index /dev/stdin '$fastq' 2> '$samse_err' > '$sam'\n";
+	`bwa aln -t $number_of_cpus -n $mismatches '$index' '$fastq' 2> '$aln_err' | bwa samse $index /dev/stdin '$fastq' 2> '$samse_err' > '$sam' `;
 }
 
 sub rpms_rpkm
--- a/bin/html.pm	Tue Oct 23 11:02:17 2018 -0400
+++ b/bin/html.pm	Wed Oct 24 07:40:20 2018 -0400
@@ -10,25 +10,25 @@
 
 sub main_page
 {
-	my ( $dir, $file, $list_mainTabP, $current, $ma, $ma_uni, $dir_root ) = @_;
-	my ( $futHashP, $uniqueTabP, $randTabP, $pngTabP ) = get_genome ( $dir, $dir_root );
+  my ( $dir, $file, $list_mainTabP, $current, $ma, $ma_uni, $dir_root ) = @_;
+  my ( $futHashP, $uniqueTabP, $randTabP, $pngTabP ) = get_genome ( $dir, $dir_root );
 
-	open my $h, '>', $file || die "cannot create $file $!\n";
-	header ( $h );
-	navbar ( $h, $list_mainTabP, $current );
-	print $h "<div class=\"container\"><p><a class=\"btn\" href=\"$current-sub.html\">View details &raquo;</a></p></div>\n";
-	futurette( $h, $current, $pngTabP, $futHashP );
-	print  $h "<div class=\"container\"><h2>mappers #: $ma</h2><h2>unique mappers #: $ma_uni</h2> </div>\n";
-	carousel2( $h, $uniqueTabP, $randTabP, $dir_root );
-	footer($h);
-	close $h;
+  open my $h, '>', $file || die "cannot create $file $!\n";
+  header ( $h );
+  navbar ( $h, $list_mainTabP, $current );
+  print $h "<div class=\"container\"><p><a class=\"btn\" href=\"$current-sub.html\">View details &raquo;</a></p></div>\n";
+  futurette( $h, $current, $pngTabP, $futHashP );
+  print  $h "<div class=\"container\"><h2>mappers #: $ma</h2><h2>unique mappers #: $ma_uni</h2> </div>\n";
+  carousel2( $h, $uniqueTabP, $randTabP, $dir_root );
+  footer($h);
+  close $h;
 }
 
 sub menu_page
 {
-	my ( $dir, $file, $list_mainTabP, $current, $min, $max, $simin, $simax, $pimin, $pimax, $dir_root ) = @_;
+  my ( $dir, $file, $list_mainTabP, $current, $min, $max, $simin, $simax, $pimin, $pimax, $dir_root ) = @_;
   my $html_ref = $1 if $dir =~ /$dir_root(.*)/;
-	open my $h, '>', $file || die "cannot create $file $!\n";
+  open my $h, '>', $file || die "cannot create $file $!\n";
   header($h);
   navbar ( $h, $list_mainTabP, $current );
   span( $h, $current, $min, $max, $simin, $simax, $pimin, $pimax );
@@ -40,7 +40,7 @@
 
 sub details_pages
 {
-	my ( $dir_details, $prefix, $list_mainTabP, $current, $misTE, $dir_root, $ppp ) = @_;
+  my ( $dir_details, $prefix, $list_mainTabP, $current, $misTE, $dir_root, $ppp ) = @_;
   my ($Hex, $HTE, $HG, $NonUniTE, $NonUniG, $UniG ) = get_subgroups( $dir_details, $current, $misTE, $dir_root );
 
   my $html_ref = $1.'-PPP.html' if $prefix =~ /$dir_root(.*)/;
@@ -49,9 +49,9 @@
   navbar ( $h, $list_mainTabP, $current );
   if ( $prefix =~ /piRNAs$/ && $ppp eq 'true' )
   {
-  	print $h " <div class=\"container\">";
-  	print $h " <p><a class=\"btn\" href=\"$html_ref\">Ping Pong Partners</a></p>\n";
-  	print $h "</div>";
+    print $h " <div class=\"container\">";
+    print $h " <p><a class=\"btn\" href=\"$html_ref\">Ping Pong Partners</a></p>\n";
+    print $h "</div>";
   }
   fut($h,'Transposable elements',$HTE);
   carousel($h,$NonUniTE,$dir_root);
@@ -76,14 +76,14 @@
 
 sub ppp_page
 {
-	my ( $dir, $file, $list_mainTabP, $current, $ppp, $dir_root ) = @_;
+  my ( $dir, $file, $list_mainTabP, $current, $ppp, $dir_root ) = @_;
 
-	my $ppp_file = $ppp.'ppp.txt';
-	open my $h, '>', $file || die "cannot create $file $!\n";
-	header($h);
- 	navbar ( $h, $list_mainTabP, $current );
- 	print $h '<div class="container"> <table class="wb-tables table table-striped table-hover">'."\n";
- 	print $h '<thead>
+  my $ppp_file = $ppp.'ppp.txt';
+  open my $h, '>', $file || die "cannot create $file $!\n";
+  header($h);
+  navbar ( $h, $list_mainTabP, $current );
+  print $h '<div class="container"> <table class="wb-tables table table-striped table-hover">'."\n";
+  print $h '<thead>
   <tr>
     <th data-sortable="true">ID</th>
     <th data-sortable="true">overlap sum</th>
@@ -96,22 +96,22 @@
   </thead>
   <tbody>';
 
- 	open my $f, '<', $ppp_file || die "cannot open $ppp_file  $!\n";
- 	while ( <$f> )
- 	{
- 		chomp;
- 		print $h '<tr>';
- 		my ( $id, $sum, $ten, $mean, $sd, $zscore, $prob) = split /\t/, $_;
- 		if( -d "$ppp/$id" ) 
- 		{
- 			my $sub_html = $ppp.$id.'.html';
+  open my $f, '<', $ppp_file || die "cannot open $ppp_file  $!\n";
+  while ( <$f> )
+  {
+    chomp;
+    print $h '<tr>';
+    my ( $id, $sum, $ten, $mean, $sd, $zscore, $prob) = split /\t/, $_;
+    if( -d "$ppp/$id" )
+    {
+      my $sub_html = $ppp.$id.'.html';
       my $sub_html_ref = $1.$id if $ppp =~ /$dir_root(.*)/;
- 			print $h "<td> <a href=\"$sub_html_ref.html\">$id</a> </td>";
+      print $h "<td> <a href=\"$sub_html_ref.html\">$id</a> </td>";
 
- 			open my $sub, '>', $sub_html || die "cannot create $sub_html\n";
- 			{
- 				header($sub);
- 				print $sub "
+      open my $sub, '>', $sub_html || die "cannot create $sub_html\n";
+      {
+        header($sub);
+        print $sub "
 					<div align=\"center\">
 					<h2>$id</h2>
 					<p> <img class=\"featurette-image\" src=\"$id/histogram.png\"/></p>
@@ -121,20 +121,19 @@
 					<p><a href=\"$id/sens.txt\">sense reads without PPP</a></p>
 					<p><a href=\"$id/antisens.txt\">reverse reads without PPP</a></p>
 					</div>";
- 				footer($sub);
- 			}
- 			close $sub;
+        footer($sub);
+      }
+      close $sub;
+    }
+    else { print $h "<td> $id </td>\n"; }
+    print $h "<td> $sum </td><td> $ten </td><td> $mean </td><td> $sd </td><td> $zscore </td><td> $prob </td>\n";
 
- 		}
- 		else { print $h "<td> $id </td>\n"; }
- 		print $h "<td> $sum </td><td> $ten </td><td> $mean </td><td> $sd </td><td> $zscore </td><td> $prob </td>\n";
-
- 		print $h '</tr>';
- 	}
- 	close $f;
- 	print $h "</tbody></table></div>";
- 	footer($h);
- 	close $h;
+    print $h '</tr>';
+  }
+  close $f;
+  print $h "</tbody></table></div>";
+  footer($h);
+  close $h;
 }
 
 sub get_genome
@@ -142,37 +141,37 @@
   my ( $dir, $dir_root ) = @_;
   my ( %hash, @group,  @Unique, @NonUnique, @png );
 
-  my $fut = $dir.'/*';
+  my $fut = "'$dir'".'/*';
   my @fut = glob $fut;
 
 
-	foreach my $fr ( @fut )
-	{
+  foreach my $fr ( @fut )
+  {
     my $f = $1 if $fr =~ /$dir_root(.*)/;
-		if ( $fr =~ /.*Gviz/ )
-		{
-			my $nu = $fr.'/rand/*';
-			@NonUnique =  glob $nu;
-			my $u = $fr.'/unique/*';
-			@Unique =  glob $u;
-		}
-		elsif ( $f =~ /.*distribution\.txt$/ ) { $hash{'mappers size distribution (txt)'} = $f; }
-		elsif ( $f =~ /.*distribution\.png$/ ) { push @png, $f; } 
-		elsif ( $f =~ /.*unique\.fastq$/ ) { $hash{'unique mappers (fastq.gz)'} = $f.'.gz'; `gzip $fr`; }
-		elsif ( $f =~ /.*rejected\.fastq$/ ) { $hash{'unmapped (fastq.gz)'} = $f.'.gz'; `gzip $fr`; }
-		elsif ( $f =~ /.*all\.fastq$/ ) { $hash{'mappers (fastq.gz)'} = $f.'.gz'; `gzip $fr`; }
-		elsif ( $f =~ /.*dup_unique\.txt$/ ) { $hash{'unique mappers (txt)'} = $f; }
-		elsif ( $f =~ /.*dup_mapnum\.txt$/ ) { $hash{'mappers (txt)'} = $f; }
-		elsif ( $f =~ /.*dup_nonmapp\.txt$/ ) { $hash{'unmapped (txt)'} = $f; }
-		elsif ( $f =~ /.*_unique_sorted\.bam$/ ) { $hash{'unique alignment (bam)'} = $f; }
-		elsif ( $f =~ /.*_sorted\.bam$/ ) { $hash{'alignment (bam)'} = $f; }
-		elsif ( $f =~ /.*unique_plus.bedgraph/) { $hash{'bedgraph unique plus strand'} = $f; }
+    if ( $fr =~ /.*Gviz/ )
+    {
+      my $nu = "'$fr'".'/rand/*';
+      @NonUnique =  glob $nu;
+      my $u = "'$fr'".'/unique/*';
+      @Unique =  glob $u;
+    }
+    elsif ( $f =~ /.*distribution\.txt$/ ) { $hash{'mappers size distribution (txt)'} = $f; }
+    elsif ( $f =~ /.*distribution\.png$/ ) { push @png, $f; }
+    elsif ( $f =~ /.*unique\.fastq$/ ) { $hash{'unique mappers (fastq.gz)'} = $f.'.gz'; `gzip '$fr'`; }
+    elsif ( $f =~ /.*rejected\.fastq$/ ) { $hash{'unmapped (fastq.gz)'} = $f.'.gz'; `gzip '$fr'`; }
+    elsif ( $f =~ /.*all\.fastq$/ ) { $hash{'mappers (fastq.gz)'} = $f.'.gz'; `gzip '$fr'`; }
+    elsif ( $f =~ /.*dup_unique\.txt$/ ) { $hash{'unique mappers (txt)'} = $f; }
+    elsif ( $f =~ /.*dup_mapnum\.txt$/ ) { $hash{'mappers (txt)'} = $f; }
+    elsif ( $f =~ /.*dup_nonmapp\.txt$/ ) { $hash{'unmapped (txt)'} = $f; }
+    elsif ( $f =~ /.*_unique_sorted\.bam$/ ) { $hash{'unique alignment (bam)'} = $f; }
+    elsif ( $f =~ /.*_sorted\.bam$/ ) { $hash{'alignment (bam)'} = $f; }
+    elsif ( $f =~ /.*unique_plus.bedgraph/) { $hash{'bedgraph unique plus strand'} = $f; }
     elsif ( $f =~ /.*unique_minus.bedgraph/) { $hash{'bedgraph unique minus strand'} = $f; }
     elsif ( $f =~ /.*plus.bedgraph/) { $hash{'bedgraph plus strand'} = $f; }
     elsif ( $f =~ /.*minus.bedgraph/) { $hash{'bedgraph minus strand'} = $f; }
     else { unlink $fr; }
-	}
-	return (\%hash, \@Unique, \@NonUnique, \@png);
+  }
+  return (\%hash, \@Unique, \@NonUnique, \@png);
 }
 
 sub span
@@ -221,11 +220,11 @@
   my ( $dir, $name, $misTE, $dir_root ) = @_;
   my (%Hex, %HTE, %HG, @group, @png, @pngTE,  @NonUniTE, @UniG, @NonUniG );
 
-  my $fut = $dir.'/*';
+  my $fut = "'$dir'".'/*';
   my @fut = glob $fut;
   my $f ='';
-	foreach my $fr ( @fut )
-	{
+  foreach my $fr ( @fut )
+  {
     $f = $1 if $fr =~  /$dir_root(.*)/;
 
     if ( $f =~ /genome_unique_sorted\.bam$/ ) { $HG{'genome unique mappers (sorted bam)'} =  $f; }
@@ -238,25 +237,25 @@
     elsif ( $f =~ /TEs_plus\.bedgraph$/) { $HTE{'bedgraph plus strand'} = $f; }
     elsif ( $f =~ /TEs_minus\.bedgraph$/) { $HTE{'bedgraph minus strand'} = $f; }
     elsif ( $f =~ /transcripts_sorted\.bam$/) { $Hex{'transcripts mappers (sorted bam)'} = $f;}
-    elsif ( $f =~ /transcripts_unique_sorted\.bam$/) { $Hex{'transcripts unique mappers (sorted bam)'} = $f;}        
+    elsif ( $f =~ /transcripts_unique_sorted\.bam$/) { $Hex{'transcripts unique mappers (sorted bam)'} = $f;}
     elsif ( $f =~ /transcripts_reads_counts\.txt$/) { $Hex{'read number per transcript (txt)'} = $f;}
     elsif ( $f =~ /TEs_reads_counts\.txt$/) { $HTE{"read number per TE 0 to $misTE mismatches (txt)"} = $f; }
     elsif ( $f =~ /TEs_reads_counts_mismatches\.txt$/) { $HTE{"read number per TE with 1 to $misTE mismatches (txt)"} = $f; }
     elsif ( $f =~ /TEs_reads_counts_nomismatches\.txt$/) { $HTE{'read number per TE with no mismatch (txt)'} = $f; }
     elsif ( $f =~ /TEs_unique_sorted\.bam$/) { $HTE{'TEs unique mappers (sorted bam)'} = $f; }
     elsif ( $f =~ /TEs_sorted\.bam$/) { $HTE{'TEs mappers (sorted bam)'} = $f; }
-		elsif ( $fr =~ /.*Gviz_TEs/ )
-		{
-			my $nu = $fr.'/*';
-			@NonUniTE =  glob $nu;
-		}
-		elsif ( $fr =~ /.*Gviz_genome/ )
-		{
-			my $nu = $fr.'/rand/*';
-			@NonUniG =  glob $nu;
-			my $u = $fr.'/unique/*';
-			@UniG =  glob $u;
-		}
+    elsif ( $fr =~ /.*Gviz_TEs/ )
+    {
+      my $nu = "'$fr'".'/*';
+      @NonUniTE =  glob $nu;
+    }
+    elsif ( $fr =~ /.*Gviz_genome/ )
+    {
+      my $nu = "'$fr'".'/rand/*';
+      @NonUniG =  glob $nu;
+      my $u = "'$fr'".'/unique/*';
+      @UniG =  glob $u;
+    }
     else { unlink $fr; }
   }
   return (\%Hex, \%HTE, \%HG, \@NonUniTE,  \@NonUniG, \@UniG);
@@ -480,7 +479,7 @@
 sub navbar
 {
   my ( $file, $fastq, $actif ) = @_;
-  
+
   print $file "
   <div class=\"navbar navbar-inverse navbar-fixed-top\">
   <div class=\"navbar-inner\">
@@ -526,7 +525,7 @@
   <script type=\"text/javascript\" src=\"js/jquery.js\"></script>
   <script type=\"text/javascript\" src=\"js/jquery-1.3.2.js\"></script>
   <script type=\"text/javascript\" src=\"js/jquery.galleriffic.js\"></script>
-  <script type=\"text/javascript\" src=\"js/jquery.opacityrollover.js\"></script>  
+  <script type=\"text/javascript\" src=\"js/jquery.opacityrollover.js\"></script>
   <script type=\"text/javascript\" src=\"js/bootstrap-table.js\"></script>
   <script type=\"text/javascript\" src=\"js/bootstrap.min.js\"></script>
   <script type=\"text/javascript\">
@@ -613,7 +612,7 @@
   ";
   foreach my $u (@{$non_unique})
   {
-  	my $name = basename($u,'.png');
+    my $name = basename($u,'.png');
     $u = $1 if $u =~ /$dir_root(.*)/;
     print $file "
     <li>
@@ -652,7 +651,7 @@
 
   foreach my $u (@{$unique})
   {
-  	my $name = basename($u,'.png');
+    my $name = basename($u,'.png');
     $u = $1 if $u =~ /$dir_root(.*)/;
     print $file "
     <li>
@@ -682,7 +681,7 @@
 
   foreach my $nu (@{$non_unique})
   {
-  	my $name = basename($nu,'.png');
+    my $name = basename($nu,'.png');
     $nu = $1 if $nu =~ /$dir_root(.*)/;
     print $file "
         <li>
@@ -750,7 +749,7 @@
 {
   my ($dir, $name) = @_;
   my (@out,@group);
-  my $group = $dir.'/'.$name.'-subgroups-bonafide_reads-transcripts-*distribution-*.png';
+  my $group = "'$dir'".'/'."'$name'".'-subgroups-bonafide_reads-transcripts-*distribution-*.png';
   @group = glob $group;
   foreach (my $g =0; $g <= $#group; $g++)
   {
@@ -767,7 +766,7 @@
 {
   my ($dir, $name) = @_;
   my (@out,@group);
-  my $group = $dir.'/'.$name.'-subgroups-bonafide_reads-TE-*distribution-*.png';
+  my $group = "'$dir'".'/'."'$name'".'-subgroups-bonafide_reads-TE-*distribution-*.png';
   @group = glob $group;
   foreach (my $g =0; $g <= $#group; $g++)
   {
@@ -784,9 +783,9 @@
 {
   my ($dir,$name) = @_;
   my (%distri,@group);
-  my $group = $dir.'/'.$name.'-subgroups-bonafide_reads-TE-PPPartners-*';
+  my $group = "'$dir'".'/'."'$name'".'-subgroups-bonafide_reads-TE-PPPartners-*';
   @group = glob $group;
-  
+
   foreach (my $g =0; $g <= $#group; $g++)
   {
     if ($group[$g] =~ /.*($name-subgroups-bonafide_reads-TE-PPPartners-.*)/ )
@@ -831,7 +830,7 @@
 {
   my ($h, $hash) = @_;
   my $cmp = 0;
-  
+
   print $h "<div class=\"container\">\n";
   print $h "<div class=\"row text-center\">";
   while ( my ($k,$v) = each %{$hash} )
@@ -851,7 +850,7 @@
     ";
     $cmp++;
   }
-  
+
   print $h "</div></div>";
 }
 
@@ -880,7 +879,7 @@
     ";
     $cmp++;
   }
-  
+
   print $h "</div></div>";
 }
 
--- a/bin/ppp.pm	Tue Oct 23 11:02:17 2018 -0400
+++ b/bin/ppp.pm	Wed Oct 24 07:40:20 2018 -0400
@@ -166,7 +166,7 @@
   }
   close $f;
 
-  open my $infile, "samtools view  $in_file |"|| die "cannot open input file $! \n";
+  open my $infile, "samtools view '$in_file' |"|| die "cannot open input file $! \n";
   while(<$infile>)
   {
     unless ($_ =~ /^\@[A-Za-z][A-Za-z](\t[A-Za-z][A-Za-z0-9]:[ -~]+)+$/ || $_ =~ /^\@CO\t.*/ )
--- a/bin/sRNAPipe.pl	Tue Oct 23 11:02:17 2018 -0400
+++ b/bin/sRNAPipe.pl	Wed Oct 24 07:40:20 2018 -0400
@@ -255,14 +255,14 @@
 	#HTML Main Webpage
 	my $index_page = $dir.$fastq_n[$child].'.html';
 	main_page ( $gen_dir, $index_page, \@fastq_n, $fastq_n[$child], $ma, $ma_uni, $dir );
-  copy ($index_page, $html_out) if $child == 0;
+	copy ($index_page, $html_out) if $child == 0;
 	#HTML Menu
 	my $menu_page = $dir.$fastq_n[$child].'-sub.html';
 	menu_page ( $group_dir, $menu_page, \@fastq_n, $fastq_n[$child], $min, $max, $si_min, $si_max, $pi_min, $pi_max, $dir );
-	unlink glob "$group_dir*.sam"; unlink glob "$group_dir*.fastq";
+	unlink glob "'$group_dir'*.sam"; unlink glob "'$group_dir'*.fastq";
 	$pm->finish(); # pass an exit code to finish
 }
 $pm->wait_all_children;
-unlink glob $dir."dataset_*symlink.fa*"; 
+unlink glob "'$dir'"."dataset_*symlink.fa*";
 print $report "Job done!\n";
 close $report;
--- a/sRNAPipe.xml	Tue Oct 23 11:02:17 2018 -0400
+++ b/sRNAPipe.xml	Wed Oct 24 07:40:20 2018 -0400
@@ -1,39 +1,38 @@
 <tool id="sRNAPipe" name="sRNAPipe" version="1.0">
   <description>In-depth study of small RNA</description>
-  <command interpreter="perl">
-
-    ./bin/sRNAPipe.pl
+  <command><![CDATA[
+    perl '$__tool_directory__/bin/sRNAPipe.pl'
 
-    --fastq ${first_input}
-    --fastq_n ${first_input.name}
+    --fastq '${first_input}'
+    --fastq_n '${first_input.name}'
     #for $input_file in $input_files:
-    --fastq ${input_file.additional_input}
-    --fastq_n ${input_file.additional_input.name}
+    --fastq '${input_file.additional_input}'
+    --fastq_n '${input_file.additional_input.name}'
     #end for
 
     #if $Genome.refGenomeSource == "history":
-    --ref "${Genome.ownFile}"
+    --ref '${Genome.ownFile}'
     --build_index
     #else:
-    --ref "${Genome.indices.fields.path}"
+    --ref '${Genome.indices.fields.path}'
     #end if
 
     #if $tRNAs.refGenomeSource == "history":
-    --tRNAs "${tRNAs.ownFile}"
+    --tRNAs '${tRNAs.ownFile}'
     --build_tRNAs
     #elif $tRNAs.refGenomeSource == "none":
     --tRNAs "None"
     #else:
-    --tRNAs "${tRNAs.indices.fields.path}"
+    --tRNAs '${tRNAs.indices.fields.path}'
     #end if
 
     #if $snRNAs.refGenomeSource == "history":
-    --snRNAs "${snRNAs.ownFile}"
+    --snRNAs '${snRNAs.ownFile}'
     --build_snRNAs
     #elif $snRNAs.refGenomeSource == "none":
     --snRNAs "None"
     #else:
-    --snRNAs "${snRNAs.indices.fields.path}"
+    --snRNAs '${snRNAs.indices.fields.path}'
     #end if
 
     #if $rRNAs.refGenomeSource == "history":
@@ -42,28 +41,28 @@
     #elif $rRNAs.refGenomeSource == "none":
     --rRNAs "None"
     #else:
-    --rRNAs "${rRNAs.indices.fields.path}"
+    --rRNAs '${rRNAs.indices.fields.path}'
     #end if
 
     #if $miRNAs.refGenomeSource == "history":
-    --miRNAs "${miRNAs.ownFile}"
+    --miRNAs '${miRNAs.ownFile}'
     --build_miRNAs
     #else:
-    --miRNAs "${miRNAs.indices.fields.path}"
+    --miRNAs '${miRNAs.indices.fields.path}'
     #end if
 
     #if $transcripts.refGenomeSource == "history":
-    --transcripts "${transcripts.ownFile}"
+    --transcripts '${transcripts.ownFile}'
     --build_transcripts
     #else:
-    --transcripts "${transcripts.indices.fields.path}"
+    --transcripts '${transcripts.indices.fields.path}'
     #end if
 
     #if $TE.refGenomeSource == "history":
-    --TE "${TE.ownFile}"
+    --TE '${TE.ownFile}'
     --build_TE
     #else:
-    --TE "${TE.indices.fields.path}"
+    --TE '${TE.indices.fields.path}'
     #end if
 
     --si_min $si_min
@@ -78,6 +77,7 @@
     --dir $html_out.files_path
     --html $html_out
     --PPPon $PPPon
+    ]]>
   </command>
 
   <requirements>