changeset 0:640361a4d2ef draft default tip

Uploaded
author dcouvin
date Fri, 17 Sep 2021 19:23:57 +0000
parents
children
files concatenateMultiFasta.pl concatenateMultiFasta.xml
diffstat 2 files changed, 74 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/concatenateMultiFasta.pl	Fri Sep 17 19:23:57 2021 +0000
@@ -0,0 +1,30 @@
+#!/usr/bin/perl -w
+use strict;
+
+################################################################
+# Script allowing to concatenate multiFasta file,
+# generating an output file containing a single sequence
+################################################################
+
+# example of use: perl concatenateMultiFasta.pl multiFasta_file.fasta
+# other example:  perl concatenateMultiFasta.pl *.fasta
+
+my @listFastaFiles = @ARGV;
+
+foreach my $multiFasta ( @listFastaFiles ) {
+        my $outFasta = 'concatenated_'.$multiFasta ;
+        open(FILE,"<$multiFasta") || die ("Error opening $multiFasta $!");
+        #open(OUT, '>', $outFasta) or die $!;
+        print ">$outFasta\n";
+        while (my $row = <FILE>) {
+                chomp $row;
+                if ($row=~m/^>/){
+                }
+                else{
+                    print "$row\n";
+                }
+        }
+}
+
+close(FILE);
+#close(OUT);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/concatenateMultiFasta.xml	Fri Sep 17 19:23:57 2021 +0000
@@ -0,0 +1,44 @@
+<tool id="concatenatemultifasta" name="concatenateMultiFasta tool" version="0.1.0">
+  <description>allows to concatenate sequences from a multi-Fasta file</description>
+
+<!--<requirements>
+  <requirement type="package" version="1.7.2">perl-bioperl</requirement>
+</requirements>-->
+
+<command detect_errors="aggressive"><![CDATA[
+
+#import re
+        ## Creates symlinks for each input file based on the Galaxy 'element_identifier'
+        ## Used so that a human-readable name appears in the output table (instead of 'dataset_xyz.dat')
+            ## Add single quotes around each input file identifier
+            #set $_input_file = "'{}'".format($input.element_identifier)
+            ln -s '${input}' ${_input_file} &&
+            
+
+        perl '$__tool_directory__/concatenateMultiFasta.pl' $_input_file > "$output"
+
+
+
+]]></command>
+ <!-- perl '$__tool_directory__/nucleScore.pl' $_input_file > "$output"  -->
+ <!-- ./nuclescore.sh ${named_input_files} > "$output" -->
+
+<inputs>
+  <param format="fasta" name="input" type="data" label="Multi-FASTA file: "/>
+</inputs>
+
+ <outputs>
+    <data format="fasta" name="output" />
+ </outputs>
+
+<help><![CDATA[
+concatenateMultiFasta.pl is a Perl script allowing to concatenate/merge multi-Fasta files. Every Fasta sequences contained in one file will be concatenated and the output is a Fasta file containing a unique sequence. 
+  
+This script belongs to the getSequenceInfo supplementary tools.
+
+- GitHub: https://github.com/karubiotools/getSequenceInfo/tree/master/supplementary_tools
+]]>
+</help>
+
+</tool>
+