Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

samtools markdup: error, no ms score tag #598

Open
lusacristan opened this issue Sep 18, 2024 · 5 comments
Open

samtools markdup: error, no ms score tag #598

lusacristan opened this issue Sep 18, 2024 · 5 comments

Comments

@lusacristan
Copy link

Hello!
I'm trying to run this:

snippy --outdir GPSC33 --R1 ERR3261191_1.fastq.gz --R2 ERR3261191_2.fastq.gz --ref Reference_sequence_GPSC33.fa

but I got this error:

`### samtools faidx reference/ref.fa

bwa index reference/ref.fa

[bwa_index] Pack FASTA... 0.01 sec
[bwa_index] Construct BWT for the packed sequence...
[bwa_index] 0.31 seconds elapse.
[bwa_index] Update BWT... 0.01 sec
[bwa_index] Pack forward-only FASTA... 0.01 sec
[bwa_index] Construct SA from BWT and Occ... 0.16 sec
[main] Version: 0.7.18-r1243-dirty
[main] CMD: bwa index reference/ref.fa
[main] Real time: 0.569 sec; CPU: 0.501 sec

mkdir -p reference/genomes && cp -f reference/ref.fa reference/genomes/ref.fa

ln -sf reference/ref.fa .

ln -sf reference/ref.fa.fai .

mkdir -p reference/ref && gzip -c reference/ref.gff > reference/ref/genes.gff.gz

bwa mem -Y -M -R '@rg\tID:GPSC33_folder\tSM:GPSC33_folder' -t 4 reference/ref.fa /hpcfs/home/ciencias_biologicas/lf.sacristan2215/CABANA/vigilancia/Module_12/ERR2667737_1.fastq.gz /hpcfs/home/ciencias_biologicas/lf.sacristan2215/CABANA/vigilancia/Module_12/ERR2667737_2.fastq.gz | samclip --max 10 --ref reference/ref.fa.fai | samtools sort -n -l 0 -T /tmp --threads 1 -m 8000M | samtools fixmate -m --threads 1 - - | samtools sort -l 0 -T /tmp --threads 1 -m 8000M | samtools markdup -T /tmp --threads 1 -r -s - - > snps.bam

samtools markdup: error, no ms score tag. Please run samtools fixmate on file first.

samtools markdup: error, no ms score tag. Please run samtools fixmate on file first.
`

I've tried it several times with different files but the error is the same.

@pmagwene
Copy link

pmagwene commented Oct 2, 2024

I'm seeing this error as well. I'm installing snippy through a CONDA env (via Snakemake).

I notice samtools had a recent release (1.21; https://github.com/samtools/samtools/releases). Among the changes in the release notes is the following:

samtools fixmate no longer removes the PAIRED flag from reads that have no mate. This is done on the understanding that the PAIRED flag is a sequencing technology indicator not a feature of alignment. This is a change to previous fixmate behaviour. (PR samtools/samtools#2056, fixes samtools/samtools#2052. Reported by John Wiedenhoeft)

I'm wondering if this change, or something related is the cause of the fixmate errors that Snippy is throwing. I'll try running with previous version of Samtools and report back.

UPDATE: I can confirm that re-running snippy with samtools v1.20 fixes the issue listed above. If installing samtools and snippy through conda the easiest is to pin the samtools version.

@pdimens
Copy link

pdimens commented Oct 9, 2024

I can confirm this behavior with v1.21 as well. Whatever ms tag markdup requires is no longer being created, even when using the -m argument to add a mate score tag.

@indexofire
Copy link

first of all, I recommend you install 1.17 version of samtools and bcftools. And I got the similar problem in my new installation. Check the result if you run:

bcftools view --include 'FMT/GT="1/1" && QUAL>=100 && FMT/DP>=10 && (FMT/AO)/(FMT/DP)>=0' snps.raw.vcf  | vt normalize -r reference/ref.fa -

which return error, then make sure your vt version is 2015.11.10=h5ef6573_4. if not,

mamba install vt=2015.11.10=he941832_3

@pmenzel
Copy link

pmenzel commented Oct 24, 2024

as a workaround, the bioconda recipe for snippy is now updated to restrict samtools to version 1.20. (bioconda/bioconda-recipes#51628)

@been9312
Copy link

been9312 commented Nov 8, 2024

I got the same error when using binary file after installing snippy with git clone, and no error when installing snippy with conda. The version of samtools I used is 1.21.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants