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, 12:03 PM
|
0 responses
19 views
0 reactions
|
Last Post
by SEQadmin2
Yesterday, 12:03 PM
|
||
|
Started by SEQadmin2, Yesterday, 11:40 AM
|
0 responses
14 views
0 reactions
|
Last Post
by SEQadmin2
Yesterday, 11:40 AM
|
||
|
Started by SEQadmin2, 05-28-2026, 11:40 AM
|
0 responses
29 views
0 reactions
|
Last Post
by SEQadmin2
05-28-2026, 11:40 AM
|
||
|
Started by SEQadmin2, 05-26-2026, 10:12 AM
|
0 responses
31 views
0 reactions
|
Last Post
by SEQadmin2
05-26-2026, 10:12 AM
|
Comment