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, Yesterday, 02:55 AM
|
0 responses
9 views
0 reactions
|
Last Post
by SEQadmin2
Yesterday, 02:55 AM
|
||
|
Started by SEQadmin2, 07-24-2026, 12:17 PM
|
0 responses
12 views
0 reactions
|
Last Post
by SEQadmin2
07-24-2026, 12:17 PM
|
||
|
Started by SEQadmin2, 07-23-2026, 11:41 AM
|
0 responses
12 views
0 reactions
|
Last Post
by SEQadmin2
07-23-2026, 11:41 AM
|
||
|
Started by SEQadmin2, 07-20-2026, 11:10 AM
|
0 responses
24 views
0 reactions
|
Last Post
by SEQadmin2
07-20-2026, 11:10 AM
|
Comment