Hi all,
I am trying to separe my data DNA because it has a lot of name.
It has about 43 litte file in one data.
I made the small script to solve one name of data but I did not succes. The result was not enough. My script is below:
#!/usr/bin/perl;
use strict;
use warnings;
my $filename3 = 'file_out.txt';
my $filename = 'dna.txt';
open my $fh, '<', $filename or die "Failed to open $filename: $!";
open my $fho, '>', $filename3 or die "Failed to open $filename3: $!";#Open file for output
while (my $rec = <$fh>){
$rec=~ s/\s//g;
chomp($rec);
#my $rec1 = join ('\n',$rec);
my $line = $rec;
if ($line =~'AGQQ01000002.1'){
print $fho "$rec \n";
}
}
close $fh;
Result :
>gi|354512096|gb|AGQQ01000002.1|CorynebacteriumglutamicumATCC14067Contig02,wholegenomeshotgunsequenceTTAGCCAGGAAACGCTTCGCTGCCGCGACGTTGCGCTTCGGAGAGAGGTAAAAGTCCAGG
I hope I can separe with all the data of "AGQQ01000002.1" expect the name "]>gi|354512096|gb|AGQQ01000002.1|CorynebacteriumglutamicumATCC14067Contig02,wholegenomeshotgunsequence "
I mean:
GTATGCCCACCAGCGGTAATAGCCCGATAGAGGTAGCACCACCTGCCGCCGACCCGGATG
TAGGTCTCATCCACCCGCCAGGACCGGGCCTGCCAGTCAGGTACCTGCCGGTACCACCGA
GTGTGCTTGTCCAGCTCAGGGGCGTATTTCTGGACCCAGCGGTGAGAATCGTGGTGTGAT
CAACTGGCACGCCGCGGCTGAAGTCATCATTTCCTCCAGATCTTAGGTCAGCTCACCCCG
TAGCGGCAGTGACCTGCGCACTGCCCACAAAATGATGTCACGGGGGAAATGACGACCGGA
GAAGATACCCATGGCTGTGATTATTTCACGTCGATCTTCCTACTGCCCCAACTTTGCAAC
Could you show me how to solve that problem. Thank you very much!