SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bioperl output file detq182 Bioinformatics 3 02-06-2012 07:57 PM
perl bioperl version m_elena_bioinfo Bioinformatics 1 02-21-2011 10:37 AM
bioperl for samtools m_elena_bioinfo Bioinformatics 4 09-07-2010 05:39 AM
Parsing BLAST results using BioPerl Ben Saville Bioinformatics 8 08-24-2010 07:43 AM
Bioperl Coordinate GeneMap jsun529 Bioinformatics 1 08-28-2009 07:23 AM

Reply
 
Thread Tools
Old 08-31-2009, 08:35 AM   #1
jsun529
Member
 
Location: US

Join Date: Apr 2009
Posts: 52
Default Bioperl

I have try to use the get_SeqFeatures with the following code, however the output looks like there are some errors, not sure how to fix that, any help? Thanks.

#!/usr/bin/perl

use Bio::Perl;
use Bio::SeqIO;
#use Bio::Graphics;
use Bio::SeqFeature::Generic;

my $seqio = Bio::SeqIO->new(-fh => \*STDIN, -format => 'genbank');
while (my $seq = $seqio->next_seq()) {
# $seq is-a Bio::FeatureHolderI, hence:
my @feas = $seq->get_SeqFeatures();
# each element is-a Bio::SeqFeatureI
foreach my $fea (@feas) {
# do something with the feature objects
print "$fea\n";
}


output

Bio::SeqFeature::Generic=HASH(0x9f1d1c)
Bio::SeqFeature::Generic=HASH(0x9f03dc)
Bio::SeqFeature::Generic=HASH(0x9f0460)
Bio::SeqFeature::Generic=HASH(0x9f25e0)
Bio::SeqFeature::Generic=HASH(0x9f583c)
Bio::SeqFeature::Generic=HASH(0x9f2790)
Bio::SeqFeature::Generic=HASH(0x9f24d8)
Bio::SeqFeature::Generic=HASH(0x9f6334)
Bio::SeqFeature::Generic=HASH(0x9f6610)
Bio::SeqFeature::Generic=HASH(0x9f5cd4)
jsun529 is offline   Reply With Quote
Old 08-31-2009, 09:46 AM   #2
Zigster
(Jeremy Leipzig)
 
Location: Philadelphia, PA

Join Date: May 2009
Posts: 116
Default

this is just how perl works and is not a bug nor specific to bioperl

you are attempting to print an object to the display

you need to use one of the methods provided by that object to return something that is human-readable (i.e. a string)

try using the display_name method
http://doc.bioperl.org/releases/biop...ric.html#POD21
__________________
--
Jeremy Leipzig
Bioinformatics Programmer
--
My blog
Twitter
Zigster is offline   Reply With Quote
Old 09-01-2009, 04:39 AM   #3
jsun529
Member
 
Location: US

Join Date: Apr 2009
Posts: 52
Default

Thanks. Do any one knows how to pass the objects from get_SeqFeatures, e.g. CDS/EXONS positions to the Bio::Coordinate::GeneMapper function to get different coordinate value? The doc is not very helpful at all. Thanks a lot
jsun529 is offline   Reply With Quote
Old 09-01-2009, 05:35 AM   #4
Zigster
(Jeremy Leipzig)
 
Location: Philadelphia, PA

Join Date: May 2009
Posts: 116
Default

From the genemapper documentation it looks like you'll need two things:
Quote:
# get a Bio::RangeI representing the start, end and strand of the CDS
# in chromosomal (or entry) coordinates
my $cds;

# get a Bio::Location::Split or an array of Bio::LocationI objects
# holding the start, end and strand of all the exons in chromosomal
# (or entry) coordinates
the latter can be gleaned from the SeqFeature using the Location method, though you might have to put them into an array
http://doc.bioperl.org/releases/biop...ric.html#POD21

There are pretty good BioPerl mailing lists out there but I suggest you learn more basics about using perl objects before posting questions to one of those.
__________________
--
Jeremy Leipzig
Bioinformatics Programmer
--
My blog
Twitter
Zigster is offline   Reply With Quote
Old 09-01-2009, 05:54 AM   #5
jsun529
Member
 
Location: US

Join Date: Apr 2009
Posts: 52
Default

I know the functions, however the documentation is not very clear without a good working example. which site is a better bioperl mailing list?
jsun529 is offline   Reply With Quote
Old 09-01-2009, 05:55 AM   #6
jsun529
Member
 
Location: US

Join Date: Apr 2009
Posts: 52
Default

how to I get the value out of this objects
jsun529 is offline   Reply With Quote
Old 09-01-2009, 06:16 AM   #7
Zigster
(Jeremy Leipzig)
 
Location: Philadelphia, PA

Join Date: May 2009
Posts: 116
Default

look at the methods and find one that returns an integer or a string

have you read through Beginning Perl for Bioinformatics and Mastering Perl for Bioinformatics?

I understand your frustration but I would not suggest posting to the bp boards. First familiarize yourself well with perl and then read every post you can about coordinates.

http://www.nabble.com/forum/Search.j...date=&enddate=
__________________
--
Jeremy Leipzig
Bioinformatics Programmer
--
My blog
Twitter
Zigster is offline   Reply With Quote
Old 09-01-2009, 07:27 AM   #8
jsun529
Member
 
Location: US

Join Date: Apr 2009
Posts: 52
Default

Thanks, not have much time with it, would like quick help to move on, however thanks anyway.
jsun529 is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT -8. The time now is 03:01 PM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO