Entering edit mode
7.3 years ago
Bulbul Ahmed
▴
20
I used the below perl script to remove out the partial cds, but its not working correctly and i am getting a blank output file. Can any body find out the the mistake and kindly correct it.
use strict;
use warnings;
open (fh, '<C:\Users\bulbul\Desktop\New folder\Unigene.transdecoder.cds.txt') or die "file not found,$!";
open (out, ">bulbul.txt");
while (my $line = "Unigene.transdecoder.cds.txt") {
chomp $line;
print "processing $line\n";
my ($id, $rna_sq) = split(/\s+/, $line);
while ($rna_sq =~ /atg/g) {
my $start = pos($rna_sq) - 3;
last $rna_sq =~ /tga|taa|tag/g;
my $stop = pos($rna_sq);
my $genelen = $stop - $start;
my $gene = substr($rna_sq, $start, $genelen);
print "\t" . join(' ', $id, $start+1, $stop, $gene, $genelen) . "\n";
}
}
As an aside, since you're using Windows, you might want to ensure you're processing line breaks accurately. Newline characters are
\r\n
in Windows, and your input file or your output file might have different newline characters.Still not working sir