Commit 187abbf2 authored by simon verdez's avatar simon verdez

relecture code YD

parent 5531345a
#!/bin/bash
PHARMGKB=""
......@@ -6,7 +5,6 @@ HLASCAN=""
BAM=""
VCF=""
OUTPUTDIR=""
PRINT_HELP=0
while [[ "$#" -gt 0 ]]; do
......@@ -17,17 +15,16 @@ while [[ "$#" -gt 0 ]]; do
-v|--vcf) VCF="$2" ; shift ;;
-o|--out-directory) OUTPUTDIR="$2" ; shift ;;
-h|--help) PRINT_HELP=1 ;;
*) echo "Unknown parameter passed: $1"; exit 1 ;;
*) echo "Unknown parameter passed: $1"; exit 0 ;;
esac
shift
done
if [ ${PRINT_HELP} -eq 1 ]
then
echo "Usage:"
echo ""
echo "bash -p <PharmGKB file> -b <bam file> -s <path to hlascan files> -v <vcf file> -o <output dir> -h [show this help]"
echo "bash -p <PharmGKB file> -b <bam file> -s <path to hlascan files> -v <vcf file> -o <output dir> -h [show this help] Extract_PharmGKB_Variants.sh"
echo ""
echo "<Mandatory>: "
echo "-p <PharmGKB file>: Path to PharmGKB tsv file download at PharmGKB site."
......@@ -36,8 +33,7 @@ then
echo "-v <vcf file>: vcf file provided by variant calling"
echo "-o <OUTPUT_PATH>: Output path."
echo ""
exit 0
exit 1
fi
# Check pharmgkb file is provided and exists
......@@ -112,8 +108,7 @@ echo "Output HLAscan: ${OUTPUTDIR}/HLAscan_result/"
echo "Output HTML file: $OUTPUTDIR/Report.html"
#HLASCAN
python2.7 $HLASCAN/hla-paper/haplo_scan_v4.0-hla.py $BAM $HLASCAN/hla-ref-5gene/gene_list $OUTPUTDIR/HLAscan_result/ 1>> $OUTPUTDIR/HLAscan_log.txt 2>> $OUTPUTDIR/HLAscan_log.txt
python $HLASCAN/hla-paper/haplo_scan_v4.0-hla.py $BAM $HLASCAN/hla-ref-5gene/gene_list $OUTPUTDIR/HLAscan_result/ 1>> $OUTPUTDIR/HLAscan_log.txt 2>> $OUTPUTDIR/HLAscan_log.txt
#create HTML
python2.7 create_html.py -v $VCF -h $OUTPUTDIR/HLAscan_result/Report -t $PHARMGKB -o $OUTPUTDIR/Report.html
python create_html.py -v $VCF -s $OUTPUTDIR/HLAscan_result/Report -t $PHARMGKB -o $OUTPUTDIR/Report.html
\ No newline at end of file
......@@ -19,9 +19,10 @@ pysam library. On output, you have a HTML file readable with any web navigator (
Reference : Ka, S., Lee, S., Hong, J., Cho, Y., ... & Jung, J. (2017). HLAscan: genotyping of the HLA region using next-generation sequencing data. BMC bioinformatics, 18(1), 258.
* Python2.7:
* Python:
* Tested with python2.7 and python3.9
* library: pysam , htmltag (required sphinx)
* [download python2.7](https://www.python.org/download/releases/2.7/)
* [download python](https://www.python.org/download/releases/)
* PharmGKB csv file
* [download csv file](https://api.pharmgkb.org/v1/download/file/data/clinicalAnnotations.zip)
......@@ -32,9 +33,9 @@ Reference : Ka, S., Lee, S., Hong, J., Cho, Y., ... & Jung, J. (2017). HLAscan:
## Installation
* First install library with pip:
* pip2.7 install pysam
* pip2.7 install sphinx
* pip2.7 install htmltag
* pip install pysam
* pip install sphinx
* pip install htmltag
* Clone this repository
......@@ -50,8 +51,16 @@ https://ftp-trace.ncbi.nlm.nih.gov/giab/ftp/data/NA12878/Nebraska_NA12878_HG001_
### Execution
bash -p <PharmGKB file> -b <bam file> -s <path to HLAscan files> -v <vcf file> -o <output dir>
bash -p <PharmGKB file> -b <bam file> -s <path to HLAscan files> -v <vcf file> -o <output dir> Extract_PharmGKB_Variants.sh
Options:
-p <PharmGKB file>: Path to PharmGKB tsv file download at PharmGKB site.
-b <bam file>: Bam file provided by alignement.
-s <path to hlascan files>: Path to HLAscan tools download and unzipped.
-v <vcf file>: vcf file provided by variant calling
-o <OUTPUT_PATH>: Output path.
-h print help
#### Data test
bash -p data_test/PharmGKB_Epilepsy.tsv -b data_test/NA12878.5gene.bam -s <path to HLAscan files> -v data_test/NIST-hg001-7001-b-gatk.vcf -o data_test/
\ No newline at end of file
bash -p data_test/PharmGKB_Epilepsy.tsv -b data_test/NA12878.5gene.bam -s <path to HLAscan files> -v data_test/NIST-hg001-7001-b-gatk.vcf -o data_test/ Extract_PharmGKB_Variants.sh
\ No newline at end of file
This diff is collapsed.
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