Skip to content

Commit

Permalink
Merge pull request #30 from ljacquin/feat/add-manhattan-plot
Browse files Browse the repository at this point in the history
feat: add manhattan plot to result outputs
  • Loading branch information
ljacquin authored Apr 13, 2024
2 parents 849c241 + c6832d3 commit b45080f
Show file tree
Hide file tree
Showing 5 changed files with 488 additions and 282 deletions.
54 changes: 34 additions & 20 deletions get_results_scans.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ new_signif_level=0.001
if [ "$modify_signif_level"=true ] ; then
echo "$new_signif_level" > signif_level.txt
if [ -d results_genome_scan ]; then
echo rm -rf results_genome_scan/*
rm -rf results_genome_scan/*
fi
fi

Expand All @@ -35,9 +35,9 @@ cp kernel_index.txt ../results_genome_scan
cp signif_level.txt ../results_genome_scan

cd ../programs/
cp plot_results_scans.R ../results_genome_scan
cp get_results_scans.R ../results_genome_scan
cp plot_nb_hap_scans.R ../results_genome_scan
cp get_significant_haplotypes.R ../results_genome_scan
cp plot_manhattan_scan.R ../results_genome_scan
cd ../

#--------------------------------#
Expand All @@ -53,10 +53,9 @@ do
done

cd results_genome_scan
R -q --vanilla < plot_results_scans.R
R -q --vanilla < get_results_scans.R
R -q --vanilla < plot_nb_hap_scans.R
R -q --vanilla < get_significant_haplotypes.R

R -q --vanilla < plot_manhattan_scan.R

if [ "$kernel_index" -gt 1 ] ; then

Expand All @@ -65,49 +64,55 @@ if [ "$kernel_index" -gt 1 ] ; then
for chromo_num_k in $(seq $nb_chromosomes -1 1)
do
if [ -d results_chromo_num_$chromo_num_k ]; then
echo rm -rf results_chromo_num_$chromo_num_k/*
rm -rf results_chromo_num_$chromo_num_k/*
else
mkdir results_chromo_num_$chromo_num_k
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 significant_haplotypes_chromo_num_$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 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

if [ -d results_all_chromosomes ]; then
echo rm -rf results_all_chromosomes/*
rm -rf results_all_chromosomes/*
else
mkdir results_all_chromosomes
fi
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)
do
if [ -d results_chromo_num_$chromo_num_k ]; then
echo rm -rf results_chromo_num_$chromo_num_k/*
rm -rf results_chromo_num_$chromo_num_k/*
else
mkdir results_chromo_num_$chromo_num_k
fi
mv markers_in_kb_with_rlrt_value_on_chromosome_$chromo_num_k* results_chromo_num_$chromo_num_k
mv markers_in_kb_with_significant_rlrt_value_on_chromosome_$chromo_num_k* results_chromo_num_$chromo_num_k
mv significant_snps_chromo_num_$chromo_num_k* results_chromo_num_$chromo_num_k
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 kernelized_gwas_of_chromosome_$chromo_num_k* results_chromo_num_$chromo_num_k
done

if [ -d results_all_chromosomes ]; then
echo rm -rf results_all_chromosomes/*
rm -rf results_all_chromosomes/*
else
mkdir results_all_chromosomes
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_*

fi
Expand All @@ -119,55 +124,64 @@ if [ "$kernel_index" -gt 1 ] ; then
for chromo_num_k in $(seq $nb_chromosomes -1 1)
do
if [ -d results_chromo_num_$chromo_num_k ]; then
echo rm -rf results_chromo_num_$chromo_num_k/*
rm -rf results_chromo_num_$chromo_num_k/*
else
mkdir results_chromo_num_$chromo_num_k
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 significant_haplotypes_chromo_num_$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 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

if [ -d results_all_chromosomes ]; then
echo rm -rf results_all_chromosomes/*
rm -rf results_all_chromosomes/*
else
mkdir results_all_chromosomes
fi
mv number_of_haplotypes_per_window_for_complete_genome_scan* results_all_chromosomes
mv 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)
do
if [ -d results_chromo_num_$chromo_num_k ]; then
echo rm -rf results_chromo_num_$chromo_num_k/*
rm -rf results_chromo_num_$chromo_num_k/*
else
mkdir results_chromo_num_$chromo_num_k
fi
mv markers_in_kb_with_rlrt_value_on_chromosome_$chromo_num_k* results_chromo_num_$chromo_num_k
mv markers_in_kb_with_significant_rlrt_value_on_chromosome_$chromo_num_k* results_chromo_num_$chromo_num_k
mv significant_snps_chromo_num_$chromo_num_k* results_chromo_num_$chromo_num_k
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 gwas_of_chromosome_$chromo_num_k* results_chromo_num_$chromo_num_k
done

if [ -d results_all_chromosomes ]; then
echo rm -rf results_all_chromosomes/*
rm -rf results_all_chromosomes/*
else
mkdir results_all_chromosomes
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
clear

rm *.R
rm *.txt

# End of program for reformatting results

4 changes: 0 additions & 4 deletions khamix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,9 @@ mkdir estimates_h0/
cp data_parameters/trait_name.txt estimates_h0/
cp data_parameters/phenotypes.txt estimates_h0/
if [ -f data_parameters/incidence_fixed_effects.txt ] ; then
echo
cp data_parameters/incidence_fixed_effects.txt estimates_h0/
fi
if [ -f data_parameters/incidence_polygenic_effects.txt ] ; then
echo
cp data_parameters/incidence_polygenic_effects.txt estimates_h0/
fi
cp data_parameters/kernel_index.txt estimates_h0/
Expand Down Expand Up @@ -94,12 +92,10 @@ do

# perform genome scan by sliding window for chromosome $chromo_num_k
if [ "$local_or_cluster" -gt 1 ] ; then
echo
# qsub -q normal.q -v scan_chromo_num_k.sh # a cc2 queue
# sbatch scan_chromo_num_k.sh
qsub -q workq scan_chromo_num_k.sh
else
echo
./scan_chromo_num_k.sh
fi

Expand Down
Loading

0 comments on commit b45080f

Please sign in to comment.