Pedro Sanchez
04/16/2026, 7:54 PMpicard and samtools
I am trying to upgrade a lab-inherited, half-constucted workflow. It originally runs:
bwa mem -C -M -t {params.threads} -H {input.sam_header} {params.tmp_ref} {input.fastq1} {input.fastq2} > {params.tmp_sam}
samtools view -@ {params.threads} -S -b {params.tmp_sam} > {params.tmp_bam}
samtools view -@ {params.threads} -bh -q 30 -F 4 -F 8 -F 0X0100 {params.tmp_bam} > {output}
picard FixMateInformation -Xmx4g -Djava.io.tmpdir=tmp I={output} O={output2} SORT_ORDER=coordinate
would samtools fixmate + sort create the same output? AFAIK, picard FixMateInformation adds MC, recomputes UQ and MQ, but only the first is added by samtools fixmate -m. Would that be problematic in following steps of a DNA-seq pipeline (e.g. GATK)?
bwa mem -C -M -t {params.threads} -H {input.sam_header} {params.ref} {input.fastq1} {input.fastq2} \
| samtools view -@ {params.threads2} -bh -q 30 -F 4 -F 8 -F 0X0100 \
| samtools fixmate -@ {params.threads2} -m - - \
| samtools sort -@ {params.threads2} -m 8G -o {output}
Thanks a lot!!Thomas Danhorn
04/18/2026, 6:04 AMUQ, so I'am pretty sure that is not required. MC and MQ are there, but since they are just "helpful" but redundant (you can look at the mate to get that information), I would hope that GATK does not actually require them. (AFAIK, GATK does not require a specific mapper, so it should not expect any but the most basic SAM tags.)
The definitive proof is of course to just try out your proposed tool chain and see if the downstream processes work with it. Don't know if your workflow provides that option, but with #CGFUX04HZ you can use the --step parameter to provide BAMs/CRAMs at any of the processing steps, so you could make a test file and feed it to the pipeline to see if it would work. 🤞
But unless your workflow can do something that #CGFUX04HZ can't do, I would just use the curated, community-supported pipeline ...Pedro Sanchez
04/18/2026, 5:11 PMThomas Danhorn
04/18/2026, 6:21 PMPedro Sanchez
04/20/2026, 11:34 AMThomas Danhorn
04/21/2026, 4:01 AM