Commit cdbfd9da authored by Leon-Charles Tranchevent's avatar Leon-Charles Tranchevent
Browse files

Cleaning of step 09 to remove unnecessary files.

parent 2b27e4ad
# To compute the overlap in DEGs between various differential analyses.
# I/Os
OUTPUT_FOLDER=/home/users/ltranchevent/Data/GeneDER/Analysis/09/GSE157783_seurat/
META_FOLDER=/home/users/ltranchevent/Data/GeneDER/Analysis/06/
# Declare the arrays.
##declare -a cells=('Oligodendrocytes' 'Excitatory' 'Microglia' 'OPCs' 'Astrocytes' 'Endothelial cells' 'Pericytes' 'Inhibitory' 'Ependymal' 'CADPS2+ neurons' 'GABA' 'DaNs');
declare -a cells=('Oligodendrocytes' 'Excitatory' 'Microglia' 'Astrocytes');
declare -a sexes=('F' 'M');
##declare -a methods=('wilcox' 'negbinom' 'poisson');
declare -a methods=('poisson');
declare -a refs=('SNage_PDVsControl_males_max-avg_all_pivalue_rankings.tsv' 'SNage_PDVsControl_males_max-avg_gs_pivalue_rankings.tsv' 'SNage_PDVsControl_females_max-avg_all_pivalue_rankings.tsv' 'SNage_PDVsControl_females_max-avg_gs_pivalue_rankings.tsv' 'SNage_PDVsControl_females_max-avg_gd_pivalueref_rankings.tsv');
# I - scRNA-seq only: per method, per gender, across all celltype pairs.
for method in "${methods[@]}"
do
for sex in "${sexes[@]}"
do
for cell_1 in "${cells[@]}"
do
for cell_2 in "${cells[@]}"
do
if [ "${cell_1}" = "${cell_2}" ]
then
# Skip that case since we do not want to compare cell_1 with itself.
continue
fi
# Do some row computation.
tag="[${method}][${sex}][${cell_1} vs ${cell_2}]"
fn1="${OUTPUT_FOLDER}DEG_${cell_1}_${sex}_PDvsCTRL_${method}.tsv"
fn2="${OUTPUT_FOLDER}DEG_${cell_2}_${sex}_PDvsCTRL_${method}.tsv"
wc1=$(awk '{if ($5 <= 0.05) print $0}' ${fn1} | cut -f 6 | grep -v Gene | sort -u | wc -l)
wc2=$(awk '{if ($5 <= 0.05) print $0}' ${fn2} | cut -f 6 | grep -v Gene | sort -u | wc -l)
echo "${tag} First size: ${wc1}"
echo "${tag} Second size: ${wc2}"
wc3=$(comm -1 -2 <(awk '{if ($5 <= 0.05) print $0}' ${fn1} | cut -f 6 | grep -v Gene | sort -u) <(awk '{if ($5 <= 0.05) print $0}' ${fn2} | cut -f 6 | grep -v Gene | sort -u) | wc -l)
p1=$(bc <<< 100*${wc3}/${wc1})
p2=$(bc <<< 100*${wc3}/${wc2})
echo "${tag} Overlap size: ${wc3} (${p1}% // ${p2}%)"
##echo "${tag} Overlap genes:"
##comm -1 -2 <(cut -f 6 ${fn1} | grep -v Gene | sort -u) <(cut -f 6 ${fn2} | grep -v Gene | sort -u)
echo ""
done # for each cell_1
done # for each cell_2
done # for each sex
done # for each method
echo ""
echo ""
echo ""
#
# II - scRNA-seq only: per method, per celltype, across sexes.
for method in "${methods[@]}"
do
for cell in "${cells[@]}"
do
# Do some row computation.
tag="[${method}][${cell}][F vs M]"
fn1="${OUTPUT_FOLDER}DEG_${cell}_F_PDvsCTRL_${method}.tsv"
fn2="${OUTPUT_FOLDER}DEG_${cell}_M_PDvsCTRL_${method}.tsv"
wc1=$(awk '{if ($5 <= 0.05) print $0}' ${fn1} | cut -f 6 | grep -v Gene | sort -u | wc -l)
wc2=$(awk '{if ($5 <= 0.05) print $0}' ${fn2} | cut -f 6 | grep -v Gene | sort -u | wc -l)
echo "${tag} First size: ${wc1}"
echo "${tag} Second size: ${wc2}"
wc3=$(comm -1 -2 <(awk '{if ($5 <= 0.05) print $0}' ${fn1} | cut -f 6 | grep -v Gene | sort -u) <(awk '{if ($5 <= 0.05) print $0}' ${fn2} | cut -f 6 | grep -v Gene | sort -u) | wc -l)
p1=$(bc <<< 100*${wc3}/${wc1})
p2=$(bc <<< 100*${wc3}/${wc2})
echo "${tag} Overlap size: ${wc3} (${p1}% // ${p2}%)"
##echo "${tag} Overlap genes:"
##comm -1 -2 <(cut -f 6 ${fn1} | grep -v Gene | sort -u) <(cut -f 6 ${fn2} | grep -v Gene | sort -u)
echo ""
done # for each cell type.
done # for each method
echo ""
echo ""
echo ""
#
# III - scRNA-seq only: per method, per celltype, per sex, overlap with the results of the meta-analysis.
for ref in "${refs[@]}"
do
for method in "${methods[@]}"
do
for cell in "${cells[@]}"
do
for sex in "${sexes[@]}"
do
# Do some row computation.
tag="[${method}][${sex}][${cell} vs ${ref}]"
fn1="${OUTPUT_FOLDER}DEG_${cell}_${sex}_PDvsCTRL_${method}.tsv"
fn2="${META_FOLDER}${ref}"
wc1=$(awk '{if ($5 <= 0.05) print $0}' ${fn1} | cut -f 6 | grep -v Gene | sort -u | wc -l)
wc2=$(awk '{if ($4 <= 0.05) print $0}' ${fn2} | cut -f 1 | grep -v Gene | sort -u | wc -l)
echo "${tag} First size: ${wc1}"
echo "${tag} Second size: ${wc2}"
wc3=$(comm -1 -2 <(awk '{if ($5 <= 0.05) print $0}' ${fn1} | cut -f 6 | grep -v Gene | sort -u) <(awk '{if ($4 <= 0.05) print $0}' ${fn2} | cut -f 1 | grep -v Gene | sort -u) | wc -l)
p1=$(bc <<< 100*${wc3}/${wc1})
p2=$(bc <<< 100*${wc3}/${wc2})
echo "${tag} Overlap size: ${wc3} (${p1}% // ${p2}%)"
#echo "${tag} Overlap genes:"
#comm -1 -2 <(cut -f 6 ${fn1} | grep -v Gene | sort -u) <(awk '{if ($4 <= 0.05) print $0}' ${fn2} | cut -f 1 | grep -v Gene | sort -u)
echo ""
done # for each ref.
done # for each cell
done # for each sex
done # for each method
# awk '{if ($4 <= 0.05) print $0}' /home/leon/Data/GeneDER/Analysis/06/SNage_PDVsControl_males_max-avg_all_pivalue_rankings.tsv
# ==> 1330
# awk '{if ($4 <= 0.05) print $0}' /home/leon/Data/GeneDER/Analysis/06/SNage_PDVsControl_males_max-avg_gs_pivalue_rankings.tsv
# ==> 947
# awk '{if ($4 <= 0.05) print $0}' /home/leon/Data/GeneDER/Analysis/06/SNage_PDVsControl_females_max-avg_all_pivalue_rankings.tsv
# ==> 27
# awk '{if ($4 <= 0.05) print $0}' /home/leon/Data/GeneDER/Analysis/06/SNage_PDVsControl_females_max-avg_gs_pivalue_rankings.tsv
# ==> 13
# awk '{if ($4 <= 0.05) print $0}' /home/leon/Data/GeneDER/Analysis/06/SNage_PDVsControl_females_max-avg_gd_pivalueref_rankings.tsv
# ==> 53
This diff is collapsed.
#!/bin/bash -l
#SBATCH -J geneder:09:liger
#SBATCH --mail-type=all
#SBATCH --mail-user=leon-charles.tranchevent@uni.lu
#SBATCH -N 1
#SBATCH --ntasks-per-socket=14
#SBATCH --ntasks-per-node=28
#SBATCH -c 1
#SBATCH --mem=64GB
#SBATCH --time=0-04:00:00
#SBATCH -p batch
#SBATCH --qos=normal
echo "== Starting run at $(date)"
echo "== Job ID: ${SLURM_JOBID}"
echo "== Node list: ${SLURM_NODELIST}"
echo "== Submit dir. : ${SLURM_SUBMIT_DIR}"
echo ""
# Defining global parameters.
OUTPUT_FOLDER=/home/users/ltranchevent/Data/GeneDER/Analysis/09/
CODE_FOLDER=/home/users/ltranchevent/Projects/GeneDER/Analysis/09-Single-cell_analysis/
REF=${1}
# Loading modules.
module load lang/R/3.6.2-foss-2019b-bare
# Load configuration
source ../libs/conf/confSH.sh
create_variables ../Confs/datasets_config.yml
# For all scRNA datasets
nbScDatasets=${#scdatasets__dataset_name[@]}
for (( i=0; i<$nbScDatasets; i++ ))
do
datasetName=${scdatasets__dataset_name[$i]}
if [ "${datasetName}" == "${REF}" ]
then
echo "== Job $i started (${datasetName}) =="
rm -rf ${OUTPUT_FOLDER}${datasetName}_liger/
mkdir ${OUTPUT_FOLDER}${datasetName}_liger/
Rscript --vanilla ${CODE_FOLDER}sanalyse_liger.R ${datasetName} > ${OUTPUT_FOLDER}${datasetName}_liger/analysis_log.out 2> ${OUTPUT_FOLDER}${datasetName}_liger/analysis_log.err
echo "== Job $i ended (${datasetName}) =="
fi
done
# Moving the slurm log file to data
mv ${CODE_FOLDER}/slurm-*out ${OUTPUT_FOLDER}/
This diff is collapsed.
#!/bin/bash -l
#SBATCH -J geneder:09:seurat
#SBATCH --mail-type=all
#SBATCH --mail-user=leon-charles.tranchevent@uni.lu
#SBATCH -N 1
#SBATCH --ntasks-per-socket=14
#SBATCH --ntasks-per-node=28
#SBATCH -c 1
#SBATCH --mem=64GB
#SBATCH --time=0-04:00:00
#SBATCH -p batch
#SBATCH --qos=normal
echo "== Starting run at $(date)"
echo "== Job ID: ${SLURM_JOBID}"
echo "== Node list: ${SLURM_NODELIST}"
echo "== Submit dir. : ${SLURM_SUBMIT_DIR}"
echo ""
# Defining global parameters.
OUTPUT_FOLDER=/home/users/ltranchevent/Data/GeneDER/Analysis/09/
CODE_FOLDER=/home/users/ltranchevent/Projects/GeneDER/Analysis/09-Single-cell_analysis/
REF=${1}
# Loading modules.
module load lang/R/3.6.2-foss-2019b-bare
# Load configuration
source ../libs/conf/confSH.sh
create_variables ../Confs/datasets_config.yml
# For all scRNA datasets
nbScDatasets=${#scdatasets__dataset_name[@]}
for (( i=0; i<$nbScDatasets; i++ ))
do
datasetName=${scdatasets__dataset_name[$i]}
if [ "${datasetName}" == "${REF}" ]
then
echo "== Job $i started (${datasetName}) =="
rm -rf ${OUTPUT_FOLDER}${datasetName}_seurat/
mkdir ${OUTPUT_FOLDER}${datasetName}_seurat/
Rscript --vanilla ${CODE_FOLDER}sanalyse_seurat.R ${datasetName} > ${OUTPUT_FOLDER}${datasetName}_seurat/analysis_log.out 2> ${OUTPUT_FOLDER}${datasetName}_seurat/analysis_log.err
echo "== Job $i ended (${datasetName}) =="
fi
done
# Moving the slurm log file to data
mv ${CODE_FOLDER}/slurm-*out ${OUTPUT_FOLDER}/
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment