Re: sequence composition

2010-12-02 Thread ANJAN PURKAYASTHA
No problem Changrong, glad to be of help to a fellow scientist. And thanks to John and the other for showing much more elegant ways of solving the problem. Cheers! Anjan On Thu, Dec 2, 2010 at 3:40 AM, John W. Krahn wrote: > Changrong Ge wrote: > >> Hi guys, >> > > Hello, > > > Thanks a lot

Re: sequence composition

2010-12-02 Thread John W. Krahn
Changrong Ge wrote: Hi guys, Hello, Thanks a lot for this issue and with Anjan's help here I got the wonderful script for my work and I post below, hopefully it would be helpful for others--works perfectly for fasta file. Also thanks to others who are interested in the discussion, b

Re: sequence composition

2010-12-02 Thread Changrong Ge
Hi guys, Thanks a lot for this issue and with Anjan's help here I got the wonderful script for my work and I post below, hopefully it would be helpful for others--works perfectly for fasta file. Also thanks to others who are interested in the discussion, but I think it takes time for me to

Re: sequence composition

2010-12-01 Thread Brian Fraser
> > Why are you returning the results of //g to an empty list, in void context? Forcing list context; //g alone is scalar, which using that regex, it grabs the first character, executes the code.. And that's it. As a list, it does what it should do, so to say :) If you are going to skip whitespac

Re: sequence composition

2010-12-01 Thread John W. Krahn
Brian Fraser wrote: ...and before someone chastises me (rightly so) for using (??{CODE}) in a situation where a perfectly good (?{CODE}) would've done just fine, or for not skipping that first line, or using $1 instead of the more scalable $^N.. Here's a little preemptive redemption: while () {

Re: sequence composition

2010-12-01 Thread John W. Krahn
Brian Fraser wrote: On Wed, Dec 1, 2010 at 4:58 PM, Mariano Loza Collwrote: Alternatively, a good samaritan out there can gelp you with a one or two-liner code. If you only want to count letters, here's the 1-2 liner code, I guess: #! /usr/bin/perl use strict; use warnings; use 5.010; my %let

Re: sequence composition

2010-12-01 Thread Brian Fraser
...and before someone chastises me (rightly so) for using (??{CODE}) in a situation where a perfectly good (?{CODE}) would've done just fine, or for not skipping that first line, or using $1 instead of the more scalable $^N.. Here's a little preemptive redemption: while () { >next if /^>/; >

Re: sequence composition

2010-12-01 Thread Changrong Ge
Hi guys, Thank you so much for the help and I really really appreciate what you guys did for me. I will definitely try all your suggestions plus those scripts. Good to be here and also learn a lot by reading emails on perl discussion. Regards, Changrong On Wed, Dec 1, 201

Re: sequence composition

2010-12-01 Thread Brian Fraser
On Wed, Dec 1, 2010 at 4:58 PM, Mariano Loza Coll wrote: Alternatively, a good samaritan out there can gelp you with a one or two-liner code. If you only want to count letters, here's the 1-2 liner code, I guess: > #! /usr/bin/perl > use strict; > use warnings; > use 5.010; > > my %letter_count;

Re: sequence composition

2010-12-01 Thread Shawn H Corey
On 10-12-01 02:58 PM, Mariano Loza Coll wrote: gi|61499|emb|CAA24495.1| src [Avian sarcoma virus] MGSSKSKPKDPSQRRRSLEPPDSTHHGGFPASQTPNKTAAPDTHRTPSRSFGTVATEPKLFGGFNTSDTV TSPQRAGALAGGVTTFVALYDYESWIETDLSFKKGERLQIVNNTEGNWWLAHSLTTGQTGYIPSNYVAPS DSIQAEEWYFGKITRRESERLLLNPENPRGTFLVRESETTKGAYCLSVSDFDNAKG

Re: sequence composition

2010-12-01 Thread Mariano Loza Coll
> here is the script. give it a name, say, seqComp.pl. usage: perl seqComp.pl > . > HTH, > Anjan ...And as I was writing my reply, Anjan the good samaritan came to the rescue. Thanks Anjan! Mariano

Re: sequence composition

2010-12-01 Thread Mariano Loza Coll
Hello everyone, I'm so glad that I could finally be of some help to a group that helped me before. > Hi Changrong > > The problem doesn't seem difficult, but I'm afraid we don't have much > knowledge of bioinformatics between us. If you post a sample of input > data and the corresponding output

Re: sequence composition

2010-12-01 Thread ANJAN PURKAYASTHA
here is the script. give it a name, say, seqComp.pl. usage: perl seqComp.pl . HTH, Anjan #! /usr/bin/perl -w use strict; open (S, "$ARGV[0]") || die "cannot open FASTA file to read: $!"; my %s;# a hash of arrays, to hold each line of sequence my %seq; #a hash to hold the AA sequences. my $key;

Re: sequence composition

2010-12-01 Thread Rob Dixon
On 01/12/2010 08:44, Changrong Ge wrote: I am quite new to this perl language-I am from biochemistry field. Now trying to write a script for my current work but could not make it. The idea is to calculate the composition (percentage) of amino acids in a protein sequence. Input is a series of fa

Re: sequence composition

2010-12-01 Thread changrong ge
Tack så mycket, I will check that website The output is the percentage of each amino acid in the protein. For example, protein A is 100 amino acid long, in which there are 10 lysine, then the output for lysine is 0.1, the same rule for the other amino acids. In t

Re: sequence composition

2010-12-01 Thread changrong ge
Tack så mycket, I will check that website. The values are the percentage of amino acids in the sequence. For example, protein A is 100 amino acid long, in which there are 12 arginine, then output for arginine is 12%; for the other 19 amino acids, it is the same rule. Thanks anyway, Changrong

Re: sequence composition

2010-12-01 Thread Shlomi Fish
Hi, On Wednesday 01 December 2010 10:44:17 Changrong Ge wrote: > Hi, > I am quite new to this perl language-I am from biochemistry field. > Now trying to write a script for my current work but could not make it. > The idea is to calculate the composition (percentage) of amino acids in