Well, with much help I have ben able to come up with this currently not
working code:
#!/usr/bin/perl
use warnings;
use strict;
use Data::Dumper;
my(%gap, %gap_pos, $animal);
while () {
if (/>(\w+)/) {
$animal = $1;
} else {
while (/(-+)/g) {
my $gap_length = length $1;
my
I have a several "hash of a hashes" that look like this (sorry if my
formating is a little off):
Human => { # HoH for human
1 => [1,32,54,67] # numbers in [ ] is a string delimited by commas
not separate hash values
2 => [14,52,74,87]
5 => [33,44,64,107]
}
Chimp => { # HoH for Chimp
1
I cleaned up the code a little. So, here it is for anyone interested:
#!usr/bin/perl
# By Michael S. Robeson II with the help from the folks at lernperl.org
and bioperl.org
# 10/16/2004
# Last updated: 10/17/2004
# This script was made for the purpose of searching for indels (gaps)
in aligned
mes found:1
Positions:
10
>>>>>> dog <<<<<<
Indel size: 1 Times found:1
Positions:
18
Indel size: 2 Times found:1
Positions:
5
Indel size: 3 Times found: 1
Positions:
12
Indel size: 4 Times fo
Ok, well I think I can see the forest but I have little idea as to what
is actually going on here. I spent a few hours looking things up and I
have a general sense of what is actually occurring but I am getting
lost in the details that were posted in the last digest. See below:
On Sep 19, 2004,
I have two sets of data that have been stored in hashes. The first hash
has amino-acid (protein) sequence data. The second hash has the
corresponding DNA sequence of those amino-acids:
Hash 1
key:value:
cat = mfgdhf
doq = mfg--f
mouse = mf-d-f
Hash 2
key:
Great, thanks for the help!
-Mike
On Jul 3, 2004, at 2:16 PM, Gunnar Hjalmarsson wrote:
Michael S. Robeson II wrote:
No, your post was not in the last e-mail digest I received,
I see. Sometimes I think that digest mode for mailing lists is a
nuisance. ;-)
But the link you provided seems to clear
loop since the values are not
defined then they are ignored. When the loop proceeds again these
values (at this point) are now defined because of the previous
iteration of the loop has set the values from the else statement?
-Mike
On Jul 2, 2004, at 10:25 PM, Michael S. Robeson II wrote:
Well yeah
was working
(again if I have right). Hopefully, I 'got it' now. I can see why many
coders are annoyed with nested if statements. :-)
-Thanks!
-Mike
On Jul 3, 2004, at 4:38 AM, Randy W. Sims wrote:
On 7/2/2004 10:25 PM, Michael S. Robeson II wrote:
Well yeah, the indentation makes it m
Well yeah, the indentation makes it much more clearer. However, this
does not help me understand how the nested "if" statements are working.
Which of the two "if" statements gets evaluated first? I am trying to
figure out "in english" what the "if" statements are actually doing. Is
it saying:
I came across some code on the internet that looks like this (this is
only part of the script):
while () {
$line=$_;
if ($line=~/^>(.+)/) {
if ($seq) {
$pro{$name}=$seq;
#print "SEQ:\n$pro\n\n";
}
$name=$1;
Well this is the best I could do thinking through what you said. This
is actually my first time working with hashes. Also, I am still a PERL
newbie. So, I guess a little helpful code would go a long way. I just
can't figure out how to link the regular expressions to the hash when
searching thro
Hi all,
I am having trouble with combining data from several files, and I can't
even figure out how to get started. So, I am NOT asking for any code
(though pseudo-code is ok) as I would like to try figuring this problem
out myself. So, if anyone can give me any references or hints that
wou
Hi all,
I am having trouble with combining data from several files, and I can't
even figure out how to get started. So, I am NOT asking for any code
(though pseudo-code is ok) as I would like to try figuring this problem
out myself. So, if anyone can give me any references or hints that
wou
On Feb 11, 2004, at 2:55 PM, James Edward Gray II wrote:
[snip]
my @char = ( /[a-z]/ig, ( '-' ) x $len )[ 0 .. $len - 1 ];
If I may, yuck! This builds up a list of all the A-Za-z characters in
the string, adds a boat load of extra - characters, trims the whole
list to the length you want
See comments below.
On Feb 11, 2004, at 2:55 PM, James Edward Gray II wrote:
On Feb 11, 2004, at 1:27 PM, Michael S. Robeson II wrote:
[snip]
Anyway, though it works great I am having a tough time trying to
figure out WHY it works.
See comments below, in the code.
[snip]
I think if I can
Hi all!
Well, based on the input I have received from everyone thus far I have
been able to cobble the following code together (See below for the
input and out put of of this script).
Anyway, though it works great I am having a tough time trying to figure
out WHY it works. I am especially havi
Hi I am all still to new to PERL and I am having trouble playing with
formatting my data into a new format. So here is my problem:
I have data (DNA sequence) in a file that looks like this:
# Infile
>bob
AGTGATGCCGACG
>fred
ACGCATATCGCAT
>jon
CAGTACGATTTATC
and I need it converted to:
18 matches
Mail list logo