Attempting to generate a sam file that can be converted to a bam file using samtools.
1
0
Entering edit mode
3 months ago

Hi! As the title says I have been trying to generate a bam file using a sam file generated from minimap2. Here is the script I am using to generated the SAM file.

  #Variables
export ASSEMBLY=PATH/BC01_racon3.fasta
export PFX=BC01_BLOB
export READS=PATH/barcode01_trimmed100.fastq

#Commands
PATH/minimap2 -t $SLURM_NTASKS $ASSEMBLY $READS > ${PFX}.sam

Once this file is generated I attempt to use the following:

samtools view -b BC01_BLOB.sam > BC01_BLOB.bam

And I recieve the following error:

[E::sam_parse1] missing SAM header
[W::sam_read1] parse error at line 1
[main_samview] truncated file.

Any help would be greatly appreciated! I just started working in bash recently so I really don't have much experience. I am trying to get a bam file for blobtools.

minimap2 samtools • 348 views
ADD COMMENT
3
Entering edit mode
3 months ago
GenoMax 142k

You need to add -a option to create SAM format files to your minimap2 command. By default minimap2 makes PAF format data.

ADD COMMENT
0
Entering edit mode

I think the conversion is running now without issue, Thank you so much!

ADD REPLY
0
Entering edit mode

Great. You can accept the answer (green check mark) to provide closure to this thread.

ADD REPLY

Login before adding your answer.

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