[Bioperl-l] More help....

Jonathan Greenwood jegreenwood25 at hotmail.com
Thu Feb 19 13:50:05 EST 2004

Hi, this combines CGI and BioPerl, what i need to do is open a Genbank file
and then parse(write out) the features. But I need these parsed features to
go into a textbox for editing, and then be able to save the data I have just
edited...Please Help!!! Many thanks...the code is enclosed with the

Jonathan Greenwood
email: jonathon at mgcheo.med.uottawa.ca

#! /usr/local/bin/perl -wT

use strict;
use CGI qw / :standard /;
use CGI::Pretty;
use Bio::SeqIO;
use Bio::SeqFeature::Generic;
use Bio::Location::Simple;
use Bio::Location::SplitLocationI;

my @features = read_file(param('file')) if param('file');

print header, start_html('Plasmid Feature Editor');

print h1('Plasmid Feature Editor');

print p('Load up a Genbank file to work with, then edit the features in the
text box.');

print start_multipart_form(),
  table({-cellpadding => 10},
	TR({-class=> 'resultsbody'},
	   td(textarea('-name'     => 'editarea',
		       '-value'    => (@features),
		       '-rows'     => 20,
		       '-cols'     => 70,
		       '-override' => (@features) || (param('clear')),
	   td(filefield(-name    => 'uploaded_file',
			-length  => 40),
	   td(submit(-name  => 'submit_button',
		     -value => 'Click to display features'),
	   td(submit(-name  => 'save_button',
		     -value => 'Click here to save your work'),

print end_html;


sub read_file {
my $fh = param('uploaded_file');
my $gb_parser = Bio::SeqIO->new(-fh=>$fh,-format=>'genbank');
my @features;
while (my $seq = $gb_parser->next_seq) {
	push @features,$seq->get_all_SeqFeatures();
} return @features;

MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.  

More information about the Bioperl-l mailing list