Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • vabreu
    Junior Member
    • Mar 2012
    • 1

    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);
    }
    $sth->finish();


    # 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);
    }
    $i++;
    }
    }


    $sth -> finish;
    $dbh -> disconnect;
    ### End of DB Part ###
    exit;
    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/Root.pm:368
    STACK: Bio::PrimarySeq::subseq /usr/local/share/perl/5.10.1/Bio/PrimarySeq.pm:401
    STACK: Bio::Seq::subseq /usr/local/share/perl/5.10.1/Bio/Seq.pm:635
    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.

Latest Articles

Collapse

  • SEQadmin2
    Nine Things a Sample Prep Scientist Thinks About Before Sequencing
    by SEQadmin2


    I’m not a sequencing expert. I’m a purification scientist who uses NGS to evaluate workflows my group develops. With this perspective, we think about the sample first and the NGS workflow second. The sequencer is an exceptionally honest reporter, but it can only report on what you give it, so whether you get clean, interpretable data from an NGS workflow is largely determined before you begin.

    Here are nine questions we think about, in roughly the order they matter, before...
    06-18-2026, 07:11 AM
  • SEQadmin2
    From Collection to Sequencing: Why Sample Preparation and Preservation Define Sequencing Data
    by SEQadmin2


    Data variability is still an issue in sequencing technologies despite the advances in reproducibility and accuracy of these platforms. But the problem does not originate in the sequencing itself, but in the previous steps, before the sample reaches the sequencer.


    The first step is collection, followed by preservation and sample preparation for analysis. Most scientists overlook those steps, but not being careful might just be skewing the experiment’s results.
    ...
    06-02-2026, 10:05 AM

ad_right_rmr

Collapse

News

Collapse

Topics Statistics Last Post
Started by SEQadmin2, 06-26-2026, 11:10 AM
0 responses
10 views
0 reactions
Last Post SEQadmin2  
Started by SEQadmin2, 06-17-2026, 06:09 AM
0 responses
45 views
0 reactions
Last Post SEQadmin2  
Started by SEQadmin2, 06-09-2026, 11:58 AM
0 responses
105 views
0 reactions
Last Post SEQadmin2  
Started by SEQadmin2, 06-05-2026, 10:09 AM
0 responses
125 views
0 reactions
Last Post SEQadmin2  
Working...