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

relecture code YD

parent 5531345a
#!/bin/bash #!/bin/bash
PHARMGKB="" PHARMGKB=""
...@@ -6,7 +5,6 @@ HLASCAN="" ...@@ -6,7 +5,6 @@ HLASCAN=""
BAM="" BAM=""
VCF="" VCF=""
OUTPUTDIR="" OUTPUTDIR=""
PRINT_HELP=0 PRINT_HELP=0
while [[ "$#" -gt 0 ]]; do while [[ "$#" -gt 0 ]]; do
...@@ -17,17 +15,16 @@ while [[ "$#" -gt 0 ]]; do ...@@ -17,17 +15,16 @@ while [[ "$#" -gt 0 ]]; do
-v|--vcf) VCF="$2" ; shift ;; -v|--vcf) VCF="$2" ; shift ;;
-o|--out-directory) OUTPUTDIR="$2" ; shift ;; -o|--out-directory) OUTPUTDIR="$2" ; shift ;;
-h|--help) PRINT_HELP=1 ;; -h|--help) PRINT_HELP=1 ;;
*) echo "Unknown parameter passed: $1"; exit 1 ;; *) echo "Unknown parameter passed: $1"; exit 0 ;;
esac esac
shift shift
done done
if [ ${PRINT_HELP} -eq 1 ] if [ ${PRINT_HELP} -eq 1 ]
then then
echo "Usage:" echo "Usage:"
echo "" 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 ""
echo "<Mandatory>: " echo "<Mandatory>: "
echo "-p <PharmGKB file>: Path to PharmGKB tsv file download at PharmGKB site." echo "-p <PharmGKB file>: Path to PharmGKB tsv file download at PharmGKB site."
...@@ -36,8 +33,7 @@ then ...@@ -36,8 +33,7 @@ then
echo "-v <vcf file>: vcf file provided by variant calling" echo "-v <vcf file>: vcf file provided by variant calling"
echo "-o <OUTPUT_PATH>: Output path." echo "-o <OUTPUT_PATH>: Output path."
echo "" echo ""
exit 1
exit 0
fi fi
# Check pharmgkb file is provided and exists # Check pharmgkb file is provided and exists
...@@ -112,8 +108,7 @@ echo "Output HLAscan: ${OUTPUTDIR}/HLAscan_result/" ...@@ -112,8 +108,7 @@ echo "Output HLAscan: ${OUTPUTDIR}/HLAscan_result/"
echo "Output HTML file: $OUTPUTDIR/Report.html" echo "Output HTML file: $OUTPUTDIR/Report.html"
#HLASCAN #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 #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 ( ...@@ -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. 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) * 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 * PharmGKB csv file
* [download csv file](https://api.pharmgkb.org/v1/download/file/data/clinicalAnnotations.zip) * [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: ...@@ -32,9 +33,9 @@ Reference : Ka, S., Lee, S., Hong, J., Cho, Y., ... & Jung, J. (2017). HLAscan:
## Installation ## Installation
* First install library with pip: * First install library with pip:
* pip2.7 install pysam * pip install pysam
* pip2.7 install sphinx * pip install sphinx
* pip2.7 install htmltag * pip install htmltag
* Clone this repository * Clone this repository
...@@ -50,8 +51,16 @@ https://ftp-trace.ncbi.nlm.nih.gov/giab/ftp/data/NA12878/Nebraska_NA12878_HG001_ ...@@ -50,8 +51,16 @@ https://ftp-trace.ncbi.nlm.nih.gov/giab/ftp/data/NA12878/Nebraska_NA12878_HG001_
### Execution ### 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 #### 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/ 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 \ 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