Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Each line of the file must be less than 65,536 characters #345

Open
Juke34 opened this issue Jul 1, 2020 · 9 comments
Open

Each line of the file must be less than 65,536 characters #345

Juke34 opened this issue Jul 1, 2020 · 9 comments

Comments

@Juke34
Copy link
Contributor

Juke34 commented Jul 1, 2020

------------- EXCEPTION: Bio::Root::Exception -------------
MSG: Each line of the file must be less than 65,536 characters.
STACK: Error::throw
STACK: Bio::Root::Root::throw /home/lgs6452/.conda/envs/exonerate_env/lib/site_perl/5.26.2/Bio/Root/Root.pm:447
STACK: Bio::DB::IndexedBase::_check_linelength /home/lgs6452/.conda/envs/exonerate_env/lib/site_perl/5.26.2/Bio/DB/IndexedBase.pm:757
STACK: Bio::DB::Fasta::_calculate_offsets /home/lgs6452/.conda/envs/exonerate_env/lib/site_perl/5.26.2/Bio/DB/Fasta.pm:227
STACK: Bio::DB::IndexedBase::_index_files /home/lgs6452/.conda/envs/exonerate_env/lib/site_perl/5.26.2/Bio/DB/IndexedBase.pm:659
STACK: Bio::DB::IndexedBase::index_file /home/lgs6452/.conda/envs/exonerate_env/lib/site_perl/5.26.2/Bio/DB/IndexedBase.pm:487
STACK: Bio::DB::IndexedBase::new /home/lgs6452/.conda/envs/exonerate_env/lib/site_perl/5.26.2/Bio/DB/IndexedBase.pm:364
-------------

Someone knows why there is this limitation? Could we add a patch to fix the sequence to make it shorter in such case?

@hyphaltip
Copy link
Member

hyphaltip commented Jul 1, 2020 via email

@Juke34
Copy link
Contributor Author

Juke34 commented Jul 1, 2020

I made a toolkit (AGAT) and I have several scripts using Bio::DB::Fasta. Myself I never use single line fasta files, but I got several time user feedbacks having this error. Apparently it is not rare that people use single line fasta files. The fix is always to reformat the file before, but maybe there is an easy way to fix the sequence on the fly (refold it) when calling Bio::DB::Fasta.

@cjfields
Copy link
Member

cjfields commented Aug 6, 2020

@Juke34 the problem is that the index is built based on the location of the record delimiters in the file.

(to add to @hyphaltip 's alternatives, I've been using samtools faidx for quite a while).

@cjfields
Copy link
Member

@Juke34 BTW I should have mentioned back in August that a patch is more than welcome.

@Juke34
Copy link
Contributor Author

Juke34 commented Mar 1, 2021

I don’t see any obvious way to patch that.

@carandraug
Copy link
Member

carandraug commented Aug 16, 2024 via email

@scottcain
Copy link
Member

scottcain commented Aug 16, 2024 via email

@kenji-yt
Copy link

kenji-yt commented Aug 16, 2024

@carandraug Thanks. I ended up going for fastx_toolkit to do it (see here) applying it only if the fasta has a line with more that 65536 characters (checked for each file using 'wc -L'). But perhaps I should use fold instead as I wont need to have fastx_toolkit in my environment and it might be faster.

Cheers.
Kenji

@Juke34
Copy link
Contributor Author

Juke34 commented Aug 19, 2024

I use to use fold with default value but @carandraug is right, you should be sure that the description is shorter or equal to the fold size otherwise you will have surprises!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants