loop ?

R

Rita

Here is my code i want to do this work its related to Bioinformatics i
hope there are some bioinformatics mamber too:
my $result=$in->next_result;
my $hit =$result->next_hit;
my $hsp1 =$hit->next_hsp;
my$start1=$hsp1->query->start;
my $end1=$hsp1->query->end;
print "start First Hsp ",$start1,"\n";
print "End First Hsp ",$end1,"\n\n";

#Print Starting and Ending Point of 2 Hsps-
my $hsp2 =$hit->next_hsp;
my$start2=$hsp2->query->start;
my $end2=$hsp2->query->end;
print "start Second Hsp ",$start2,"\n";
print "End Second Hsp ",$end2,"\n\n";

#Print Gep Sequence
print "Gap Sequence- ",$seq1->subseq($end1+1,$start2-1);
you can see that i did same work twice bcoz of to get value of $end1
and $start2
how i can put in loopthis thing.i tried while loop but it's not working
..
thanks
 
D

Dr.Ruud

Rita schreef:
Here is my code i want to do this work its related to Bioinformatics i
hope there are some bioinformatics mamber too:
my $result=$in->next_result; [...]

Whitespace must be expensive at your end. Please insert white lines
before and after and inside code, and add spaces to make your code
better readable, like:

my $result = $in->next_result;
my $hit = $result->next_hit;

my $hsp1 = $hit->next_hsp;
my $start1 = $hsp1->query->start;
my $end1 = $hsp1->query->end;

#-Print Starting and Ending Point of 1st Hsps-
print "Start 1st Hsp ", $start1, "\n";
print "End 1st Hsp ", $end1, "\n\n";

my $hsp2 = $hit->next_hsp;
my $start2 = $hsp2->query->start;
my $end2 = $hsp2->query->end;

#-Print Starting and Ending Point of 2nd Hsps-
print "Start 2nd Hsp ", $start2, "\n";
print "End 2nd Hsp ", $end2, "\n\n";

print "Gap Sequence- ", $seq1->subseq($end1 + 1, $start2 - 1);

you can see that i did same work twice bcoz of to get value
of $end1 and $start2
how i can put in loopthis thing.i tried while loop but it's
not working .
thanks

Capitals and interpunction are also a good investment. It is my
experience that people who make a mess when writing a natural language,
tend to do similar when writing other stuff.
 
M

Mark Clements

Rita said:
Here is my code i want to do this work its related to Bioinformatics i
hope there are some bioinformatics mamber too:
my $result=$in->next_result;
my $hit =$result->next_hit;
my $hsp1 =$hit->next_hsp;
my$start1=$hsp1->query->start;
my $end1=$hsp1->query->end;
print "start First Hsp ",$start1,"\n";
print "End First Hsp ",$end1,"\n\n";

#Print Starting and Ending Point of 2 Hsps-
my $hsp2 =$hit->next_hsp;
my$start2=$hsp2->query->start;
my $end2=$hsp2->query->end;
print "start Second Hsp ",$start2,"\n";
print "End Second Hsp ",$end2,"\n\n";

#Print Gep Sequence
print "Gap Sequence- ",$seq1->subseq($end1+1,$start2-1);
you can see that i did same work twice bcoz of to get value of $end1
and $start2
how i can put in loopthis thing.i tried while loop but it's not working
.
thanks

It's quite hard to read your code. Check out perltidy - it is your
friend. Also, your subject line doesn't describe your problem.

I would guess (I have no idea what modules you are using) you need
something like:

my @results = ();

while ( my $hsp = $hit->next_hsp ) {
my $query = $hsp->query;

my $start = $query->start;
my $end = $query->end;
push @results , { start => $start, end => $end };

}
if(@results){
my $start = $results[0]->{start};
my $end = $results[$#results]->{end};

# handle results
outputResults( $start, $end );
}else {
# handle empty results
}


but your problem description ("it's not working") doesn't give me much
to work with. Anyway, I hope this is of some help.



Mark
 
B

Brian McCauley

Rita said:
i tried while loop but it's not working.

In that case, you probably did something wrong.

If you give a more precise description of what you did, and how it
failed to meet your expectations we may be able to be more precise about
what ou did wrong.

Be aware you are rappidly using up your quota of good will.
 
U

usenet

Brian said:
Rita wrote:
[a disjointed question]
Be aware you are rappidly using up your quota of good will.

Rita - what Brian is saying is that you are very close to getting
yourself killfiled by many participants in this group. Once someone
killfiles you, s/he will never again see anything you post and will
never again give you any assistance. Thus, getting killfiled is the
worst thing that can happen to you in a newsgroup, because it
significantly reduces the amount of assistance you might hope to
receive.

I realize that you post in several newsgroups. You should be aware that
this particular group generally has higher posting standards than
groups like perl.beginners. You are welcome to participate here, but
you will have much more success (and not get yourself killfiled) if you
would read and abide by the posting guidelines for this particular
group:

http://mail.augustmail.com/~tadmc/clpmisc.shtml
 
R

Rita

Brian said:
Rita wrote:
[a disjointed question]
Be aware you are rappidly using up your quota of good will.

Rita - what Brian is saying is that you are very close to getting
yourself killfiled by many participants in this group. Once someone
killfiles you, s/he will never again see anything you post and will
never again give you any assistance. Thus, getting killfiled is the
worst thing that can happen to you in a newsgroup, because it
significantly reduces the amount of assistance you might hope to
receive.

I realize that you post in several newsgroups. You should be aware that
this particular group generally has higher posting standards than
groups like perl.beginners. You are welcome to participate here, but
you will have much more success (and not get yourself killfiled) if you
would read and abide by the posting guidelines for this particular
group:
Where i can read that posting guidelines.
 
B

Brian McCauley

Rita said:
Brian said:
Rita wrote:
[a disjointed question]
Be aware you are rappidly using up your quota of good will.

You are welcome to participate here, but
you will have much more success (and not get yourself killfiled) if you
would read and abide by the posting guidelines for this particular
group:

[ URL given by David, snipped by Rita ]
Where i can read that posting guidelines.

As far as I'm concerned you can read them anywhere you like.

Certainly you read them anywhere with Web access. You can also download
them and read them anywhere you've got a computer. If you print them
out on paper the choice is even wider. I suggest, however, not reading
them while driving or in church.
 
U

usenet

Rita said:
now i can continue in this thrade or i should start a new thrade

This thread has already crashed and burned. Repeating a question is
usually poor netiquette, but I think folks might overlook the
infraction if you re-post according to the guidelines.
 
R

Rita

Brian said:
Rita said:
Brian McCauley wrote:

Rita wrote:
[a disjointed question]
Be aware you are rappidly using up your quota of good will.

You are welcome to participate here, but
you will have much more success (and not get yourself killfiled) if you
would read and abide by the posting guidelines for this particular
group:

[ URL given by David, snipped by Rita ]
Where i can read that posting guidelines.

As far as I'm concerned you can read them anywhere you like.

Certainly you read them anywhere with Web access. You can also download
them and read them anywhere you've got a computer. If you print them
out on paper the choice is even wider. I suggest, however, not reading
them while driving or in church
it's funny. but i know my english is not so good but i read guidelines
there is not naccesary that you have to good english writer
 
U

usenet

Rita said:
I read guidelines there is not naccesary that you have to good english writer

That is because the guidlelines encourage you to speak Perl, not
English. Not everyone here understands English, but Perl is very well
understood here.
 
R

robic0

Brian said:
Rita wrote:
[a disjointed question]
Be aware you are rappidly using up your quota of good will.

atiR - tahw nairB si gniyas si taht uoy era yrev esolc ot gnitteg
flesruoy delifllik yb ynam stnapicitrap ni siht puorg. ecnO enoemos
selifllik uoy, s/eh lliw reven niaga ees gnihtyna uoy tsop dna lliw
reven niaga evig uoy yna ecnatsissa. suhT, gnitteg delifllik si eht
tsrow gniht taht nac neppah ot uoy ni a puorgswen, esuaceb ti
yltnacifingis secuder eht tnuoma fo ecnatsissa uoy thgim epoh ot
eviecer.

I ezilaer taht uoy tsop ni lareves spuorgswen. uoY dluohs eb erawa taht
siht ralucitrap puorg yllareneg sah rehgih gnitsop sdradnats naht
spuorg ekil lrep.srennigeb. uoY era emoclew ot etapicitrap ereh, tub
uoy lliw evah hcum erom sseccus (dna ton teg flesruoy delifllik) fi uoy
dluow daer dna ediba yb eht gnitsop senilediug rof siht ralucitrap
puorg:
http://mail.augustmail.com/~tadmc/clpmisc.shtml

Hey, thanks for the help. Perhaps you would like to join a
newsgroup in the bizzarro world where you comments apply.
 
R

robic0

Rita, Mark Clements gave you an answer. Don't listen to these Rude led
assholes! Email me if you want paid proffessional work.
 
R

robic0

On 18 Nov 2005 12:17:22 -0800, (e-mail address removed) wrote:
Please write your questions in Perl, naming variables in your native
language so this guy can understand your question.....
 
R

robic0

now i can continue in this thrade or i should start a new thrade

This thread has already crashed and burned. Repeating a question is
usually poor netiquette, but I think folks might overlook the
infraction if you re-post according to the guidelines.[/QUOTE]
 
R

robic0

On Fri, 18 Nov 2005 19:40:16 +0100, "Dr.Ruud"
Rita schreef:
Here is my code i want to do this work its related to Bioinformatics i
hope there are some bioinformatics mamber too:
my $result=$in->next_result; [...]

Whitespace must be expensive at your end. Please insert white lines
before and after and inside code, and add spaces to make your code
better readable, like:

my $result = $in->next_result;
my $hit = $result->next_hit;

my $hsp1 = $hit->next_hsp;
my $start1 = $hsp1->query->start;
my $end1 = $hsp1->query->end;

#-Print Starting and Ending Point of 1st Hsps-
print "Start 1st Hsp ", $start1, "\n";
print "End 1st Hsp ", $end1, "\n\n";

my $hsp2 = $hit->next_hsp;
my $start2 = $hsp2->query->start;
my $end2 = $hsp2->query->end;

#-Print Starting and Ending Point of 2nd Hsps-
print "Start 2nd Hsp ", $start2, "\n";
print "End 2nd Hsp ", $end2, "\n\n";

print "Gap Sequence- ", $seq1->subseq($end1 + 1, $start2 - 1);

you can see that i did same work twice bcoz of to get value
of $end1 and $start2
how i can put in loopthis thing.i tried while loop but it's
not working .
thanks

Capitals and interpunction are also a good investment. It is my
experience that people who make a mess when writing a natural language,
tend to do similar when writing other stuff.
 
J

Josef Moellers

robic0 said:
Rita, Mark Clements gave you an answer. Don't listen to these Rude led
assholes! Email me if you want paid proffessional work.

You want to suggest that someone calling other people names and not even
using a real name is capable of giving professional help?
Also, some of your posts in this thread (top-posting, _needlessly_
quoting entire messages and adding only a very few words of rants) don't
actually show any professionality.

Oh ... and, by the way, where exactly _is_ your email address? It's
nowhere in the header or anywhere in your "reply".

I'd rather spend a lot of time trying to figure out how to ask questions
properly than spend a single cent (Euro- or US- or whatever) on such
"paid professional work".
 
U

usenet

Josef said:
You want to suggest that someone calling other people names and not even
using a real name is capable of giving professional help?

Of course, we "Rude led assholes" (whatever that means) do
professional work here for FREE. All we ask is that folks participate
in this forum according to the simple conventions that the regular
participants have agreed upon. That seems a small price to pay for
timely, expert assistance.

FWIW, in a search of Google Groups, I must go back to Oct 7 to see a
posting by this author which attempts to be helpful to someone. I
suppose he is more interested in getting paid than being helpful.

If someone doesn't like the posting guidelines for CLPMisc, s/he is
free to go elsewhere. I have seen and replied to Rita's posts in
perl.beginners without once mentioning posting guidelines (because they
don't apply in that newsgroup).

But the old maxim applies in that or this or any group: "The best way
to get a good answer is to ask a good question."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top