diff test-data/subset_bed.sh @ 1:1932808c6fab draft default tip

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/king/ commit 1c50106137c5b3260f18864ac9084056fa91ec80"
author iuc
date Mon, 18 Apr 2022 18:04:56 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/subset_bed.sh	Mon Apr 18 18:04:56 2022 +0000
@@ -0,0 +1,20 @@
+binary_file=ex.bed
+target_markers=6000
+target_cols=$(( 6 + ( $target_markers * 2 )))
+
+dec_prefix=out
+subs_prefix=sub
+new_prefix="new."${target_markers}
+
+##conda activate plink
+## Extract binary file into new map, ped, and fam files
+plink --bfile $(basename $binary_file .bed) --recode --out ${dec_prefix}
+
+## Subset ped and map
+cat ${dec_prefix}.ped | cut -d' ' -f 1-${target_cols} > ${subs_prefix}.ped
+head ${dec_prefix}.map -n ${target_markers} > ${subs_prefix}.map
+
+## Recode into new
+plink --file ${subs_prefix} --out ${new_prefix}
+echo ${new_prefix}*
+##conda deactivate