WarrenLab / hic-scaffolding-nf

Nextflow pipeline for scaffolding genome assemblies with Hi-C reads
MIT License
12 stars 3 forks source link

Is `samtools view -bh` necessary or just `samtool sort` #6

Open spoonbender76 opened 6 months ago

spoonbender76 commented 6 months ago

Hi,

Thank you for creating this pipeline.

I have a small question about samtools view -bh aligned.sam | samtools sort -n > aligned.bam in CHROMAP_ALIGN process. According to samtools manual, samtools sort can take .sam as input. Is samtools view -bh necessary? Will this command samtools sort -n aligned.sam > aligned.bam give the exact same output? Since it can save some time for me (30 min with samtools view -bh vs 13 min samtool sort only).

esrice commented 6 months ago

After looking at the samtools sort docs, yes, it does look like it can take sam as input and still output bam, so skipping the samtools view command should in theory work just fine. I don't have time to change and test that right now, but feel free to submit a pull request with the change and I'll test it out and review after the holidays. And thanks for the idea!