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

Different parameters on different chromosomes #2327

Open
JJ0ONATHANESTAR opened this issue Dec 1, 2024 · 1 comment
Open

Different parameters on different chromosomes #2327

JJ0ONATHANESTAR opened this issue Dec 1, 2024 · 1 comment

Comments

@JJ0ONATHANESTAR
Copy link

Hi, I have a problem with filtering with bcftools.
I have total 26 chromosomes (1 ~ 25, MT)
And I want to filter them with different parameters, FMT/DP.

My code was like:
bcftools filter -e '((CHROM=="MT") && (FMT/DP<10 || FMT/DP>790)) || ((CHROM!="MT") && (FMT/DP<10 || FMT/DP>70)) || F_MISSING>0.1 || MIN(FMT/GQ)<10 || QUAL<30 || AC==0 || AC==AN' \ $INDIR/merged_with_outgroup.raw.vcf.gz | bcftools view -m2 -M2 -v snps -O z -o $OUTDIR/merged_with_outgroup.final.filtered.vcf.gz bcftools view $OUTDIR/merged_with_outgroup.final.filtered.vcf.gz | grep -c -v "^#"

MT chromosome was filtered well, but others were filtered with MT chromosome parameter(10-790).
How do i modify this?

I heard that --chr option is for only extracting specific chromosomes in vcf file.

@pd3
Copy link
Member

pd3 commented Dec 3, 2024

If you think it is a bug, please provide a small test case which makes you believe that. Otherwise I'd look for errors in the logic of the boolean expression or in your assumptions. Specifically, are you sure it is not another part of the expression which breaks the filtering?

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

No branches or pull requests

2 participants