Mercurial > repos > iuc > king
annotate 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 |
| rev | line source |
|---|---|
|
1
1932808c6fab
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/king/ commit 1c50106137c5b3260f18864ac9084056fa91ec80"
iuc
parents:
diff
changeset
|
1 binary_file=ex.bed |
|
1932808c6fab
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/king/ commit 1c50106137c5b3260f18864ac9084056fa91ec80"
iuc
parents:
diff
changeset
|
2 target_markers=6000 |
|
1932808c6fab
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/king/ commit 1c50106137c5b3260f18864ac9084056fa91ec80"
iuc
parents:
diff
changeset
|
3 target_cols=$(( 6 + ( $target_markers * 2 ))) |
|
1932808c6fab
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/king/ commit 1c50106137c5b3260f18864ac9084056fa91ec80"
iuc
parents:
diff
changeset
|
4 |
|
1932808c6fab
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/king/ commit 1c50106137c5b3260f18864ac9084056fa91ec80"
iuc
parents:
diff
changeset
|
5 dec_prefix=out |
|
1932808c6fab
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/king/ commit 1c50106137c5b3260f18864ac9084056fa91ec80"
iuc
parents:
diff
changeset
|
6 subs_prefix=sub |
|
1932808c6fab
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/king/ commit 1c50106137c5b3260f18864ac9084056fa91ec80"
iuc
parents:
diff
changeset
|
7 new_prefix="new."${target_markers} |
|
1932808c6fab
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/king/ commit 1c50106137c5b3260f18864ac9084056fa91ec80"
iuc
parents:
diff
changeset
|
8 |
|
1932808c6fab
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/king/ commit 1c50106137c5b3260f18864ac9084056fa91ec80"
iuc
parents:
diff
changeset
|
9 ##conda activate plink |
|
1932808c6fab
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/king/ commit 1c50106137c5b3260f18864ac9084056fa91ec80"
iuc
parents:
diff
changeset
|
10 ## Extract binary file into new map, ped, and fam files |
|
1932808c6fab
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/king/ commit 1c50106137c5b3260f18864ac9084056fa91ec80"
iuc
parents:
diff
changeset
|
11 plink --bfile $(basename $binary_file .bed) --recode --out ${dec_prefix} |
|
1932808c6fab
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/king/ commit 1c50106137c5b3260f18864ac9084056fa91ec80"
iuc
parents:
diff
changeset
|
12 |
|
1932808c6fab
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/king/ commit 1c50106137c5b3260f18864ac9084056fa91ec80"
iuc
parents:
diff
changeset
|
13 ## Subset ped and map |
|
1932808c6fab
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/king/ commit 1c50106137c5b3260f18864ac9084056fa91ec80"
iuc
parents:
diff
changeset
|
14 cat ${dec_prefix}.ped | cut -d' ' -f 1-${target_cols} > ${subs_prefix}.ped |
|
1932808c6fab
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/king/ commit 1c50106137c5b3260f18864ac9084056fa91ec80"
iuc
parents:
diff
changeset
|
15 head ${dec_prefix}.map -n ${target_markers} > ${subs_prefix}.map |
|
1932808c6fab
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/king/ commit 1c50106137c5b3260f18864ac9084056fa91ec80"
iuc
parents:
diff
changeset
|
16 |
|
1932808c6fab
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/king/ commit 1c50106137c5b3260f18864ac9084056fa91ec80"
iuc
parents:
diff
changeset
|
17 ## Recode into new |
|
1932808c6fab
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/king/ commit 1c50106137c5b3260f18864ac9084056fa91ec80"
iuc
parents:
diff
changeset
|
18 plink --file ${subs_prefix} --out ${new_prefix} |
|
1932808c6fab
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/king/ commit 1c50106137c5b3260f18864ac9084056fa91ec80"
iuc
parents:
diff
changeset
|
19 echo ${new_prefix}* |
|
1932808c6fab
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/king/ commit 1c50106137c5b3260f18864ac9084056fa91ec80"
iuc
parents:
diff
changeset
|
20 ##conda deactivate |
