# HG changeset patch # User dcouvin # Date 1631906637 0 # Node ID 640361a4d2ef55d5933289c667db8c08da2bceb0 Uploaded diff -r 000000000000 -r 640361a4d2ef concatenateMultiFasta.pl --- /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 = ) { + chomp $row; + if ($row=~m/^>/){ + } + else{ + print "$row\n"; + } + } +} + +close(FILE); +#close(OUT); diff -r 000000000000 -r 640361a4d2ef concatenateMultiFasta.xml --- /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 @@ + + allows to concatenate sequences from a multi-Fasta file + + + + "$output" + + + +]]> + + + + + + + + + + + + + + + +