Parsing error in sam file when converting to bam
1
0
Entering edit mode
16 hours ago

I am working with single-cell sequencing files and am getting stuck when converting sam to bam. Any help is sincerely appreciated:

This is my initial cutadapt command:

cutadapt -a CTGTCTCTTATACACATCT -A CTGTCTCTTATACACATCT --interleaved --cores=16 -o project/outs/fastq_path/project/PTO035/PTO035_1.fastq.gz -p project/outs/fastq_path/project/PTO035/PTO035_2.fastq.gz project/outs/fastq_path/project/PTO035/PTO035_S1_L001_R1_001.fastq.gz project/outs/fastq_path/project/PTO035/PTO035_S1_L001_R2_001.fastq.gz

This is my command for converting to sam:

bwa mem -C -M -t 16 genome.fa <(zcat project/outs/fastq_path/project/PTO035/PTO035_1.fastq.gz) <(zcat project/outs/fastq_path/project/PTO035/PTO035_2.fastq.gz) > aln_pe3.sam 

When using this command to convert to bam, I get an error:

samtools view -Sb aln_pe3.sam > aln_pe3.bam

Error:

[W::sam_read1_sam] Parse error at line 196
samtools view: error reading file "aln_pe3.sam"

If it helps, this is what line 196 looks like: 
SRR23292069.1   99  chr10   68742898    60  101M    =   68742899    102 GTGAGACACTGCGCCTGGCCAGTGTAGCTATGATTTTCTTTCCTTTTTTATTTGAGACAGAGCCTCACTCGGTTGCCAAGGCTGGAGTGCAGTGGCGTGAT   ?????????????????????????????????????????????????????????????????????????????????????????????????????   NM:i:0  MD:Z:101    MC:Z:101M   AS:i:101    XS:i:37 A00521:358:HWTVNDSX3:1:1101:1669:1000/1
samtools bwa fastq bam sam • 127 views
ADD COMMENT
0
Entering edit mode

There is no need for this process substitution zcat thing, bwa can read gzipped files.

ADD REPLY
1
Entering edit mode
10 hours ago

Have you already tried running the command like this ?

bwa mem -C -M -t 16 genome.fa project/outs/fastq_path/project/PTO035/PTO035_1.fastq.gz project/outs/fastq_path/project/PTO035/PTO035_2.fastq.gz > aln_pe3.sam

Is there a reason to use zcat when bwa can work on compressed fq file ?

ADD COMMENT

Login before adding your answer.

Traffic: 3597 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