Open TinaYibingChen opened 5 months ago
Hi, can you confirm where you typed this command - in python or in shell? Providing a screenshot would be helpful.
Here are the screenshots, thanks!
could you try this within a shell - which should provide more information
Sure! I try that line in a shell.
The following line shows that the build = hg19 was not well-received, could you try it again with the correct input arguments?
I have tried other builds (hg38) in your example code but encountered the same error. Could you please provide more details about what the correct input arguments should be? Thank you very much!
the input commands are correct - but could you again put these commands in a terminal so we can have the complete error message?
Yes, this is the complete error message in my terminal.
Hi @TinaYibingChen
It looks like it is trying to download plink2 (https://www.cog-genomics.org/plink/2.0/) but could not access the link.
Alternatively, you can download the plink2 manually and add the binary file to the $PATH (you can check that plink2 is in $PATH by typing plink2
in the command line). Feel free to let me know if you have further questions.
Hi @KangchengHou
Thank you so much for your instructions! I successfully downloaded the plink2 (PLINK v2.00a6 M1 (9 Jun 2024)) and added the binary file to the $PATH. But I got this when I had the same input before and typed admix get-1kg-ref --dir ${REF_DATA_DIR} --build ${BUILD}
Hi, I have a follow-up question about how to use HAPGEN2 on a Macbook. Thank you for taking the time to look at it.
This is what I tried to duplicate. I got the error below.
(base) apple@ChendeMacBook-Air admix-kit % for pop in CEU YRI; do
admix hapgen2 \
--pfile ${RAW_DATA_DIR}/${pop} \
--chrom ${CHROM} \
--n-indiv ${N_INDIV} \
--out ${GENO_DATA_DIR}/${pop} \
--build ${BUILD}
done
2024-06-24 16:51:50 [info ] Received parameters:
hapgen2
--pfile=data/raw/CEU
--n_indiv=100000
--out=data/geno/CEU
--build=hg38
--chrom=22
PLINK v2.00a6 AVX2 (9 Jun 2024) www.cog-genomics.org/plink/2.0/
(C) 2005-2024 Shaun Purcell, Christopher Chang GNU General Public License v3
Logging to data/geno/CEU.hapgen2tmpdata/hapgen2_data.log.
Options in effect:
--chr 22
--export hapslegend
--out data/geno/CEU.hapgen2tmpdata/hapgen2_data
--pfile data/raw/CEU
Start time: Mon Jun 24 16:51:50 2024
16384 MiB RAM detected; reserving 8192 MiB for main workspace.
Using up to 8 compute threads.
179 samples (92 females, 87 males; 122 founders) loaded from data/raw/CEU.psam.
15346 variants loaded from data/raw/CEU.pvar.
2 categorical phenotypes loaded.
Writing data/geno/CEU.hapgen2tmpdata/hapgen2_data.legend ... done.
Writing data/geno/CEU.hapgen2tmpdata/hapgen2_data.haps ... done.
Writing data/geno/CEU.hapgen2tmpdata/hapgen2_data.sample ... done.
End time: Mon Jun 24 16:51:50 2024
2024-06-24 16:51:50 [info ] genetic_map found at /opt/anaconda3/lib/python3.11/site-packages/admix/../.admix_cache/data/genetic_map/genetic_map_hg38_withX.txt.gz.
Traceback (most recent call last):
File "/opt/anaconda3/bin/admix", line 8, in
Start time: Mon Jun 24 16:51:56 2024
16384 MiB RAM detected; reserving 8192 MiB for main workspace.
Using up to 8 compute threads.
178 samples (81 females, 97 males; 120 founders) loaded from data/raw/YRI.psam.
15346 variants loaded from data/raw/YRI.pvar.
2 categorical phenotypes loaded.
Writing data/geno/YRI.hapgen2tmpdata/hapgen2_data.legend ... done.
Writing data/geno/YRI.hapgen2tmpdata/hapgen2_data.haps ... done.
Writing data/geno/YRI.hapgen2tmpdata/hapgen2_data.sample ... done.
End time: Mon Jun 24 16:51:56 2024
2024-06-24 16:51:56 [info ] genetic_map found at /opt/anaconda3/lib/python3.11/site-packages/admix/../.admix_cache/data/genetic_map/genetic_map_hg38_withX.txt.gz.
Traceback (most recent call last):
File "/opt/anaconda3/bin/admix", line 8, in
Describe the bug Hi, I downloaded the package and tried to copy the simulation example code. After the setup step (in the prepare source data section), it ran into an error. admix get-1kg-ref --dir ${REF_DATA_DIR} --build ${BUILD}. I would like to know if I need to download anything or provide more information rather than copy and paste. Thank you very much!
To Reproduce
BUILD=hg19 N_INDIV=100000 CHROM=22 N_GEN=8
REF_DATA_DIR=data/1kg-ref-${BUILD} RAW_DATA_DIR=data/raw GENO_DATA_DIR=data/geno mkdir -p ${RAW_DATA_DIR} mkdir -p ${GENO_DATA_DIR} admix get-1kg-ref --dir ${REF_DATA_DIR} --build ${BUILD}
Error Message CalledProcessError: Command 'b'# genome build to use\nBUILD=hg19\n# number of admixed individuals to simulate\nN_INDIV=100000\n# chromosome \nCHROM=22\n# number of generations\nN_GEN=8\n\n# setup\nREF_DATA_DIR=data/1kg-ref-${BUILD}\nRAW_DATA_DIR=data/raw\nGENO_DATA_DIR=data/geno\nmkdir -p ${RAW_DATA_DIR}\nmkdir -p ${GENO_DATA_DIR}\n\n# Create the necessary directories if they do not already exist\nmkdir -p ${RAW_DATA_DIR}\nmkdir -p ${GENO_DATA_DIR}\n\nadmix get-1kg-ref --dir ${REF_DATA_DIR} --build ${BUILD}\n\n'' returned non-zero exit status 1.