[Bioperl-l] Bio::AlignIO::Pfam
Tariq Shafi
tariq_shafi75 at hotmail.com
Sat Jun 5 10:10:43 EDT 2004
Hello all
I am trying to submit a sequence in Perl to a pfam flat file database and
get a classification for the family that a peptide sequence belongs to, and
analysis of its domains.
I am thus using the Bio::AlignIO::Pfam module in Perl but all examples I can
find is taking input from a file. I want to (dynamically) create a Bio::Seq
object and use that as an argument in Bio::AlignIO::Pfam and get output as I
would do as if I submitted the sequence in the Pfam database website.
I am using CGI and dynamic web pages and want to avoid creating new files
when a Pfam alignment is requested as that will be a little messy and
expensive on memory.
The relevant chunk of my code so far for this is as below:
use CGI qw(:standard);
use DBI;
use Bio::AlignIO;
etc....
# Using a statement handle in Perl DBI
while ($sth->fetch())
{
print b("PAD ID: "), b($id), p(), b("Swiss-Prot ID: "), $swissProtId,br(),
b("Sequence:"), br();
# Creating Bio::Seq object
$seq = Bio::Seq->new(-seq => $sequence,
-desc => $swissProtId,
-id => $id
);
}
$sth->finish();
print b("Pfam classification:"), p();
# This is the problem area
# I don't want files involved here. Instead of file and format I simply want
the argument to be a
# Bio::Seq object
$in = Bio::AlignIO->new(
'-file' => $ARGV[0],
'-format' => 'stockholm' );
# Here I don't want files involved either. I want $out to be something
different but have nothing
# to do with a file.
$out = Bio::AlignIO->new(
'-file' => ">$ARGV[1]",
'-format' => 'pfam');
$align = $in->next_aln();
$out->write_aln($align);
Regards
Tariq
_________________________________________________________________
It's fast, it's easy and it's free. Get MSN Messenger today!
http://www.msn.co.uk/messenger
More information about the Bioperl-l
mailing list