diff --git a/README.md b/README.md index 6133b06..72e8678 100644 --- a/README.md +++ b/README.md @@ -185,7 +185,7 @@ iedb=~/Variants2Neoantigen/data/iedb/iedb.fasta # iedb database u ##PATH_HLA=~/wangshx/projects/data/ # directory path to patient specific HLA alleles file ####### <<<<<< Location of Softwares, python environment and input arguments -py_env=pipeline # python environment, which can run pvacseq +py_env=pipeline # python environment, which can run pvacseq (Python 3.5) py2_env=py2 # python2.7 maf2vcf=~/vcf2maf/maf2vcf.pl # path of maf2vcf.pl script diff --git a/add_path.sh b/add_path.sh index 88b4b59..6e078f5 100755 --- a/add_path.sh +++ b/add_path.sh @@ -1,12 +1,18 @@ #!/bin/bash -# add runNEO path to ~/.bashrc +# add Variants2neoantigen path to ~/.bashrc +echo "Add permission for scripts..." +chmod u+x *.sh runNEO + +echo "Add path for Variants2neoantigen tool..." DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -echo "# add path for runNEO tool" >> ~/.bashrc +echo "# add path for Variants2neoantigen tool" >> ~/.bashrc echo 'export' PATH=\""$DIR:\$PATH"\" >> ~/.bashrc source ~/.bashrc -echo "Add runNEO path to your ~/.bashrc successfully!" +echo "Add Variants2neoantigen path to your ~/.bashrc successfully!" echo "==> Please open a new terminal or run source ~/.bashrc handly before using it." + + exit diff --git a/configureArgs b/configureArgs index a332646..c5c4ca5 100644 --- a/configureArgs +++ b/configureArgs @@ -1,15 +1,12 @@ # This file is used to configure default parameters of neoantigens computation -# If you do not know what it means, DO NOT change it!!! -# If you want help, free to send email to +# Please change the content following the provided format +# If you want help, free to send email to or open an issue at ####### <<<<<< Location of Files -##maffiles=$(pwd)/*.maf # location of maf file -##OUTPUT=$(pwd)/neoantigen_results CACHE_VEP=~/.vep/ # directory path of ensembl vep cache PATH_FASTA=~/.vep/homo_sapiens/92_GRCh37/Homo_sapiens.GRCh37.75.dna.primary_assembly.fa # path of reference fasta file -iedb=~/Variants2Neoantigen/data/iedb/iedb.fasta # iedb database used for blastp -##PATH_HLA=~/wangshx/projects/data/ # directory path to patient specific HLA alleles file +iedb=~/Variants2Neoantigen/data/iedb/iedb.fasta # iedb database used for blastp ####### <<<<<< Location of Softwares, python environment and input arguments py_env=pipeline # python environment, which can run pvacseq diff --git a/runNEO_prepare b/runNEO_prepare new file mode 100755 index 0000000..81d4002 --- /dev/null +++ b/runNEO_prepare @@ -0,0 +1,87 @@ +#! /usr/bin/env bash +# Generate configure file before computation. +# input file and HLA must provide + +#################################### +### Parsing option using getopts ### +#################################### + +# i or --input: input maf (or vcf -> enhancement)path +# o or --output: output directory path +# --HLA: HLA file path +# --mode: maf or vcf ? -> enhancement +# --seq: workflow? -> enhancement +optspec=":hi:o:-:" +while getopts "$optspec" optchar; do + case "${optchar}" in + -) + case "${OPTARG}" in + loglevel) + val="${!OPTIND}"; OPTIND=$(( $OPTIND + 1 )) + echo "Parsing option: '--${OPTARG}', value: '${val}'" >&2; + ;; + #loglevel=*) + # val=${OPTARG#*=} + # opt=${OPTARG%=$val} + # echo "Parsing option: '--${opt}', value: '${val}'" >&2 + # ;; + HLA) + val="${!OPTIND}"; OPTIND=$(( $OPTIND + 1 )) + echo "The HLA path is $val"; + PATH_HLA=$val + ;; + *) + if [ "$OPTERR" = 1 ] && [ "${optspec:0:1}" != ":" ]; then + echo "Unknown option --${OPTARG}" >&2 + fi + ;; + esac;; + h) + echo "usage: $0 [-i ] [-o ] [--HLA ]" >&2 + exit 2 + ;; + i) + echo "The input file path is $OPTARG" + maffiles=$OPTARG + ;; + o) + echo "The output directory path is $OPTARG" + OUTPUT=$OPTARG + ;; + *) + if [ "$OPTERR" != 1 ] || [ "${optspec:0:1}" = ":" ]; then + echo "Non-option argument: '-${OPTARG}'" >&2 + exit 2 + fi + ;; + esac +done + +# if variable name is not set, show help info +if [ ! -n "$maffiles" ]; then + runNEO_prepare -h + exit +fi + +if [ ! -n "$OUTPUT" ]; then + OUTPUT=`pwd` +fi + +if [ ! -n "$PATH_HLA" ]; then + runNEO_prepare -h + exit +fi + +# generate a args file +echo "Configuration file generating..." +ShellDIR=$(cd `dirname $0`; pwd) + +source $ShellDIR/configureArgs +cat $ShellDIR/configureArgs | grep -v "^##" | grep -v "ShellDIR" > $(pwd)/inputArgs.txt +echo "maffiles=$maffiles" >> $(pwd)/inputArgs.txt +echo "OUTPUT=$OUTPUT" >> $(pwd)/inputArgs.txt +echo "PATH_HLA=$PATH_HLA" >> $(pwd)/inputArgs.txt +echo "ShellDIR=$ShellDIR" >> $(pwd)/inputArgs.txt + +echo "Configure file inputArgs.txt has been successfully generated in current directory." +echo "Please modify nessary arguments and run runNEO_run to start the pipeline." diff --git a/runNEO_run b/runNEO_run new file mode 100755 index 0000000..3a9cd1c --- /dev/null +++ b/runNEO_run @@ -0,0 +1,38 @@ +#! /usr/bin/env bash +# Run neoantigen computation, which will use configure file in current directory. + + +# load arguments from configure file +source $(pwd)/inputArgs.txt + +source activate $py_env +# check if software commands exist +type blastp >/dev/null 2>&1 || { echo >&2 "blastp is need but it's not installed in $py_env environment . Aborting."; exit 1; } +type pvacseq >/dev/null 2>&1 || { echo >&2 "pvacseq is need but it's not installed in $py_env environment. Aborting."; exit 1; } +type samtools >/dev/null 2>&1 || { echo >&2 "samtools is need but it's not installed in $py_env environment. Aborting."; exit 1; } + +echo ---------------------- +echo --- Pipeline Begin --- +echo ---------------------- + +#step1: transform maf files to vcf files +$ShellDIR/step1-transformMaf2VCF.sh + +# step2: run neoantigen computation, choose only one way as follows to run, other line should be commented + +# serial way +#$ShellDIR/step2-NEOcomputation_serial.sh + +# parallel way +$ShellDIR/step2-NEOcomputation_parallel.sh + +# step3: summary neoantigen results +# $ShellDIR/step3-summaryNeoantigens.sh + +# step3: calculate neoantigen quality +$ShellDIR/step3-neoantigenQcomputation.sh + +echo -------------------- +echo --- Pipeline End --- +echo -------------------- + diff --git a/step3-summaryNeoantigens.sh b/step3-summaryNeoantigens.sh old mode 100644 new mode 100755