Go Back   SEQanswers > Bioinformatics > Bioinformatics

Similar Threads
Thread Thread Starter Forum Replies Last Post
Extracting the V4 region from a complete genome lorealmt General 3 09-17-2013 03:56 AM
high percetage of intergenic reads from RNA-SEQ CC_seqanswers Bioinformatics 3 03-07-2011 06:48 AM
Length exon, intron, promoter and intergenic regions in human genome khb Bioinformatics 1 01-17-2011 01:03 PM
RNA-Seq: Intergenic and Repeat Transcription in Human, Chimpanzee and Macaque Brains Newsbot! Literature Watch 0 07-10-2010 02:40 AM

Thread Tools
Old 07-16-2012, 08:53 AM   #1
Junior Member
Location: Germany

Join Date: Mar 2012
Posts: 1
Unhappy Extracting intergenic region

Hi guys;

I am with a problem with my parse. Well I'll try to explain the code before posting it:

I have a table with information on areas where I need to find intergenic regions, ie, I can not use ID or locus_tag to search these regions. So I picked up at the table and startCoord stopCoord of each target region I'm going to put in array for later use as a search key.

PS: The db isn't gbrowser.

The output is multiFasta my $ out = Bio :: SeqIO-> new (-file => "> outputfilename", '-format' => 'Fasta'); #unfinished.


#!/usr/bin/perl -w
use strict;
use Bio::Perl;
use Bio::Seq;
use Bio::SeqIO;
use IO::String;
use Bio::SearchIO;
use DBI;
use CGI;
use Bio::PrimarySeq;

my ($fastaFile)=@ARGV;

#Get fasta file
my $in = Bio::SeqIO->new(-file => $fastaFile, -format => 'Fasta');

#write fasta file
my $out = Bio::SeqIO->new(-file => '>multFasta.fa', -format => "Fasta", -flush => 0);

my $subseq;

#DB Parte, take informations, Regulator, Target, starCoord, stopCoord.

my $dbh = DBI->connect('dbi:mysql:db_name','user','password') or die "Connection Error: $DBI::errstr\n";

# select multiple fields with multiple rows:

my $sql = qq`SELECT Regulator , Target , startCoord , stopCoord FROM table WHERE 1`;
my $sth = $dbh->prepare($sql) or die "Cannot prepare: " . $dbh->errstr();
$sth->execute() or die "Cannot execute: " . $sth->errstr();
my @row;
my @fields;
while(@row = $sth->fetchrow_array()) {
my @record = @row;
push(@fields, \@record);

# now process the fields

if (@fields != 0) {
my $i=0;
foreach my $line (@fields) {
my $seq = $in->next_seq();
$subseq = $seq->subseq(@$line[2],@$line[3]); #Here is the problem
print "$subseq";
#print "@$line[2], @$line[3]"."\n";
#$out ->write_seq($subseq);

$sth -> finish;
$dbh -> disconnect;
### End of DB Part ###
When I run, bioperl told me:
------------- EXCEPTION: Bio::Root::Exception -------------
MSG: Bad end parameter (2692830). End must be less than the total length of sequence (total=1524)
STACK: Error::throw
STACK: Bio::Root::Root::throw /usr/local/share/perl/5.10.1/Bio/Root/
STACK: Bio::PrimarySeq::subseq /usr/local/share/perl/5.10.1/Bio/
STACK: Bio::Seq::subseq /usr/local/share/perl/5.10.1/Bio/
STACK: parse_starr_and_stop.perl:48

I've been a weak with this problem, and I can't resolve.

I thank you in advance.
vabreu is offline   Reply With Quote

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 04:30 PM.

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