in reply to Re^11: calculation of charged amino acids
in thread calculation of charged amino acids
modification of this code is done here but error is showing only in counting "aromatic residue"
any suggestions
#!/usr/bin/env perl use 5.010; use strict; use warnings; use autodie; my $header = ''; my (@headers_found, %header_data); open my $fasta_fh, '<', $ARGV[0]; while (<$fasta_fh>) { chomp; next if /^\s*($|#)/; if (/^>(.*)$/) { push @headers_found, ($header = $1); } else { die 'Sequence data found without a header!' unless $header; for (split '', "\U$_") { /(?<a>[BDEZ])|(?<b>[KRH])|(?<ali>[AVLI])|(?<aro>[FHYW])|(?< +po>[DEHKNQRSTZ])|(?<nonpo>[ACFGILMPVWY])/; if ($_ =~ /(?<u>[XUGJOP])/){ next;} ++$header_data{$header}{(keys %+)[0]}; } } } close $fasta_fh; for (@headers_found) { say "Header: $_"; say "\tAcidic: $header_data{$_}{a}"; say "\tBasic: $header_data{$_}{b}"; say "\tAliphatic: $header_data{$_}{ali}"; say "\tAromatic: $header_data{$_}{aro}"; say "\tPolar: $header_data{$_}{po}"; say "\tNonpolar: $header_data{$_}{nonpo}"; # say "\tUnknown: $header_data{$_}{u}"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^13: calculation of charged amino acids
by mtmcc (Hermit) on Jul 30, 2013 at 12:44 UTC | |
by yuvraj_ghaly (Sexton) on Jul 31, 2013 at 05:14 UTC | |
by Anonymous Monk on Jul 31, 2013 at 06:54 UTC | |
by yuvraj_ghaly (Sexton) on Jul 31, 2013 at 07:04 UTC | |
by mtmcc (Hermit) on Jul 31, 2013 at 07:40 UTC | |
by yuvraj_ghaly (Sexton) on Jul 31, 2013 at 07:02 UTC | |
by mtmcc (Hermit) on Jul 31, 2013 at 09:41 UTC | |
by yuvraj_ghaly (Sexton) on Aug 01, 2013 at 04:22 UTC | |
by mtmcc (Hermit) on Aug 01, 2013 at 07:16 UTC | |
by marto (Cardinal) on Jul 31, 2013 at 09:51 UTC |