Question: exonerate error while building index
1
gravatar for ahaswer
2.1 years ago by
ahaswer10
Czech Republic
ahaswer10 wrote:

Hello, I want to use exonerate-server. Therefore I've created database file using fasta2esd and then I've tried to build the index using esd2esi, but I didn't work for me. It prints error while running esd2esi:

esd2esi Chr1.esd Chr1.esi

** Message: Building index

* FATAL ERROR *: Unknown or irregular fasta line length

exiting ...

While I'm pretty sure that fasta file is fine. Do you know how to solve this issue?

exonerate software error • 659 views
ADD COMMENTlink modified 13 days ago by dukecomeback30 • written 2.1 years ago by ahaswer10

I also run into this problem, don't know if you've figured it our?

ADD REPLYlink written 13 days ago by dukecomeback30
0
gravatar for dukecomeback
13 days ago by
dukecomeback30
China
dukecomeback30 wrote:

I think I've figure this out. It because that the sequences in the fasta file are output in one line. Some are too long for the exonerate. Here is a perl script to re-type the fasta so each sequence would be output in multiple lines

#!/usr/bin/perl -w
use strict;
use Getopt::Long;
my ($chr,$help);
my $width="0";
my $infile="";
my $outfile="";

GetOptions(
                "help|h"     => \&USAGE,
                "infile:s"   => \$infile,
                "outfile:s"  => \$outfile,
                "width=i"    => \$width,
);

die "please give me a number between 10 and 200\n" unless 10<= $width and $width <=200;
open IN,"<$infile"||die;
open OUT,">$outfile";


$/=">";<IN>;$/="\n";
while(<IN>){
    my $chr=$1 if /^(\S+)/;
    $/=">";
    chomp(my $seq=<IN>);
    $/="\n";
    $seq=~s/\n+//g;
    print OUT ">$chr\n";
    my $start=0;
    my $len=length($seq);
    while($start+$width<$len){
    $b=substr($seq,$start,$width);
    print OUT "$b\n";
    $start=$start+$width;}
    while($start+$width>=$len){
    $b=substr($seq,$start,$width);
    print OUT "$b\n";
    last;}
}
sub USAGE{
                my $usage=<<"USAGE";

------------------------------------------------------------------------------------
       Program: thir_test.pl
       Date:2017-05-19
       Usage:
                 -infile    <fasta format> infile
                 -outfile   <fasta format> outfile
                 -width     <int>  seq length
                 -h          help


       Example1: perl thir_test.pl -infile data.fa -outfile out.fa -width 10
       Example2: perl thir_test.pl -h
------------------------------------------------------------------------------------
USAGE
        print $usage;
        exit;
}

the script is from: https://blog.csdn.net/niuhuihui_fei/article/details/72636679

ADD COMMENTlink modified 13 days ago • written 13 days ago by dukecomeback30
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1570 users visited in the last hour