Skip to content
Snippets Groups Projects
Commit 4fe1d444 authored by Zhiyu Zhao's avatar Zhiyu Zhao
Browse files

V1.0

parent bfe9cb04
No related merge requests found
#!/bin/bash #!/bin/bash
################################################################################################################################################################################################################# #################################################################################################################################################################################################################
#The following are system-wide variables / constants / modules. #The following are system-wide variables / constants / modules.
THIS_FILE=`basename $0` #Do NOT change this line.
THIS_FOLDER=`dirname $0` #Do NOT change this line.
if [ "$SCRIPT_FOLDER" == "" ] #analysis_modules.sh is called locally.
then
SCRIPT_FOLDER=$THIS_FOLDER
fi
NUM_THREADS=`grep -c ^processor /proc/cpuinfo` NUM_THREADS=`grep -c ^processor /proc/cpuinfo`
NUM_THREADS=`expr $NUM_THREADS - 4` NUM_THREADS=`expr $NUM_THREADS - 4`
module load singularity/3.5.3 #2.6.1(default) was deprecated. module load singularity/3.5.3 #2.6.1(default) was deprecated.
#The above are system-wide constants / modules. #The above are system-wide constants / modules.
################################################################################################################################################################################################################# #################################################################################################################################################################################################################
#Pipeline version: V1 echo scRNASeq Version: V1 1>&2
SCRIPT_FOLDER=/work/CRI/zzhao/git/scRNASeq/V1
SINGULARITY_FOLDER=/archive/CRI/shared/Singularity SINGULARITY_FOLDER=/archive/CRI/shared/Singularity
EXPERIMENT=scRNASeq EXPERIMENT=scRNASeq
#######################################Begin per-sample header.####################################### #######################################Begin per-sample header.#######################################
...@@ -843,20 +848,20 @@ then ...@@ -843,20 +848,20 @@ then
echo '#################################################################################################################################################################################################################' >> $ANALYSIS_LOG echo '#################################################################################################################################################################################################################' >> $ANALYSIS_LOG
if [ $1 -ge 0 ] if [ $1 -ge 0 ]
then then
echo 'Slurm job '$SLURM_JOB_ID' error log: ' >> $ANALYSIS_LOG echo 'Slurm job '$SLURM_JOB_ID' stderr log: ' >> $ANALYSIS_LOG
cat `dirname $ANALYSIS_LOG`/slurm*.err >> $ANALYSIS_LOG cat `dirname $ANALYSIS_LOG`/slurm*.err >> $ANALYSIS_LOG
else else
echo 'Local job error log: ' >> $ANALYSIS_LOG echo 'Local job stderr log: ' >> $ANALYSIS_LOG
cat `dirname $ANALYSIS_LOG`/local_log_*.out >> $ANALYSIS_LOG cat `dirname $ANALYSIS_LOG`/local_log_*.out >> $ANALYSIS_LOG
fi fi
echo '#################################################################################################################################################################################################################' >> $ANALYSIS_LOG echo '#################################################################################################################################################################################################################' >> $ANALYSIS_LOG
if [ $1 -ge 0 ] if [ $1 -ge 0 ]
then then
echo 'Slurm job '$SLURM_JOB_ID' output: ' >> $ANALYSIS_LOG echo 'Slurm job '$SLURM_JOB_ID' stdout log: ' >> $ANALYSIS_LOG
cat `dirname $ANALYSIS_LOG`/slurm*.out >> $ANALYSIS_LOG cat `dirname $ANALYSIS_LOG`/slurm*.out >> $ANALYSIS_LOG
rm `dirname $ANALYSIS_LOG`/slurm*.* rm `dirname $ANALYSIS_LOG`/slurm*.*
else else
echo 'Local job out log: ' >> $ANALYSIS_LOG echo 'Local job stdout log: ' >> $ANALYSIS_LOG
cat `dirname $ANALYSIS_LOG`/local_log_*.err >> $ANALYSIS_LOG cat `dirname $ANALYSIS_LOG`/local_log_*.err >> $ANALYSIS_LOG
rm `dirname $ANALYSIS_LOG`/local_log_*.* rm `dirname $ANALYSIS_LOG`/local_log_*.*
fi fi
......
...@@ -87,16 +87,21 @@ then ...@@ -87,16 +87,21 @@ then
ANALYSIS_LOG=$SAMPLE_OUTPUT_PATH/$SAMPLE_NAME'_'$FUNCTION'.log' ANALYSIS_LOG=$SAMPLE_OUTPUT_PATH/$SAMPLE_NAME'_'$FUNCTION'.log'
if [ "$DELETE_FOLDER" == "Y" ] || [ ! -f $ANALYSIS_LOG ] || [ "`grep \"$FUNCTION analysis completed\" $ANALYSIS_LOG`" == "" ] if [ "$DELETE_FOLDER" == "Y" ] || [ ! -f $ANALYSIS_LOG ] || [ "`grep \"$FUNCTION analysis completed\" $ANALYSIS_LOG`" == "" ]
then then
echo "$SAMPLE_OUTPUT_PATH is to be deleted and rerun." if [ -d $SAMPLE_OUTPUT_PATH ]
rm -fR $SAMPLE_OUTPUT_PATH then
rm -fR $SAMPLE_OUTPUT_PATH
echo "Re-running $SAMPLE_OUTPUT_PATH ..."
else
echo "Running $SAMPLE_OUTPUT_PATH ..."
fi
mkdir -p $SAMPLE_OUTPUT_PATH mkdir -p $SAMPLE_OUTPUT_PATH
sbatch -e $SAMPLE_OUTPUT_PATH/"slurm-%j.err" -o $SAMPLE_OUTPUT_PATH/"slurm-%j.out" -p $QUEUE $THIS_FOLDER/analysis_modules.sh $SAMPLE_ID $SAMPLE_INPUT_PATH $SAMPLE_OUTPUT_PATH $FUNCTION $SPECIES $ANALYSIS_MODE "$8" "$9" "${10}" "${11}" "${12}" "${13}" "${14}" "${15}" "${16}" "${17}" "${18}" "${19}" "${20}" #$8 and parameters thereafter are defined by the specific function. sbatch --export SCRIPT_FOLDER=$THIS_FOLDER -e $SAMPLE_OUTPUT_PATH/"slurm-%j.err" -o $SAMPLE_OUTPUT_PATH/"slurm-%j.out" -p $QUEUE $THIS_FOLDER/analysis_modules.sh $SAMPLE_ID $SAMPLE_INPUT_PATH $SAMPLE_OUTPUT_PATH $FUNCTION $SPECIES $ANALYSIS_MODE "$8" "$9" "${10}" "${11}" "${12}" "${13}" "${14}" "${15}" "${16}" "${17}" "${18}" "${19}" "${20}" #$8 and parameters thereafter are defined by the specific function.
fi fi
done done
elif [ "$ANALYSIS_TYPE" == "all_sample" ] elif [ "$ANALYSIS_TYPE" == "all_sample" ]
then then
mkdir -p $OUTPUT_PATH mkdir -p $OUTPUT_PATH
sbatch -e $OUTPUT_PATH/"slurm-%j.err" -o $OUTPUT_PATH/"slurm-%j.out" -p $QUEUE $THIS_FOLDER/analysis_modules.sh 0 "$INPUT_PATH" $OUTPUT_PATH $FUNCTION $SPECIES $ANALYSIS_MODE "$8" "$9" "${10}" "${11}" "${12}" "${13}" "${14}" "${15}" "${16}" "${17}" "${18}" "${19}" "${20}" #$8 and parameters thereafter are defined by the specific function. Usually they are input file name patterns. sbatch --export SCRIPT_FOLDER=$THIS_FOLDER -e $OUTPUT_PATH/"slurm-%j.err" -o $OUTPUT_PATH/"slurm-%j.out" -p $QUEUE $THIS_FOLDER/analysis_modules.sh 0 "$INPUT_PATH" $OUTPUT_PATH $FUNCTION $SPECIES $ANALYSIS_MODE "$8" "$9" "${10}" "${11}" "${12}" "${13}" "${14}" "${15}" "${16}" "${17}" "${18}" "${19}" "${20}" #$8 and parameters thereafter are defined by the specific function. Usually they are input file name patterns.
elif [ "$ANALYSIS_TYPE" == "local" ] elif [ "$ANALYSIS_TYPE" == "local" ]
then then
mkdir -p $OUTPUT_PATH mkdir -p $OUTPUT_PATH
......
Date: Date:
Tue Oct 13 09:00:46 CDT 2020 Fri Oct 23 14:49:32 CDT 2020
Commands: Commands:
...@@ -7,22 +7,22 @@ cd /work/CRI/zzhao/git/PipelineMaker/V1.3 ...@@ -7,22 +7,22 @@ cd /work/CRI/zzhao/git/PipelineMaker/V1.3
sh make_pipeline.sh V1 scRNASeq /work/CRI/zzhao/git "ngs/ngs_Ensembl_common.sh ngs/RNASeq/scRNASeq/ngs_cellranger_common.sh" "ngs/RNASeq/scRNASeq/ngs_*.sh ngs/RNASeq/scRNASeq/Seurat/ngs_*.sh ngs/ngs_open_igv.sh" "ngs/RNASeq/scRNASeq/ngs_cellranger_index.txt ngs/RNASeq/scRNASeq/*.csv ngs/RNASeq/scRNASeq/Seurat/Seurat.csv ngs/RNASeq/scRNASeq/Seurat/cc.genes.updated.2019.rdata ngs/RNASeq/scRNASeq/Seurat/Seurat*.R ngs/RNASeq/scRNASeq/Seurat/Sierra*.R ngs/RNASeq/scRNASeq/my_variables.sh ngs/RNASeq/scRNASeq/scRNASeq_analysis.sh" sh make_pipeline.sh V1 scRNASeq /work/CRI/zzhao/git "ngs/ngs_Ensembl_common.sh ngs/RNASeq/scRNASeq/ngs_cellranger_common.sh" "ngs/RNASeq/scRNASeq/ngs_*.sh ngs/RNASeq/scRNASeq/Seurat/ngs_*.sh ngs/ngs_open_igv.sh" "ngs/RNASeq/scRNASeq/ngs_cellranger_index.txt ngs/RNASeq/scRNASeq/*.csv ngs/RNASeq/scRNASeq/Seurat/Seurat.csv ngs/RNASeq/scRNASeq/Seurat/cc.genes.updated.2019.rdata ngs/RNASeq/scRNASeq/Seurat/Seurat*.R ngs/RNASeq/scRNASeq/Seurat/Sierra*.R ngs/RNASeq/scRNASeq/my_variables.sh ngs/RNASeq/scRNASeq/scRNASeq_analysis.sh"
Files: Files:
-rwx------ 1 zzhao Morrison_lab 690 Jun 21 13:56 ./system_common.sh -rwx------ 1 zzhao Morrison_lab 897 Oct 21 14:51 ./system_common.sh
-rwxr--r-- 1 zzhao Morrison_lab 2502 Jun 17 15:13 ./header.sh -rwxr--r-- 1 zzhao Morrison_lab 2502 Jun 17 15:13 ./header.sh
-rwx------ 1 zzhao Morrison_lab 3299 Aug 2 23:33 ngs/ngs_Ensembl_common.sh -rwx------ 1 zzhao Morrison_lab 3299 Aug 2 23:33 ngs/ngs_Ensembl_common.sh
-rw-r--r-- 1 zzhao Morrison_lab 1366 Oct 9 12:28 ngs/RNASeq/scRNASeq/ngs_cellranger_common.sh -rw-r--r-- 1 zzhao Morrison_lab 1366 Oct 9 12:28 ngs/RNASeq/scRNASeq/ngs_cellranger_common.sh
-rw-r--r-- 1 zzhao Morrison_lab 2221 Oct 9 11:46 ngs/ngs_open_igv.sh -rw-r--r-- 1 zzhao Morrison_lab 2221 Oct 21 12:32 ngs/ngs_open_igv.sh
-rw-r--r-- 1 zzhao Morrison_lab 1366 Oct 9 12:28 ngs/RNASeq/scRNASeq/ngs_cellranger_common.sh -rw-r--r-- 1 zzhao Morrison_lab 1366 Oct 9 12:28 ngs/RNASeq/scRNASeq/ngs_cellranger_common.sh
-rw-r--r-- 1 zzhao Morrison_lab 8554 Jul 28 10:20 ngs/RNASeq/scRNASeq/ngs_cellranger.sh -rw-r--r-- 1 zzhao Morrison_lab 8554 Jul 28 10:20 ngs/RNASeq/scRNASeq/ngs_cellranger.sh
-rw-r--r-- 1 zzhao Morrison_lab 7588 Oct 7 18:30 ngs/RNASeq/scRNASeq/Seurat/ngs_seurat.sh -rw-r--r-- 1 zzhao Morrison_lab 7588 Oct 7 18:30 ngs/RNASeq/scRNASeq/Seurat/ngs_seurat.sh
-rwx------ 1 zzhao Morrison_lab 5374 Oct 8 23:21 ngs/RNASeq/scRNASeq/Seurat/ngs_sierra.sh -rwx------ 1 zzhao Morrison_lab 5374 Oct 8 23:21 ngs/RNASeq/scRNASeq/Seurat/ngs_sierra.sh
-rwxr--r-- 1 zzhao Morrison_lab 2153 Jul 13 21:36 ./footer.sh -rwxr--r-- 1 zzhao Morrison_lab 2162 Oct 21 20:06 ./footer.sh
-rwx------ 1 zzhao Morrison_lab 4819 Oct 6 12:28 ./run_analysis.sh -rwx------ 1 zzhao Morrison_lab 4978 Oct 22 12:12 ./run_analysis.sh
-rwxr----- 1 zzhao Morrison_lab 221 Jul 20 11:46 ngs/RNASeq/scRNASeq/Aggregation.csv -rwxr----- 1 zzhao Morrison_lab 221 Jul 20 11:46 ngs/RNASeq/scRNASeq/Aggregation.csv
-rw-r--r-- 1 zzhao Morrison_lab 1922 Jul 17 13:56 ngs/RNASeq/scRNASeq/my_variables.sh -rw-r--r-- 1 zzhao Morrison_lab 1922 Jul 17 13:56 ngs/RNASeq/scRNASeq/my_variables.sh
-rw-r--r-- 1 zzhao Morrison_lab 4345 Mar 12 2020 ngs/RNASeq/scRNASeq/ngs_cellranger_index.txt -rw-r--r-- 1 zzhao Morrison_lab 4345 Mar 12 2020 ngs/RNASeq/scRNASeq/ngs_cellranger_index.txt
-rw-r--r-- 1 zzhao Morrison_lab 68 Mar 12 2020 ngs/RNASeq/scRNASeq/Samples.csv -rw-r--r-- 1 zzhao Morrison_lab 68 Mar 12 2020 ngs/RNASeq/scRNASeq/Samples.csv
-rw-r--r-- 1 zzhao Morrison_lab 17500 Oct 10 12:07 ngs/RNASeq/scRNASeq/scRNASeq_analysis.sh -rw-r--r-- 1 zzhao Morrison_lab 19501 Oct 23 14:48 ngs/RNASeq/scRNASeq/scRNASeq_analysis.sh
-rw-r--r-- 1 zzhao Morrison_lab 1000 Sep 25 14:16 ngs/RNASeq/scRNASeq/Seurat/cc.genes.updated.2019.rdata -rw-r--r-- 1 zzhao Morrison_lab 1000 Sep 25 14:16 ngs/RNASeq/scRNASeq/Seurat/cc.genes.updated.2019.rdata
-rw-r--r-- 1 zzhao Morrison_lab 14765 Oct 12 13:27 ngs/RNASeq/scRNASeq/Seurat/SeuratAnalysis.R -rw-r--r-- 1 zzhao Morrison_lab 14765 Oct 12 13:27 ngs/RNASeq/scRNASeq/Seurat/SeuratAnalysis.R
-rw-r--r-- 1 zzhao Morrison_lab 302 Jul 21 23:06 ngs/RNASeq/scRNASeq/Seurat/Seurat.csv -rw-r--r-- 1 zzhao Morrison_lab 302 Jul 21 23:06 ngs/RNASeq/scRNASeq/Seurat/Seurat.csv
......
...@@ -6,14 +6,14 @@ SCRIPT_FOLDER=$THIS_FOLDER #Do NOT change this line. ...@@ -6,14 +6,14 @@ SCRIPT_FOLDER=$THIS_FOLDER #Do NOT change this line.
###############################End importing predefined variables. Do NOT change this code block.####################################### ###############################End importing predefined variables. Do NOT change this code block.#######################################
###############################Begin Analysis Steps Declaration.####################################### ###############################Begin Analysis Steps Declaration.#######################################
#If you customize this workflow, list all your steps here and remove unused steps, otherwise do NOT change them. #If you customize this workflow, list all your steps here and remove unused steps, otherwise do not change them.
declare -A AVAILABLE_STEPS=([1.1*]=cellranger_mkfastq [2.1*]=cellranger_count [2.2]=cellranger_count_merged [3.1*]=seurat_qc [3.2*]=cellranger_aggr [3.3]=igv_open_bam [4.1*]=seurat_filter [5.1*]=cellranger_seurat_filter [5.2*]=seurat_integrate [5.3]=sierra_find_peaks [6.1*]=seurat_analyze [6.2]=sierra_merge_peaks [7.1]=seurat_show_genes [7.2]=sierra_count_peaks [8.1]=sierra_analyze [9.1]=diff_exp_test [9.2]=sierra_show_isoforms) declare -A AVAILABLE_STEPS=([0.1]=check_log [0.2]=delete_temp_folder [0.3]=delete_analysis [1.1*]=cellranger_mkfastq [2.1*]=cellranger_count [2.2]=cellranger_count_merged [3.1*]=seurat_qc [3.2*]=cellranger_aggr [3.3]=igv_open_bam [4.1*]=seurat_filter [5.1*]=cellranger_seurat_filter [5.2*]=seurat_integrate [5.3]=sierra_find_peaks [6.1*]=seurat_analyze [6.2]=sierra_merge_peaks [7.1]=seurat_show_genes [7.2]=sierra_count_peaks [8.1]=sierra_analyze [9.1]=diff_exp_test [9.2]=sierra_show_isoforms)
#If you customize this workflow, list your step-specific parameters here. #If you customize this workflow, list your step-specific parameters here.
declare -A STEP_SPECIFIC_PARAMETERS=([cellranger_mkfastq]="[job_queue=256GBv1] [experiment_name=scRNASeq] [samples_file=auto|your_file]" [cellranger_count]="[job_queue=256GBv1] [reference_genome=cellranger|Ensembl] [expected_cells] [chemistry]" [cellranger_count_merged]="[job_queue=256GBv1] [input_folder=mkfastq_output_folder|comma_separated_paths] [merged_name=Merged] [reference_genome=cellranger|Ensembl] [expected_cells] [chemistry]" [cellranger_aggr]="[job_queue=256GBv1] [aggregation_name=Aggregated] [aggregation_file=auto|your_file] [normalization=mapped|none]" [igv_open_bam]="[job_queue=256GBv1] [samples=all|comma_separated_list] [region=chromosome:begin-end]" [seurat_qc]="[job_queue=256GBv1] [samples_file=auto|your_file] [mt_gene_prefix=mt-] [ribo_protein_gene_prefix=Rp[s|l]]" [seurat_filter]="[job_queue=256GBv1] [mt_gene_prefix=mt-] [mt_gene_percent=5] [min_nFeature=100] [max_nFeature=10000] [min_nCount=100] [max_nCount=100000] [cell_file=none] [clusters=none] [option=none|include|exclude]" [sierra_find_peaks]="[job_queue=256GBv1] [reference_genome=cellranger|Ensembl]" [cellranger_seurat_filter]="[job_queue=256GBv1] [samples=aggr|single]" [seurat_integrate]="[job_queue=256GBv1] [reference_sample=0(no_reference)|1_to_n] [nFeature=3000] [k.filter=200] [cell_cycle_regression=no|diff|complete]" [seurat_analyze]="[job_queue=256GBv1] [dimensions_for_clustering=30] [identity_file=none|your_file] [identity_type=none|cluster|cell] [cancer=none|scCATCH_cancer_type] [tissue=none|scCATCH_tissue_type]" [sierra_merge_peaks]="[job_queue=256GBv1] [reference_genome=cellranger|Ensembl]" [seurat_show_genes]="[job_queue=256GBv1] [analysis_name=TopGenes] [genes=10|number|gene|comma_separated_gene_list] [co-expression=no|yes]" [diff_exp_test]="[job_queue=256GBv1] [method=gene|isoform] [analysis_name=Condition1_vs_Condition2] <condition1_pattern> [condition2_pattern=none|your_pattern] [adjusted_p_value_cutoff=0.01|your_cutoff] [fold_change_cutoff=2|your_cutoff]" [sierra_count_peaks]="[job_queue=256GBv1] [reference_genome=cellranger|Ensembl]" [sierra_analyze]="[job_queue=256GBv1]" [sierra_show_isoforms]="[job_queue=256GBv1] [analysis_name=SelectedGene] <gene|comma_separated_peak_list> [type=gene|peaks]") declare -A STEP_SPECIFIC_PARAMETERS=([check_log]="[job_queue=na] <step_number|step_name> [keyword=completed|status|started|files|full|any_other_word_for_search]" [delete_temp_folder]="" [delete_analysis]="" [cellranger_mkfastq]="[job_queue=256GBv1] [experiment_name=scRNASeq] [samples_file=auto|your_file]" [cellranger_count]="[job_queue=256GBv1] [reference_genome=cellranger|Ensembl] [expected_cells] [chemistry]" [cellranger_count_merged]="[job_queue=256GBv1] [input_folder=mkfastq_output_folder|comma_separated_paths] [merged_name=Merged] [reference_genome=cellranger|Ensembl] [expected_cells] [chemistry]" [cellranger_aggr]="[job_queue=256GBv1] [aggregation_name=Aggregated] [aggregation_file=auto|your_file] [normalization=mapped|none]" [igv_open_bam]="[job_queue=256GBv1] [samples=all|comma_separated_list] [region=chromosome:begin-end]" [seurat_qc]="[job_queue=256GBv1] [samples_file=auto|your_file] [mt_gene_prefix=mt-] [ribo_protein_gene_prefix=Rp[s|l]]" [seurat_filter]="[job_queue=256GBv1] [mt_gene_prefix=mt-] [mt_gene_percent=5] [min_nFeature=100] [max_nFeature=10000] [min_nCount=100] [max_nCount=100000] [cell_file=none] [clusters=none] [option=none|include|exclude]" [sierra_find_peaks]="[job_queue=256GBv1] [reference_genome=cellranger|Ensembl]" [cellranger_seurat_filter]="[job_queue=256GBv1] [samples=aggr|single]" [seurat_integrate]="[job_queue=256GBv1] [reference_sample=0(no_reference)|1_to_n] [nFeature=3000] [k.filter=200] [cell_cycle_regression=no|diff|complete]" [seurat_analyze]="[job_queue=256GBv1] [dimensions_for_clustering=30] [identity_file=none|your_file] [identity_type=none|cluster|cell] [cancer=none|scCATCH_cancer_type] [tissue=none|scCATCH_tissue_type]" [sierra_merge_peaks]="[job_queue=256GBv1] [reference_genome=cellranger|Ensembl]" [seurat_show_genes]="[job_queue=256GBv1] [analysis_name=TopGenes] [genes=10|number|gene|comma_separated_gene_list] [co-expression=no|yes]" [diff_exp_test]="[job_queue=256GBv1] [method=gene|isoform] [analysis_name=Condition1_vs_Condition2] <condition1_pattern> [condition2_pattern=none|your_pattern] [adjusted_p_value_cutoff=0.01|your_cutoff] [fold_change_cutoff=2|your_cutoff]" [sierra_count_peaks]="[job_queue=256GBv1] [reference_genome=cellranger|Ensembl]" [sierra_analyze]="[job_queue=256GBv1]" [sierra_show_isoforms]="[job_queue=256GBv1] [analysis_name=SelectedGene] <gene|comma_separated_peak_list> [type=gene|peaks]")
#If you customize this workflow, list your step-specific output folders here. #If you customize this workflow, list your step-specific output folders here.
declare -A STEP_OUTPUT_FOLDER=([cellranger_mkfastq]="$TEMP_FOLDER/Raw_Reads" [cellranger_count]="$TEMP_FOLDER/CellRanger_Counted" [cellranger_count_merged]="$TEMP_FOLDER/CellRanger_Counted" [cellranger_aggr]="$TEMP_FOLDER/CellRanger_Aggregated" [igv_open_bam]="$TEMP_FOLDER/IGV" [seurat_qc]="$TEMP_FOLDER/Seurat_QC" [seurat_filter]="$TEMP_FOLDER/Seurat_Filtered" [sierra_find_peaks]="$TEMP_FOLDER/Sierra_Peaks" [cellranger_seurat_filter]="$TEMP_FOLDER/CellRanger_Seurat_Filtered" [seurat_integrate]="$TEMP_FOLDER/Seurat_Integrated" [seurat_analyze]="$WORK_FOLDER/Seurat_Analyzed" [sierra_merge_peaks]="$TEMP_FOLDER/Sierra_Merged_Peaks" [seurat_show_genes]="$WORK_FOLDER/Visual/Genes" [diff_exp_test]="$WORK_FOLDER/DiffExp" [sierra_count_peaks]="$TEMP_FOLDER/Sierra_Counted" [sierra_analyze]="$WORK_FOLDER/Sierra_Analyzed" [sierra_show_isoforms]="$WORK_FOLDER/Visual/Isoforms") declare -A STEP_OUTPUT_FOLDER=([check_log]="$WORK_FOLDER/Log" [cellranger_mkfastq]="$TEMP_FOLDER/Raw_Reads" [cellranger_count]="$TEMP_FOLDER/CellRanger_Counted" [cellranger_count_merged]="$TEMP_FOLDER/CellRanger_Counted" [cellranger_aggr]="$TEMP_FOLDER/CellRanger_Aggregated" [igv_open_bam]="$TEMP_FOLDER/IGV" [seurat_qc]="$TEMP_FOLDER/Seurat_QC" [seurat_filter]="$TEMP_FOLDER/Seurat_Filtered" [sierra_find_peaks]="$TEMP_FOLDER/Sierra_Peaks" [cellranger_seurat_filter]="$TEMP_FOLDER/CellRanger_Seurat_Filtered" [seurat_integrate]="$TEMP_FOLDER/Seurat_Integrated" [seurat_analyze]="$WORK_FOLDER/Seurat_Analyzed" [sierra_merge_peaks]="$TEMP_FOLDER/Sierra_Merged_Peaks" [seurat_show_genes]="$WORK_FOLDER/Visual/Genes" [diff_exp_test]="$WORK_FOLDER/DiffExp" [sierra_count_peaks]="$TEMP_FOLDER/Sierra_Counted" [sierra_analyze]="$WORK_FOLDER/Sierra_Analyzed" [sierra_show_isoforms]="$WORK_FOLDER/Visual/Isoforms")
###############################End Analysis Steps Declaration.####################################### ###############################End Analysis Steps Declaration.#######################################
###############################Begin: Help info. Do NOT change this code block.####################################### ###############################Begin: Help info. Do NOT change this code block.#######################################
...@@ -113,6 +113,72 @@ fi ...@@ -113,6 +113,72 @@ fi
#########################End Analysis Step Templates.############################# #########################End Analysis Step Templates.#############################
###############################Begin Analysis Steps. Add / Delete Steps If Needed.####################################### ###############################Begin Analysis Steps. Add / Delete Steps If Needed.#######################################
if [ "$ANALYSIS_STEP" == "check_log" ]
then
if [[ ! " ${AVAILABLE_STEPS[@]} " =~ " $3 " ]]
then
checkStep=${AVAILABLE_STEPS[$3]}
else
checkStep=$3
fi
stepOutputFolder=${STEP_OUTPUT_FOLDER[$checkStep]}
if [ "$checkStep" == "" ] || [ "$stepOutputFolder" == "" ]
then
echo "Unknown step number or name."
exit
fi
if [ "$4" == "" ]
then
KEYWORD=completed
else
KEYWORD="$4"
fi
clear
case "$KEYWORD" in
files)
find $stepOutputFolder -name "*_*.log" | more
;;
status)
find $stepOutputFolder -name "*_*.log" | xargs head -5 | more
;;
full)
find $stepOutputFolder -name "*_*.log" | xargs tail -n +1 | more
;;
started|completed)
find $stepOutputFolder -name "*_*.log" | xargs head -5 | grep -H "$KEYWORD" | more
;;
*)
find $stepOutputFolder -name "*_*.log" | xargs grep -H "$KEYWORD" | more
;;
esac
fi
######################################################
if [ "$ANALYSIS_STEP" == "delete_temp_folder" ]
then
DELETE_FOLDER=N
echo
echo "All files in the \""$TEMP_FOLDER"\" will be deleted if you choose Y. Are you sure (Y/N)?"
read DELETE_FOLDER
if [ "$DELETE_FOLDER" == "Y" ]
then
rm -R $TEMP_FOLDER
echo "Temp folder is deleted. If you still need those temporary files, you have to rerun the analysis steps."
fi
fi
######################################################
if [ "$ANALYSIS_STEP" == "delete_analysis" ]
then
DELETE_FOLDER=N
echo
echo "CAUTION: All files in the \""$WORK_FOLDER"\" including my_variables.sh will be deleted if you choose Y. Are you sure (Y/N)?"
read DELETE_FOLDER
if [ "$DELETE_FOLDER" == "Y" ]
then
rm -R $TEMP_FOLDER
rm -R $WORK_FOLDER
echo "All the analysis files are deleted. If you still need them, you have to rerun the analysis steps."
fi
fi
###################################################### ######################################################
if [ "$ANALYSIS_STEP" == "cellranger_mkfastq" ] if [ "$ANALYSIS_STEP" == "cellranger_mkfastq" ]
then then
......
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