From 70f1a29ce97be92b811256c3b256879f9113ab32 Mon Sep 17 00:00:00 2001 From: ljacquin Date: Wed, 17 Apr 2024 14:25:55 +0200 Subject: [PATCH] update: format .sh scripts --- clean_scans.sh | 2 +- get_results_scans.sh | 36 ++++++++++++++--------------- khamix.sh | 34 +++++++++++++-------------- make_scripts_programs_executable.sh | 2 +- programs/scan_chromo_num_k.sh | 16 ++++++------- 5 files changed, 45 insertions(+), 45 deletions(-) diff --git a/clean_scans.sh b/clean_scans.sh index 57e899e..5fe1899 100755 --- a/clean_scans.sh +++ b/clean_scans.sh @@ -6,6 +6,6 @@ rm -r genome_scan_chromo_num* rm -r results_genome_scan rm data_parameters/kernel_index.txt rm data_parameters/nb_snp_hap.txt -rm data_parameters/nb_chromosomes.txt +rm data_parameters/nb_chromosomes.txt rm data_parameters/trait_name.txt rm data_parameters/signif_level.txt diff --git a/get_results_scans.sh b/get_results_scans.sh index 269a753..ef5a9e6 100755 --- a/get_results_scans.sh +++ b/get_results_scans.sh @@ -11,8 +11,8 @@ if [ ! -d results_genome_scan ]; then fi cd data_parameters/ -nb_chromosomes=$(cat "nb_chromosomes.txt") -nb_snp_hap=$(cat "nb_snp_hap.txt") +nb_chromosomes=$(cat "nb_chromosomes.txt") +nb_snp_hap=$(cat "nb_snp_hap.txt") kernel_index=$(cat "kernel_index.txt") modify_signif_level=false # true or false (note lower case) @@ -33,7 +33,7 @@ cp physical_map.txt ../results_genome_scan cp phased_genotypes.txt ../results_genome_scan cp kernel_index.txt ../results_genome_scan cp signif_level.txt ../results_genome_scan - + cd ../programs/ cp get_results_scans.R ../results_genome_scan cp plot_nb_hap_scans.R ../results_genome_scan @@ -62,19 +62,19 @@ if [ "$kernel_index" -gt 1 ] ; then if [ "$nb_snp_hap" -gt 1 ] ; then for chromo_num_k in $(seq $nb_chromosomes -1 1) - do + do if [ -d results_chromo_num_$chromo_num_k ]; then rm -rf results_chromo_num_$chromo_num_k/* else mkdir results_chromo_num_$chromo_num_k - fi + fi mv flanking_markers_of_tested_positions_in_kb_with_rlrt_value_on_chromosome_$chromo_num_k* results_chromo_num_$chromo_num_k - mv flanking_markers_of_tested_positions_in_kb_with_significant_rlrt_value_on_chromosome_$chromo_num_k* results_chromo_num_$chromo_num_k + mv flanking_markers_of_tested_positions_in_kb_with_significant_rlrt_value_on_chromosome_$chromo_num_k* results_chromo_num_$chromo_num_k if ls significant_haplotypes_chromo_num_$chromo_num_k* 1> /dev/null 2>&1; then mv significant_haplotypes_chromo_num_$chromo_num_k* results_chromo_num_$chromo_num_k fi - mv vect_rlrt_value_chromo_num_$chromo_num_k* results_chromo_num_$chromo_num_k - mv vect_nb_hap_window_chromo_num_$chromo_num_k* results_chromo_num_$chromo_num_k + mv vect_rlrt_value_chromo_num_$chromo_num_k* results_chromo_num_$chromo_num_k + mv vect_nb_hap_window_chromo_num_$chromo_num_k* results_chromo_num_$chromo_num_k mv number_of_haplotypes_per_window_for_chromosome_$chromo_num_k* results_chromo_num_$chromo_num_k mv kernelized_haplotype_based_genome_scan_of_chromosome_$chromo_num_k* results_chromo_num_$chromo_num_k done @@ -87,7 +87,7 @@ if [ "$kernel_index" -gt 1 ] ; then mv number_of_haplotypes_per_window_for_complete_genome_scan* results_all_chromosomes mv kernelized_haplotype_based_genome_scan_for_* results_all_chromosomes mv flanking_markers_of_tested_positions_with_statistics* results_all_chromosomes - + else for chromo_num_k in $(seq $nb_chromosomes -1 1) @@ -102,7 +102,7 @@ if [ "$kernel_index" -gt 1 ] ; then if ls significant_snps_chromo_num_$chromo_num_k* 1> /dev/null 2>&1; then mv significant_snps_chromo_num_$chromo_num_k* results_chromo_num_$chromo_num_k fi - mv vect_rlrt_value_chromo_num_$chromo_num_k* results_chromo_num_$chromo_num_k + mv vect_rlrt_value_chromo_num_$chromo_num_k* results_chromo_num_$chromo_num_k mv kernelized_gwas_of_chromosome_$chromo_num_k* results_chromo_num_$chromo_num_k done @@ -110,7 +110,7 @@ if [ "$kernel_index" -gt 1 ] ; then rm -rf results_all_chromosomes/* else mkdir results_all_chromosomes - fi + fi mv kernelized_gwas_for_* results_all_chromosomes mv markers_of_tested_positions_with_statistics.txt* results_all_chromosomes rm vect_nb_hap_window_chromo_num_* @@ -118,7 +118,7 @@ if [ "$kernel_index" -gt 1 ] ; then fi else - + if [ "$nb_snp_hap" -gt 1 ] ; then for chromo_num_k in $(seq $nb_chromosomes -1 1) @@ -133,8 +133,8 @@ if [ "$kernel_index" -gt 1 ] ; then if ls significant_haplotypes_chromo_num_$chromo_num_k* 1> /dev/null 2>&1; then mv significant_haplotypes_chromo_num_$chromo_num_k* results_chromo_num_$chromo_num_k fi - mv vect_rlrt_value_chromo_num_$chromo_num_k* results_chromo_num_$chromo_num_k - mv vect_nb_hap_window_chromo_num_$chromo_num_k* results_chromo_num_$chromo_num_k + mv vect_rlrt_value_chromo_num_$chromo_num_k* results_chromo_num_$chromo_num_k + mv vect_nb_hap_window_chromo_num_$chromo_num_k* results_chromo_num_$chromo_num_k mv number_of_haplotypes_per_window_for_chromosome_$chromo_num_k* results_chromo_num_$chromo_num_k mv haplotype_based_genome_scan_of_chromosome_$chromo_num_k* results_chromo_num_$chromo_num_k done @@ -162,7 +162,7 @@ if [ "$kernel_index" -gt 1 ] ; then if ls significant_snps_chromo_num_$chromo_num_k* 1> /dev/null 2>&1; then mv significant_snps_chromo_num_$chromo_num_k* results_chromo_num_$chromo_num_k fi - mv vect_rlrt_value_chromo_num_$chromo_num_k* results_chromo_num_$chromo_num_k + mv vect_rlrt_value_chromo_num_$chromo_num_k* results_chromo_num_$chromo_num_k mv gwas_of_chromosome_$chromo_num_k* results_chromo_num_$chromo_num_k done @@ -170,14 +170,14 @@ if [ "$kernel_index" -gt 1 ] ; then rm -rf results_all_chromosomes/* else mkdir results_all_chromosomes - fi + fi mv gwas_for_* results_all_chromosomes mv markers_of_tested_positions_with_statistics.txt* results_all_chromosomes rm vect_nb_hap_window_chromo_num_* - fi + fi -fi +fi clear rm *.R diff --git a/khamix.sh b/khamix.sh index 450748e..e5d949e 100755 --- a/khamix.sh +++ b/khamix.sh @@ -1,6 +1,6 @@ #!/bin/sh #=======================================================================# -# kernelized haplotype-based mixed model association mapping (KHAMIX) # +# kernelized haplotype-based mixed model association mapping (KHAMIX) # #=======================================================================# # source modules for R # source module_load_r.sh @@ -9,11 +9,11 @@ #1. setting haplotype size, in number of markers, and trait to be analyzed # #--------------------------------------------------------------------------# trait_name="LLGTH" -nb_snp_hap=6 +nb_snp_hap=6 nb_chromosomes=12 # total number of chromosomes for the analyzed data set -kernel_index=1 # 1 for VanRaden linear kernel and 2 for Gaussian kernel (i.e. RBF) +kernel_index=1 # 1 for VanRaden linear kernel and 2 for Gaussian kernel (i.e. RBF) signif_level=0.01 # significance level for the restricted likelihood ratio test (RLRT) -local_or_cluster=1 # 1 for local computation and 2 for parallelize computation on a cluster +local_or_cluster=2 # 1 for local computation and 2 for parallelize computation on a cluster echo "$trait_name" > trait_name.txt echo "$nb_snp_hap" > nb_snp_hap.txt @@ -48,8 +48,8 @@ cp programs/compute_estimates_h0.R estimates_h0/ cd estimates_h0/ R -q --vanillascanned_position.txt - +for scanned_position in $( seq 1 1 $nb_scanned_positions ) +do + echo "$scanned_position">scanned_position.txt + #compute ibs status of haplotypes ./ibs_haplotypes_window ./compute_z_h_matrix - + # compute restricted likelihood ratio from emmreml estimated parameters - R -q --vanilla>vect_rlrt_value_chromo_num_$chromo_num_k.txt cat nb_col_h_matrix.txt>>vect_nb_hap_window_chromo_num_$chromo_num_k.txt -done +done # end of genome scan for chromosome $chromo_num_k