Hi,
I have 2 sets of multiple sequence files of DNA sequences.
Examples of set 1 are as follows:
Seq1.txt contains:
ATACAGGATCAGATG
Seq2.txt contains:
ATACCGGATCAGATG
Seq3.txt contains:
ATACAGGGTCAGATG
Examples of set 2 are as follows:
Seq1.txt contains:
seq1
ATACAGGATCAGATG
seq2
Seq2.txt contains:
ATACCGGATCAGATG
seq3
Seq3.txt contains:
ATACAGGGTCAGATG
I want one/two perl programs to read the multiple files and concatenate the twoi sets as follows:
Concatenated_set1.txt:
ATACAGGATCAGATGATACCGGATCAGATGATACAGGGTCAGATG
Concatenated_set2.txt:
seq1
ATACAGGATCAGATG
seq2
ATACCGGATCAGATG
seq3
ATACAGGGTCAGATG
My codes are as follows:
use strict;
use warnings;
use diagnostics;
open (OUT,'>>', 'C:/Test1/Concatenated_set1.txt');
while (my @files = <*.txt>){
chomp;
foreach my$files (@files){
print OUT "$_"
}
}
close OUT
use strict;
use warnings;
use diagnostics;
open (OUT,'>>', 'C:/Test1/Concatenated_set2.txt');
while (my @files = <*.txt>){
chomp;
foreach my$files (@files){
print "<";
print "$file\n";
print OUT "$_";
}
}
close OUT
I would be happy to receive some help.
Thanks