Commit 34322b1b authored by Hanna  JULIENNE's avatar Hanna JULIENNE

readme writing

parent c1234ab7
# JASS analysis pipeline
## Overview
We present here a nextflow pipeline to harmonize, impute and analyze jointly GWAS summary statistics.
The current pipeline integrate the following workflow:
![workflow image](./doc/workflow.png=650x570)
## Required Input
![workflow image](./doc/workflow.png)
The following Item are necessary to run JASS pipeline
1. A meta-data file describing GWAS (see example file in ./input_files/test1.csv)
2. A path toward a folder containing the summary statistics to analyze
3. A folder containing a Reference Panel in the .bim, .bed, .fam format
4. A path toward a folder to write pipeline results (inittable, worktable...)
5. If you wish to compute joint analyses with the pipeline, a group file with the each phenotype group written on a separated line
## Usage of nextflow pipeline
Install nextflow as explain here : https://www.nextflow.io/docs/latest/getstarted.html
Clone the current repository locally:
```
git clone https://gitlab.pasteur.fr/statistical-genetics/jass_suite_pipeline.git
```
Once done you can launch the pipeline as:
This diff is collapsed.
params.compute_project=false
params.compute_LDSC_matrix=true
params.compute_imputation=false
params.group = "$baseDir/input_files/group.txt"
params.meta_data = "test_final.csv"
params.input_folder = ${baseDir}+"/input_files/"
params.GWAS_path = "/pasteur/projets/policy01/PCMA/1._DATA/RAW.GWAS/"
params.group = params.input_folder+"/group.txt"
group = file(params.group)
netPath = "/pasteur/projets/policy01/PCMA/"
params.region = params.input_folder+"fourier_ls-all.bed"
output_folder = "/pasteur/projets/policy01/PCMA/JASS_pipeline_output/"
GWAS_labels = netPath + 'jass_analysis_pipeline/input_files/test_final.csv'
GWAS_path = "/pasteur/projets/policy01/PCMA/1._DATA/RAW.GWAS/"
GWAS_labels = params.input_folder + params.input_folder
Region_channel = Channel.fromPath(params.region)
Region_channel2 = Channel.fromPath(params.region)
diagnostic_folder= output_folder + "/sample_size/"
harmonized_GWAS_folder = output_folder + "harmonized_GWAS/"
harmonized_GWAS_1_file_folder = output_folder + "harmonized_GWAS/"
chr_channel = Channel.from(1..22)
ref_chr_channel=Channel.fromPath("/pasteur/projets/policy01/PCMA/1._DATA/ImpG_refpanel/chr*.eur.1pct.bim")
ref_chr_channel2=Channel.fromPath("/pasteur/projets/policy01/PCMA/1._DATA/ImpG_refpanel/chr*.eur.1pct.bim")
ref_chr_channel3=Channel.fromPath("/pasteur/projets/policy01/PCMA/1._DATA/ImpG_refpanel/chr*.eur.1pct.*")
ld_channel=Channel.fromPath("/pasteur/projets/policy01/PCMA/WKD_Hanna/impute_for_jass/ld_block_new_plink/*.ld")
Region_channel = Channel.fromPath('/pasteur/projets/policy01/PCMA/jass_analysis_pipeline/input_files/fourier_ls-all.bed')
Region_channel2 = Channel.fromPath('/pasteur/projets/policy01/PCMA/jass_analysis_pipeline/input_files/fourier_ls-all.bed')
/* Script channels*/
extract_sample_size_script_channel = Channel.fromPath('${baseDir}/extract_sample_size.py')
generate_trait_pairs_channel = Channel.fromPath('${baseDir}/generate_trait_pairs.py')
parse_correlation_channel = Channel.fromPath('${baseDir}/parse_correlation_results.py')
process prepare_output_folder{
input:
file ref_panel from ref_chr_channel3.collect()
val chr from chr_channel
output:
file "*.frq" into MAF_channel
"""
if [ ! -d ${diagnostic_folder} ]
then
mkdir ${diagnostic_folder}
fi
if [ ! -d ${harmonized_GWAS_folder} ]
then
mkdir ${harmonized_GWAS_folder}
fi
if [ ! -d ${harmonized_GWAS_1_file_folder} ]
then
mkdir ${harmonized_GWAS_1_file_folder}
fi
"""
}
extract_sample_size_script_channel = Channel.fromPath('/pasteur/projets/policy01/PCMA/jass_analysis_pipeline/extract_sample_size.py')
process Compute_MAF{
input:
......@@ -110,7 +150,7 @@ process Clean_GWAS {
"""
mkdir harmonized_GWAS_1_file
echo ${GWAS_path}
echo ${params.GWAS_path}
working_dir=\$(pwd)
echo \$working_dir
full_path=\$working_dir/${meta_chunk}
......@@ -118,7 +158,7 @@ process Clean_GWAS {
echo \$full_path
jass_preprocessing --gwas-info \$full_path --ref-path ${ref_panel} \
--input-folder ${GWAS_path} --diagnostic-folder ${diagnostic_folder} \
--input-folder ${params.GWAS_path} --diagnostic-folder ${diagnostic_folder} \
--output-folder ./ --output-folder-1-file harmonized_GWAS_1_file/
"""
......@@ -131,7 +171,7 @@ process Impute_GWAS {
time '8h'
input:
file gwas_files from cleaned_gwas_chr_channel
file ref_file from ref_chr_channel2.collect()
start = timeit.timeit() file ref_file from ref_chr_channel2.collect()
file ld_file from ld_channel.collect()
output:
file "imputed_GWAS/*.txt" into imputed_gwas_channel
......@@ -210,13 +250,14 @@ process Munge_LDSC_data {
process Generate_trait_pair {
input:
file generate_trait_pairs_script from generate_trait_pairs_channel
file ldsc_data from ldsc_data_channel.collect()
output:
file "pairs_chunk_*.txt" into combi_channel mode flatten
when:
params.compute_LDSC_matrix
"""
python3 ${baseDir}/generate_trait_pairs.py
python3 ${generate_trait_pairs_script}
"""
}
......@@ -255,13 +296,14 @@ process Correlation_matrices {
//publishDir "${baseDir}/Correlation_matrices/", pattern: "*.csv", mode: 'copy'
input:
file parsing_script from parse_correlation_channel
file ldsc_data from cor_log_channel.collect()
output:
file "Covariance_matrix_H0.csv" into cov_H0_matrice_channel
when:
params.compute_LDSC_matrix
"""
python3 ${baseDir}/parse_correlation_results.py
python3 ${parsing_script}
"""
}
......
......@@ -36,7 +36,7 @@ process{
//docker://quay.io/biocontainers/jass_preprocessing:1.0--py_0
withName: 'create_WG_reference_panel' {
container='jass_preprocessing_1.0--py_0.sif'
container='jass_preprocessing_2.0--py_0.sif'
cpus=1
}
......@@ -45,7 +45,7 @@ process{
}
withName: 'Clean_GWAS' {
//container='jass_preprocessing_1.0--py_0.sif'
// container='jass_preprocessing_2.0--py_0.sif'
cpus=1
}
......@@ -60,7 +60,7 @@ process{
}
withName: 'Generate_trait_pair' {
container='jass_preprocessing_1.0--py_0.sif'
container='jass_preprocessing_2.0--py_0.sif'
cpus=1
}
......@@ -70,7 +70,7 @@ process{
}
withName: 'Correlation_matrices' {
container='jass_preprocessing_1.0--py_0.sif'
container='jass_preprocessing_2.0--py_0.sif'
cpus=1
}
......
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