Skip to content

Commit

Permalink
fixed 00a
Browse files Browse the repository at this point in the history
  • Loading branch information
explodecomputer committed Nov 27, 2024
1 parent 81e3ba3 commit 3f16856
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
11 changes: 8 additions & 3 deletions 00a-genotype-organisation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ Rscript resources/genotypes/organise_samples.r ${genotype_input_list} ${genotype


echo "Get list of pruned SNPs"
if test -f "resources/genotypes/hm3_prune_th_${build}.bed.gz"; then
if test -f "resources/genotypes/hm3_prune_th_${genome_build}.bed.gz"; then
echo "Found prune file"
prunefile="${genotype_processed_dir}/scratch/indep.prune.in"
gunzip -c resources/genotypes/hm3_prune_th_${build}.bed.gz > ${prunefile}
gunzip -c resources/genotypes/hm3_prune_th_${genome_build}.bed.gz > ${prunefile}
else
echo "Error: Prune file resources/genotypes/hm3_prune_th_${build}.bed.gz not found"
echo "Error: Prune file resources/genotypes/hm3_prune_th_${genome_build}.bed.gz not found"
exit 1
fi

Expand Down Expand Up @@ -84,8 +84,13 @@ do
--out ${genotype_processed_dir}/bgen_extract/$(basename ${bgen} .bgen) \
--threads ${env_threads}
echo "${genotype_processed_dir}/bgen_extract/$(basename ${bgen} .bgen)" >> ${genotype_processed_dir}/bgen_extract/mergelist

# rename any duplicates to be unique
Rscript resources/genotypes/dups_bim.r "${genotype_processed_dir}/bgen_extract/$(basename ${bgen} .bgen).bim"
done



./bin/plink2 \
--threads ${env_threads} \
--pmerge-list bfile ${genotype_processed_dir}/bgen_extract/mergelist \
Expand Down
6 changes: 6 additions & 0 deletions resources/genotypes/dups_bim.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
library(data.table)
library(dplyr)

a <- fread(commandArgs(T)[1])
a$V2 <- make.unique(a$V2)
fwrite(a, commandArgs(T)[1], col.names = F, row.names = F, quote = F, sep = "\t")

0 comments on commit 3f16856

Please sign in to comment.