With a few other adjustments, I was able to get the script to run. However, I don't know what changes need to be made to get accurate results.{ open (IN, $file) || die "Can't open $file\n"; my $tag; my $seq; while (<IN>) { chomp; if (/^>/) { if ($seq) {$protein{$tag} = uc($seq); undef $seq} $tag = $_; } else {$seq .= $_} } $protein{$tag} = uc($seq); # add this line to get the last sequence close IN; }
With an inputfile of:
I got results from your program below>chr1 RecName: Full=Putative transcription factor 001R; MAFSAEDVLKEYDRRRRMEALLLSLYYPNDRKLLDYKEWSPPRVQVECPKAPVEWNNPPS EKGLIVGHFSGIKYKGEKAQASEVDVNKMCCWVSKFKDAMRRYQGIQTCKIPGKVLSDLD AKIKAYNLTVEGVEGFVRYSRVTKQHVAAFLKELRHSKQYENVNLIHYILTDKRVDIQHL EKDLVKDFKALVESAHRMRQGHMINVKYILYQLLKKHGHGPDGPDILTVKTGSKGVLYDD SFRKIYTDLGWKFTPL >chr2 RecName: Full=Uncharacterized protein 002L; MSIIGATRLQNDKSDTYSAGPCYAGGCSAFTPRGTCGKDWDLGEQTCASGFCTSQPLCAR IKKTQVCGLRYSSKGKDPLVSAEWDSRGAPYVRCTYDADLIDTQAQVDQFVSMFGESPSL AERYCMRGVKNTAGELVSRVSSDADPAGGWCRKWYSAHRGPDQDAALGSFCIKNPGAADC KCINRASDPVYQKVKTLHAYPDQCWYVPCAADVGELKMGTQRDTPTNCPTQVCQIVFNML DDGSVTMDDVKNTINCDFSKYVPPPPPPKPTPPTPPTPPTPPTPPTPPTPPTPRPVHNRK VMFFVAGAVLVAILISTVRW
These results vary from a program I wrote using Bio::Tools::pICalculator. The results I got from it were:>chr1 RecName: Full=Putative transcription factor 001R; 9.425903320 +3125 >chr2 RecName: Full=Uncharacterized protein 002L; 8.2193603515625
That program code was:chr1 9.793558 chr2 7.791410
I got the code from the documentation for that module.#!/usr/bin/perl use strict; use warnings; use Bio::Tools::pICalculator; use Bio::SeqIO; @ARGV == 1 or die "Usage: perl $0 fasta_file_name\n"; my $in = Bio::SeqIO->new( -file => $ARGV[0] ,-format => 'Fasta' ); my $calc = Bio::Tools::pICalculator->new(-places => 6); while ( my $seq = $in->next_seq ) { $calc->seq($seq); my $iep = $calc->iep; print join("\t", $seq->id, $iep), "\n"; }
Chris
In reply to Re: Iso electric point calculation using perl
by Cristoforo
in thread Iso electric point calculation using perl
by yuvraj_ghaly
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |