This is a test version of Biostars. For the public version, visit https://www.biostars.org.
bedtools bamtofastq: Segmentation fault (core dumped)

I want to get all the reads from a bam file in a single fastq file. I am getting the message "Segmentation fault (core dumped)" while running

bedtools bamtofastq -i in.name.sorted.bam -fq out.fq

However, it works for the PE mode

bedtools bamtofastq -i in.name.sorted.bam -fq out.R1.fq -fq2 out.R2.fq

Bedtools version: v2.29.0

Any suggestion would be very helpful.

bedtools bamtofastq bam rna-seq

It might be because your directory doesn't have enough space/memory or your program is trying to write in a file that is read only.

1 answer

an alternative would be to try

samtools fastq

the bedtools bamtofastq also recommends that:

If you want to create a single, interleaved FASTQ file for paired-end data, you can just write both to /dev/stdout:

   bedtools bamtofastq -i x.bam -fq /dev/stdout -fq2 /dev/stdout > x.ilv.fq

Also, the samtools fastq command has more fucntionality and is a useful alternative.

Log in to answer this question.