I am trying to use BWA mem to align pair-end reads to a single genome and pipe the sam file output to a bam and then a bedfile. The pipeline doesn't seem to be working.
It creates the output sam, bam and bed files but the bam and bed files are empty. It completes the alignment but an error message keeps appearing: Failed to open BAM file stdin.
Here is the code I am using:
I am new to coding so any help would be appreciated.
It creates the output sam, bam and bed files but the bam and bed files are empty. It completes the alignment but an error message keeps appearing: Failed to open BAM file stdin.
Here is the code I am using:
Code:
bwa mem NC_005148.fa ./seqtk_1/subsample_1/sub_NC_005148_1.fq ./seqtk_1/subsample_1/sub_NC_005148_2.fq > NC_005148_BWA.sam | \ samtools view -S -h -u - | \ samtools sort - | \ samtools rmdup -s - | \ tee NC_005148_BWA_sorted.bam | \ bamToBed > NC_005148_BWA_sorted.bed
Comment