Hi All,
does any one know how to convert .sra files into .csfasata?
does any one know how to convert .sra files into .csfasata?
You are currently viewing the SEQanswers forums as a guest, which limits your access. Click here to register now, and join the discussion
#!/usr/bin/perl
use warnings;
use strict;
my ($infile,$outfile) = @ARGV;
die "Usage is fix_csfasta.pl [input file] [output file]\n" unless ($outfile);
open (IN,$infile) or die "Can't read $infile: $!";
open (OUT,'>',$outfile) or die "Can't write to $outfile: $!";
while (<IN>) {
if (/^>/) {
my $header = $_;
chomp $header;
$header =~ s/[\r\n]//g;
$header =~ s/[^>\w_\. ]//g;
my $seq = <IN>;
chomp $seq;
$seq =~ s/[\r\n]//g;
unless ($seq =~ /^T[0123\.]+$/) {
warn "Skipping odd looking sequence '$seq'\n";
next;
}
print OUT "$header\n$seq\n";
}
else {
warn "Skipping unexpected line : $_";
}
}
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by SEQadmin2, 10-15-2026, 10:52 AM
|
0 responses
26 views
0 reactions
|
Last Post
by SEQadmin2
10-15-2026, 10:52 AM
|
||
|
Started by SEQadmin2, 10-14-2026, 05:39 AM
|
0 responses
33 views
0 reactions
|
Last Post
by SEQadmin2
10-14-2026, 05:39 AM
|
||
|
Started by SEQadmin2, 10-13-2026, 09:56 AM
|
0 responses
31 views
0 reactions
|
Last Post
by SEQadmin2
10-13-2026, 09:56 AM
|
||
|
Started by SEQadmin2, 10-09-2026, 11:14 AM
|
0 responses
28 views
0 reactions
|
Last Post
by SEQadmin2
10-09-2026, 11:14 AM
|
Comment