Convert Bam to Fastq
0
0
Entering edit mode
17 months ago
وفاء • 0

Hi All,

Using this command line, I converted two Paired bam files:

samtools fastq -1 ${sampleID}.sorted_1.fastq -2 ${sampleID}.sorted_2.fastq ${sampleID}.sorted.bam

1st File: Bam 8.4G Fastq1 8.1G and fastq2 8.1G were produced.

Fastq1 494M and fastq2 494M were made by Bam 1.8G.

Then I use the nf-core nextflow RNA seq pipeline in the cluster, which results in the following error:

Error: r2-scr unexpectedly ended before r1-src 
caused by:
unexpected end of file.

Q1: Is the fastq's size appropriate?

Q2: What is the appropriate size for fastq derived from bam?

Q3: How can I fix the problem?

Fastq Bam • 809 views
ADD COMMENT
1
Entering edit mode

Did you name sort (or samtools collate) your BAM file before converting to fastq. This is required.

File sizes is a poor metric for any analysis except if they are empty or not (other than to determine that some result was produced). That said the files in your case appear to be corrupt and may need to be regenerated.

ADD REPLY
0
Entering edit mode

I started by sorting the bam with this command: samtools sort ${sampleID}.bam -o ${sampleID}.sorted.bam

ADD REPLY
1
Entering edit mode

You need to samtools sort -n ${sampleID}.bam -o ${sampleID}.sorted.bam. This brings paired-end reads next to each other in the sorted BAM file.

ADD REPLY

Login before adding your answer.

Traffic: 1759 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6