bedtools2 icon indicating copy to clipboard operation
bedtools2 copied to clipboard

[segmentation fault] errors while converting coordinates to sequences using bedtools getfasta

Open psaisan opened this issue 3 years ago • 2 comments

I get segmentation fault error with while attempting to convert genomic coordinates (bed file) to sequences (from input_sequences.fa fasta file) - see below:

bedtools getfasta -fi input_sequences.fa -bed genomic_coordinates.bed -fo output_sequences.fa

Segmentation fault (core dumped)

No explanation is given. The problem can go away after adding additional chromosomes/data to input_sequences.fa (fasta) file or sometimes by taking AWAY data. Are there constraints the tie that fasta input file to the bed file such that if the constraints are violated segmentation faults occur?

Thanks...

psaisan avatar Oct 26 '22 04:10 psaisan

could you give an example (ideally small) dataset that produces this issue?

arq5x avatar Nov 30 '22 13:11 arq5x

I resolved the issue:

The problem with bedtools getfasta is this:

The input *.fa file is indexed the first time you run it. However if the content of *.fa is changed while the name remains the same in the subsequent runs the index file is not updated and use of the older fasta file index with the new fasta file causes problems, that is intermittent segmentation faults depending on the content of files. Most of the time I realized it manages to run without segmentation fault, it produces the wrong results when index file doesn't match the fasta file. So, the segmentation fault was a blessing in disguise. The work around around was to manually delete the index files everytime I run getfasta. Small hit not having the index file. Bedtools can check for this condition in the future, if the fasta file content does not coincide with existing index delete the index file *.fai.

Thank you P. Saisan

On Wed, Nov 30, 2022, 5:30 AM Aaron Quinlan @.***> wrote:

could you give an example (ideally small) dataset that produces this issue?

— Reply to this email directly, view it on GitHub https://github.com/arq5x/bedtools2/issues/1018#issuecomment-1332155997, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXUQXQHMXEOV7USFYFEGWUTWK5JHJANCNFSM6AAAAAAROSINPA . You are receiving this because you authored the thread.Message ID: @.***>

psaisan avatar Nov 30 '22 15:11 psaisan