From a86c0d01105119856a1e16d4bd2281230ec5e154 Mon Sep 17 00:00:00 2001 From: Lea Waller Date: Tue, 28 Nov 2023 18:26:01 +0100 Subject: [PATCH] Fix mds csv file creation if it already exists Do not append but overwrite the file if it already exists --- bin/enigma-mds | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/bin/enigma-mds b/bin/enigma-mds index 28fbc34..5765408 100755 --- a/bin/enigma-mds +++ b/bin/enigma-mds @@ -86,7 +86,6 @@ run_cmd plink --bfile "${REFERENCE}" --extract "local.snplist.txt" --make-bed -- run_cmd plink --bfile "local" --bmerge "external.bed" "external.bim" "external.fam" --make-bed --noweb --out "merge" if [ -f "merge-merge.missnp" ]; then - run_cmd plink --bfile "local" --flip "merge-merge.missnp" --make-bed --noweb --out "flipped" run_cmd mv "merge-merge.missnp" "merge-merge.flipped.missnp" @@ -94,16 +93,12 @@ if [ -f "merge-merge.missnp" ]; then fi if [ -f "merge-merge.missnp" ]; then - run_cmd plink --bfile "flipped" --exclude "merge-merge.missnp" --make-bed --noweb --out "no-missnp" - run_cmd plink --bfile "no-missnp" --bmerge "external.bed" "external.bim" "external.fam" --make-bed --noweb --out "merge" - fi run_cmd plink --bfile "merge" --cluster --mind "0.05" --mds-plot "4" --extract "local.snplist.txt" --noweb --out "HM3_b37mds" - -run_cmd "awk 'BEGIN{OFS=\",\"}; {print \$1, \$2, \$3, \$4, \$5, \$6, \$7}' HM3_b37mds.mds >> HM3_b37mds2R.mds.csv" +run_cmd "awk 'BEGIN{OFS=\",\"}; {print \$1, \$2, \$3, \$4, \$5, \$6, \$7}' HM3_b37mds.mds > HM3_b37mds2R.mds.csv" run_cmd "Rscript - <