diff --git a/README.md b/README.md index c422d33..b7d7792 100644 --- a/README.md +++ b/README.md @@ -106,6 +106,7 @@ nextflow run workflows/main.nf \ --phenotype test_data/phenotype/Phe_linear_covars_mod1.txt \ --phenolist_file test_data/phenotype/Phe_linear_covars_mod1_phenolist.txt \ --covarcollist "age,sex" \ + --sampleidcol renamed_sampleid \ --regression_method "linear" ``` diff --git a/modules/shapeit5_ligate.nf b/modules/shapeit5_ligate.nf index cb354cf..7f00051 100644 --- a/modules/shapeit5_ligate.nf +++ b/modules/shapeit5_ligate.nf @@ -26,18 +26,35 @@ process RUN_SHAPEIT5_LIGATE { """ ls -1v *.bcf > list_ligate.${chr}.txt - ligate_static \\ - --input list_ligate.${chr}.txt \\ - --output ${output_prefix}_${chr}.shapeit5_common_ligate.vcf.gz \\ - --thread ${task.cpus} \\ - --index \\ - --log ${output_prefix}_${chr}.shapeit5_common_ligate.log + if command -v SHAPEIT5_ligate &> /dev/null; then + SHAPEIT5_ligate \\ + --input list_ligate.${chr}.txt \\ + --output ${output_prefix}_${chr}.shapeit5_common_ligate.vcf.gz \\ + --thread ${task.cpus} \\ + --log ${output_prefix}_${chr}.shapeit5_common_ligate.log + bcftools index ${output_prefix}_${chr}.shapeit5_common_ligate.vcf.gz + + else + ligate_static \\ + --input list_ligate.${chr}.txt \\ + --output ${output_prefix}_${chr}.shapeit5_common_ligate.vcf.gz \\ + --thread ${task.cpus} \\ + --index \\ + --log ${output_prefix}_${chr}.shapeit5_common_ligate.log + fi """ stub: """ ls -1v *.bcf > list_ligate.${chr}.txt + echo "SHAPEIT5_ligate \\ + --input list_ligate.${chr}.txt \\ + --output ${output_prefix}_${chr}.shapeit5_common_ligate.vcf.gz \\ + --thread ${task.cpus} \\ + --log ${output_prefix}_${chr}.shapeit5_common_ligate.log + bcftools index ${output_prefix}_${chr}.shapeit5_common_ligate.vcf.gz" + echo "ligate_static \\ --input list_ligate.${chr}.txt \\ --output ${output_prefix}_${chr}.shapeit5_common_ligate.vcf.gz \\ diff --git a/modules/shapeit5_phase_common.nf b/modules/shapeit5_phase_common.nf index aecb26e..7aa2a24 100644 --- a/modules/shapeit5_phase_common.nf +++ b/modules/shapeit5_phase_common.nf @@ -32,15 +32,27 @@ process RUN_SHAPEIT5_PHASE_COMMON { """ echo "# Running SHAPEIT5 Phasing..." - phase_common_static \\ - --input ${input_vcf} \\ - ${ref_vcf_command} \\ - --map ${genetic_map} \\ - --output ${output_prefix}_${chr}.chunk_${data[0]}.shapeit5_common.bcf \\ - --thread ${task.cpus} \\ - --log ${output_prefix}_${chr}.chunk_${data[0]}.shapeit5_common.log \\ - ${filter_maf_command} \\ - --region ${data[1]} + if command -v SHAPEIT5_phase_common &> /dev/null; then + SHAPEIT5_phase_common \ + --input ${input_vcf} \ + ${ref_vcf_command} \ + --map ${genetic_map} \ + --output ${output_prefix}_${chr}.chunk_${data[0]}.shapeit5_common.bcf \ + --thread ${task.cpus} \ + --log ${output_prefix}_${chr}.chunk_${data[0]}.shapeit5_common.log \ + ${filter_maf_command} \ + --region ${data[1]} + else + phase_common_static \ + --input ${input_vcf} \ + ${ref_vcf_command} \ + --map ${genetic_map} \ + --output ${output_prefix}_${chr}.chunk_${data[0]}.shapeit5_common.bcf \ + --thread ${task.cpus} \ + --log ${output_prefix}_${chr}.chunk_${data[0]}.shapeit5_common.log \ + ${filter_maf_command} \ + --region ${data[1]} + fi """ stub: @@ -49,7 +61,7 @@ process RUN_SHAPEIT5_PHASE_COMMON { """ echo "# Running SHAPEIT5 Phasing..." - echo "phase_common_static \\ + echo "SHAPEIT5_phase_common \\ --input ${input_vcf} \\ $ref_vcf_command \\ --map ${genetic_map} \\ @@ -59,6 +71,16 @@ process RUN_SHAPEIT5_PHASE_COMMON { ${filter_maf_command} \\ --region ${data[1]}" + echo "phase_common_static \\ + --input ${input_vcf} \\ + ${ref_vcf_command} \\ + --map ${genetic_map} \\ + --output ${output_prefix}_${chr}.chunk_${data[0]}.shapeit5_common.bcf \\ + --thread ${task.cpus} \\ + --log ${output_prefix}_${chr}.chunk_${data[0]}.shapeit5_common.log \\ + ${filter_maf_command} \\ + --region ${data[1]}" + touch ${output_prefix}_${chr}.chunk_${data[0]}.shapeit5_common.bcf touch ${output_prefix}_${chr}.chunk_${data[0]}.shapeit5_common.bcf.csi touch ${output_prefix}_${chr}.chunk_${data[0]}.shapeit5_common.log