plink2 cannot identify options when looping the chromosomes
1
0
Entering edit mode
3 months ago

I want to loop the quality check of all 23 chromosomes, Below is my code:

for chr in {1..22};
do
 plink2 \
  --bed /mnt/stsi/stsi3/External/UKBB/genomic_data/geneotypes/chr$chr/*.bed \
  --bim /mnt/stsi/stsi3/External/UKBB/genomic_data/geneotypes/chr$chr/*.bim \
  --fam /mnt/stsi/stsi3/External/UKBB/genomic_data/geneotypes/chr$chr/*.fam \
  --maf 0.01 --mac 100 --geno 0.01 --hwe 1e-15 \
  --mind 0.1 \
  --indep-pairwise 1000 100 0.9 \
  --exclude regions.exclude \
  --threads 16 \
  --memory 91260 \
  --write-snplist --write-samples --no-id-header \
  --out qc_pass_$chr

done

However, the output files is not named by the prefix specified in --out, it is still using the default name. Besides that , the options of--memory 91260 and --write-snplist --write-samples --no-id-header also wasn't effective. The .log file looks like below, clearly not all the options were running.

PLINK v2.00a3LM 64-bit Intel (20 Apr 2021)     www.cog-genomics.org/plink/2.0/
(C) 2005-2021 Shaun Purcell, Christopher Chang   GNU General Public License v3
Logging to plink2.log.
Options in effect:
  --exclude regions.exclude
  --geno 0.01
  --hwe 1e-15
  --indep-pairwise 1000 100 0.9
  --mac 100
  --maf 0.01
  --mind 0.1
  --pgen /mnt/stsi/stsi3/External/UKBB/genomic_data/geneotypes/chr1/ukb_cal_chr1_v2.bed
  --psam /mnt/stsi/stsi3/External/UKBB/genomic_data/geneotypes/chr1/ukb41999_cal_chr1_v2_s488264.fam
  --pvar /mnt/stsi/stsi3/External/UKBB/genomic_data/geneotypes/chr1/ukb_snp_chr1_v2.bim
  --threads 16

Does anyone have the same issue before? I'm grateful for your advice

plink2 plink • 237 views
ADD COMMENT
1
Entering edit mode

add echo before plink and show us the output

for chr in {1..22};
do
 echo plink2 (...)
ADD REPLY
0
Entering edit mode

Thank you! I figured out that I got extra space ...

ADD REPLY
2
Entering edit mode
3 months ago
Sam ★ 3.8k

Check your script file right after --threads 16 and see if there's a white space behind \

ADD COMMENT
0
Entering edit mode

You are right the problem is extra space! Thank you so much!!

ADD REPLY

Login before adding your answer.

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