[Bioperl-l] [Bioperl-guts-l] Notification: incoming/1099 (fwd)

Jason Stajich jason@cgt.mc.duke.edu
Fri, 22 Feb 2002 08:26:37 -0500 (EST)


You are not using the Bio::SeqIO module correctly.  Please read the
documentation about Bio::SeqIO available in the POD (at
http://docs.bioperl.org or on your machine - % perldoc Bio::SeqIO).
Additionally the bioperl tutorial will help you as well - available linked
from our website.

Bio::SeqIO is a stream of data - not a single sequence.  Your code is
corrected below with >>>> in front of lines that have been changed or
added.

use Bio::SeqIO;
$in = Bio::SeqIO->new ('-file' => "test.txt",
                        '-format' => "Fasta");
require Bio::Tools::RestrictionEnzyme;
$re1 = new Bio::Tools::RestrictionEnzyme(-NAME =>'EcoRI');
>>>>>>>>>>>>my $seq = $in->next_seq
>>>>>>>>>>>>$locations = $re1->cut_locations($seq);
$first = ${$locations}[1];
print " the first location is $first";


-jason
-- 
Jason Stajich
Duke University
jason@cgt.mc.duke.edu

---------- Forwarded message ----------
Date: Fri, 22 Feb 2002 00:17:03 -0500
From: bioperl-bugs@bioperl.org
To: bioperl-guts-l@bioperl.org
Subject: [Bioperl-guts-l] Notification: incoming/1099

JitterBug notification

new message incoming/1099

Message summary for PR#1099
	From: Guojun Yang <guojun@idmb.tamu.edu>
	Subject: Is this a bug?
	Date: Thu, 21 Feb 2002 23:22:39 -0600
	0 replies 	0 followups

====> ORIGINAL MESSAGE FOLLOWS <====

>From guojun@idmb.tamu.edu Fri Feb 22 00:17:03 2002
Received: from nobel.idmb.tamu.edu ([165.91.108.110])
	by pw600a.bioperl.org (8.12.2/8.12.2) with ESMTP id g1M5H2kO013633
	for <bioperl-bugs@bio.perl.org>; Fri, 22 Feb 2002 00:17:02 -0500
Received: by nobel.idmb.tamu.edu with Internet Mail Service (5.5.2653.19)
	id <1LLZCHPC>; Thu, 21 Feb 2002 23:22:41 -0600
Message-ID: <9DB60E0436608046813742ED5E9989EF01D1E1@nobel.idmb.tamu.edu>
From: Guojun Yang <guojun@idmb.tamu.edu>
To: "'bioperl-bugs@bio.perl.org'" <bioperl-bugs@bio.perl.org>
Subject: Is this a bug?
Date: Thu, 21 Feb 2002 23:22:39 -0600
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01C1BB60.F21A02D0"

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C1BB60.F21A02D0
Content-Type: text/plain;
	charset="iso-8859-1"

Dear Bioperl,
Thank you for maintain the bipperl, I tried to write a short script to get
the locaiton of enzymatic cuts, it gave me information like this:

Can't locate object method "seq" via package "Bio::SeqIO::fasta" (perhaps
you fo
rgot to load "Bio::SeqIO::fasta"?) at
C:/Perl/site/lib/Bio/Tools/RestrictionEnzy
me.pm line 670.

my script is:

use Bio::SeqIO;
$in = Bio::SeqIO->new ('-file' => "test.txt",
			'-format' => "Fasta");
require Bio::Tools::RestrictionEnzyme;
$re1 = new Bio::Tools::RestrictionEnzyme(-NAME =>'EcoRI');
$locations = $re1->cut_locations($in);
$first = ${$locations}[1];
print " the first location is $first";

Is it becaused of a bug in .../RestrictionEnzyme.pm? I am using a Windows
2000 OS? Or could you give me a hint on how to do it?
Thank you very much,
Guojun

------_=_NextPart_001_01C1BB60.F21A02D0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2654.45">
<TITLE>Is this a bug?</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2 FACE=3D"Arial">Dear Bioperl,</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">Thank you for maintain the bipperl, I =
tried to write a short script to get the locaiton of enzymatic cuts, it =
gave me information like this:</FONT></P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Can't locate object method =
&quot;seq&quot; via package &quot;Bio::SeqIO::fasta&quot; (perhaps you =
fo</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">rgot to load =
&quot;Bio::SeqIO::fasta&quot;?) at =
C:/Perl/site/lib/Bio/Tools/RestrictionEnzy</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">me.pm line 670.</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">my script is:</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">use Bio::SeqIO;</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">$in =3D Bio::SeqIO-&gt;new ('-file' =
=3D&gt; &quot;test.txt&quot;,</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D2 =
FACE=3D"Arial">'-format' =3D&gt; &quot;Fasta&quot;);</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">require =
Bio::Tools::RestrictionEnzyme;</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">$re1 =3D new =
Bio::Tools::RestrictionEnzyme(-NAME =3D&gt;'EcoRI');</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">$locations =3D =
$re1-&gt;cut_locations($in);</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">$first =3D ${$locations}[1];</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">print &quot; the first location is =
$first&quot;;</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Is it becaused of a bug in =
.../RestrictionEnzyme.pm? I am using a Windows 2000 OS? Or could you =
give me a hint on how to do it?</FONT></P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Thank you very much,</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">Guojun</FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C1BB60.F21A02D0--


_______________________________________________
Bioperl-guts-l mailing list
Bioperl-guts-l@bioperl.org
http://bioperl.org/mailman/listinfo/bioperl-guts-l