Commit a7651044 authored by Pradat Yoann's avatar Pradat Yoann
Browse files

add .travis.yml

parent 88c7bddd
# Tags
*tags
# Logs
log/
*.log
......
......@@ -6,17 +6,14 @@ python:
- 3.6
- 3.7
- 3.8
- nightly
after_success:
- julia -e 'using Pkg; cd(Pkg.dir("MyPkg")); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())'
- bash <(curl -s https://codecov.io/bash)
before_install:
- ls
branches:
only:
- master
- /^dev/
install: make install
jobs:
allow_failures:
- julia: nightly
script:
- make test
after_script:
- coveralls
......@@ -2,14 +2,40 @@ PYTHON ?= python
PYTEST ?= pytest
CTAGS ?= ctags
init:
pip install -r requirements.txt
ifeq (,$(CONDA_PREFIX))
CONDA_ACTIVATED=True
else
CONDA_ACTIVATED=False
endif
#environment:
#ifeq (True, $(CONDA_ACTIVATED))
# @echo ">>> Found $(CONDA_PREFIX) environment activated. Install the requirements in this environment."
# conda env update --file reqs/requirements.yml
#else
# pip install -r requirements.txt
#endif
clean:
$(PYTHON) setup.py clean
# installation instructions are not clear to me:
# setup.py install -> the package cannot be imported from outside the repository even though he is
# visible in the conda list as <develop> in the same way as when
# setup.py develop -> everything is ok
#install: clean-ctags
# $(PYTHON) setup.py install
install: ctags
$(PYTHON) setup.py develop
develop: ctags
$(PYTHON) setup.py develop
test:
$(PYTEST) --cov-config=.coveragerc --cov-report term-missing --cov variant_annotator variant_annotator
ctags:
$(CTAGS) --python-kinds=-i --exclude=*/tests/* variant_annotator
$(CTAGS) --python-kinds=-i --exclude=*/tests/* -R variant_annotator
clean:
clean-ctags:
rm -f tags
#version 2.4
Hugo_Symbol Entrez_Gene_Id Center NCBI_Build Chromosome Start_Position End_Position Strand Variant_Classification Variant_Type Reference_Allele Tumor_Seq_Allele1 Tumor_Seq_Allele2 dbSNP_RS dbSNP_Val_Status Tumor_Sample_Barcode Matched_Norm_Sample_Barcode Match_Norm_Seq_Allele1 Match_Norm_Seq_Allele2 Tumor_Validation_Allele1 Tumor_Validation_Allele2 Match_Norm_Validation_Allele1 Match_Norm_Validation_Allele2 Verification_Status Validation_Status Mutation_Status Sequencing_Phase Sequence_Source Validation_Method Score BAM_File Sequencer Tumor_Sample_UUID Matched_Norm_Sample_UUID HGVSc HGVSp HGVSp_Short Transcript_ID Exon_Number t_depth t_ref_count t_alt_count n_depth n_ref_count n_alt_count all_effects Allele Gene Feature Feature_type Consequence cDNA_position CDS_position Protein_position Amino_acids Codons Existing_variation ALLELE_NUM DISTANCE STRAND_VEP SYMBOL SYMBOL_SOURCE HGNC_ID BIOTYPE CANONICAL CCDS ENSP SWISSPROT TREMBL UNIPARC RefSeq SIFT PolyPhen EXON INTRON DOMAINS AF AFR_AF AMR_AF ASN_AF EAS_AF EUR_AF SAS_AF AA_AF EA_AF CLIN_SIG SOMATIC PUBMED MOTIF_NAME MOTIF_POS HIGH_INF_POS MOTIF_SCORE_CHANGE IMPACT PICK VARIANT_CLASS TSL HGVS_OFFSET PHENO MINIMISED ExAC_AF ExAC_AF_AFR ExAC_AF_AMR ExAC_AF_EAS ExAC_AF_FIN ExAC_AF_NFE ExAC_AF_OTH ExAC_AF_SAS GENE_PHENO FILTER flanking_bps vcf_id vcf_qual ExAC_AF_Adj ExAC_AC_AN_Adj ExAC_AC_AN ExAC_AC_AN_AFR ExAC_AC_AN_AMR ExAC_AC_AN_EAS ExAC_AC_AN_FIN ExAC_AC_AN_NFE ExAC_AC_AN_OTH ExAC_AC_AN_SAS ExAC_FILTER gnomAD_AF gnomAD_AFR_AF gnomAD_AMR_AF gnomAD_ASJ_AF gnomAD_EAS_AF gnomAD_FIN_AF gnomAD_NFE_AF gnomAD_OTH_AF gnomAD_SAS_AF vcf_pos
FAM131C 348487 . GRCh37 1 16386305 16386306 + Intron INS - - C rs372070031 TCGA-A1-A0SD-01A-11D-A10Y-09 TCGA-A1-A0SD-10A-01D-A110-09 - - c.451+58dup ENST00000375662 FAM131C,intron_variant,,ENST00000375662,NM_182623.2;CLCNKB,downstream_gene_variant,,ENST00000375667,NM_001165945.2;CLCNKB,downstream_gene_variant,,ENST00000375679,NM_000085.4;CLCNKB,downstream_gene_variant,,ENST00000431772,;FAM131C,intron_variant,,ENST00000494078,; C ENSG00000185519 ENST00000375662 Transcript intron_variant rs372070031 1 -1 FAM131C HGNC 26717 protein_coding YES CCDS41270.1 ENSP00000364814 Q96AQ9 UPI000022B016 NM_182623.2 5/6 0.2731 0.3573 0.3581 0.3757 0.5051 MODIFIER 1 insertion PASS GGC rs143272992 50 16386305
ZIC4 84107 . GRCh37 3 147121630 147121631 + Intron DEL TC TC - rs142316820 TCGA-A1-A0SD-01A-11D-A10Y-09 TCGA-A1-A0SD-10A-01D-A110-09 TC TC c.135+120_135+121del ENST00000525172 ZIC4,intron_variant,,ENST00000383075,NM_032153.5;ZIC4,intron_variant,,ENST00000425731,NM_001168379.1;ZIC4,intron_variant,,ENST00000462748,;ZIC4,intron_variant,,ENST00000463250,;ZIC4,intron_variant,,ENST00000473123,;ZIC4,intron_variant,,ENST00000484399,;ZIC1,intron_variant,,ENST00000488404,;ZIC4,intron_variant,,ENST00000491672,NM_001243256.1;ZIC4,intron_variant,,ENST00000525172,NM_001168378.1;ZIC4,upstream_gene_variant,,ENST00000484586,;ZIC1,intron_variant,,ENST00000472523,;ZIC4,downstream_gene_variant,,ENST00000464144,; - ENSG00000174963 ENST00000525172 Transcript intron_variant rs142316820 1 -1 ZIC4 HGNC 20393 protein_coding YES CCDS54652.1 ENSP00000435509 Q8N9L1 C9JZU7,C9JD04,C9J6T3,B3KPI4 UPI0001914D88 NM_001168378.1 1/4 MODIFIER 1 deletion 1 PASS GATCT . 50 147121629
EIF4G1 1981 . GRCh37 3 184043926 184043927 + Intron DEL AC AC - rs34901174 TCGA-A1-A0SD-01A-11D-A10Y-09 TCGA-A1-A0SD-10A-01D-A110-09 AC AC c.3243+217_3243+218del ENST00000424196 EIF4G1,intron_variant,,ENST00000319274,;EIF4G1,intron_variant,,ENST00000342981,NM_182917.4;EIF4G1,intron_variant,,ENST00000346169,NM_198241.2;EIF4G1,intron_variant,,ENST00000350481,NM_198242.2;EIF4G1,intron_variant,,ENST00000352767,NM_001194947.1;EIF4G1,intron_variant,,ENST00000382330,NM_001194946.1;EIF4G1,intron_variant,,ENST00000392537,NM_198244.2;EIF4G1,intron_variant,,ENST00000411531,;EIF4G1,intron_variant,,ENST00000414031,;EIF4G1,intron_variant,,ENST00000424196,;EIF4G1,intron_variant,,ENST00000427845,;EIF4G1,intron_variant,,ENST00000434061,NM_004953.4;EIF4G1,intron_variant,,ENST00000435046,;EIF4G1,intron_variant,,ENST00000441154,;EIF2B5,intron_variant,,ENST00000444495,;EIF4G1,intron_variant,,ENST00000448284,;EIF4G1,downstream_gene_variant,,ENST00000421110,;EIF4G1,downstream_gene_variant,,ENST00000426123,;EIF4G1,downstream_gene_variant,,ENST00000427607,;EIF4G1,downstream_gene_variant,,ENST00000428387,;EIF4G1,downstream_gene_variant,,ENST00000444134,;EIF4G1,downstream_gene_variant,,ENST00000444861,;EIF4G1,downstream_gene_variant,,ENST00000450424,;EIF4G1,downstream_gene_variant,,ENST00000457456,;SNORD66,downstream_gene_variant,,ENST00000390856,NR_003055.1;EIF4G1,intron_variant,,ENST00000442406,;EIF4G1,intron_variant,,ENST00000466311,;EIF4G1,downstream_gene_variant,,ENST00000413967,;EIF4G1,upstream_gene_variant,,ENST00000422614,;EIF4G1,upstream_gene_variant,,ENST00000460829,;EIF4G1,upstream_gene_variant,,ENST00000464548,;EIF4G1,upstream_gene_variant,,ENST00000475721,;EIF4G1,upstream_gene_variant,,ENST00000482303,;EIF4G1,downstream_gene_variant,,ENST00000484862,;EIF4G1,downstream_gene_variant,,ENST00000493299,; - ENSG00000114867 ENST00000424196 Transcript intron_variant rs34901174 1 1 EIF4G1 HGNC 3296 protein_coding YES CCDS54687.1 ENSP00000416255 Q04637 Q96I65,C9JWW9,C9JWH7,C9JSU8,C9J987,C9J6B6,C9J556 UPI00015E0966 20/31 MODIFIER 1 deletion 1 PASS AAACA rs112208190 50 184043925
STEAP1B 256227 . GRCh37 7 22533452 22533453 + Frame_Shift_Del DEL CA CA - novel TCGA-A1-A0SD-01A-11D-A10Y-09 TCGA-A1-A0SD-10A-01D-A110-09 CA CA c.87_88del p.His29GlnfsTer24 p.H29Qfs*24 ENST00000404369 3/5 STEAP1B,frameshift_variant,p.His29GlnfsTer24,ENST00000404369,NM_001164460.1;STEAP1B,frameshift_variant,p.His29GlnfsTer24,ENST00000424363,;STEAP1B,frameshift_variant,p.His29GlnfsTer24,ENST00000439708,;STEAP1B,intron_variant,,ENST00000406890,NM_207342.2;STEAP1B,splice_region_variant,,ENST00000483679,; - ENSG00000105889 ENST00000404369 Transcript frameshift_variant,splice_region_variant 503-504/1515 87-88/1029 29-30/342 HE/QX caTGag/caag 1 -1 STEAP1B HGNC 41907 protein_coding YES CCDS56469.1 ENSP00000384370 C9JL51,C9JE84,B5MCI2 UPI000173A267 NM_001164460.1 3/5 PANTHER:PTHR14239:SF3,PANTHER:PTHR14239 HIGH 1 deletion PASS CTCAT rs116873396 50 22533451
TEX12 56158 . GRCh37 11 112042480 112042480 + Intron DEL T T - rs1225064086 TCGA-A1-A0SD-01A-11D-A10Y-09 TCGA-A1-A0SD-10A-01D-A110-09 T T c.228-9del ENST00000280358 TEX12,intron_variant,,ENST00000280358,NM_031275.4;TEX12,intron_variant,,ENST00000530752,;AP002884.3,intron_variant,,ENST00000532612,;BCO2,upstream_gene_variant,,ENST00000357685,;BCO2,upstream_gene_variant,,ENST00000361053,NM_001256398.1;BCO2,upstream_gene_variant,,ENST00000393032,NM_031938.5;BCO2,upstream_gene_variant,,ENST00000438022,;BCO2,upstream_gene_variant,,ENST00000526088,NM_001037290.2,NM_001256397.1;BCO2,upstream_gene_variant,,ENST00000531169,;BCO2,upstream_gene_variant,,ENST00000532593,NM_001256400.1;RP11-356J5.4,intron_variant,,ENST00000527589,;SDHD,intron_variant,,ENST00000525468,;SDHD,intron_variant,,ENST00000525987,;SDHD,intron_variant,,ENST00000531744,;SDHD,intron_variant,,ENST00000532699,;BCO2,upstream_gene_variant,,ENST00000460924,;BCO2,upstream_gene_variant,,ENST00000461480,;BCO2,upstream_gene_variant,,ENST00000494860,;BCO2,upstream_gene_variant,,ENST00000527939,;BCO2,upstream_gene_variant,,ENST00000531003,;BCO2,upstream_gene_variant,,ENST00000534122,;BCO2,upstream_gene_variant,,ENST00000534550,; - ENSG00000150783 ENST00000280358 Transcript intron_variant rs1225064086 1 1 TEX12 HGNC 11734 protein_coding YES CCDS31679.1 ENSP00000280358 Q9BXU0 UPI00001377E3 NM_031275.4 4/4 MODIFIER 1 deletion PASS ACTT . 50 1.711e-05 8.319e-05 8.285e-05 1.133e-05 112042479
KMT2D 8085 . GRCh37 12 49431403 49431404 + Frame_Shift_Ins INS - - T novel TCGA-A1-A0SD-01A-11D-A10Y-09 TCGA-A1-A0SD-10A-01D-A110-09 - - c.9735dup p.Pro3246ThrfsTer5 p.P3246Tfs*5 ENST00000301067 34/54 KMT2D,frameshift_variant,p.Pro3246ThrfsTer5,ENST00000301067,NM_003482.3;KMT2D,upstream_gene_variant,,ENST00000549743,;KMT2D,downstream_gene_variant,,ENST00000549799,; T ENSG00000167548 ENST00000301067 Transcript frameshift_variant 9735-9736/19419 9735-9736/16614 3245-3246/5537 -/X -/A 1 -1 KMT2D HGNC 7133 protein_coding YES CCDS44873.1 ENSP00000301067 O14686 Q6PIA1,Q59FG6,F8VWW4 UPI0000EE84D6 NM_003482.3 34/54 PANTHER:PTHR22884,PANTHER:PTHR22884:SF324 HIGH 1 insertion 1 PASS GGT . 50 49431403
PDS5B 23047 . GRCh37 13 33332314 33332314 + Frame_Shift_Del DEL A A - novel TCGA-A1-A0SD-01A-11D-A10Y-09 TCGA-A1-A0SD-10A-01D-A110-09 A A c.3148del p.Thr1050GlnfsTer12 p.T1050Qfs*12 ENST00000315596 27/35 PDS5B,frameshift_variant,p.Thr1050GlnfsTer12,ENST00000315596,NM_015032.3;PDS5B,frameshift_variant,p.Thr4GlnfsTer12,ENST00000447833,;PDS5B,frameshift_variant,p.Thr1050GlnfsTer12,ENST00000450460,; - ENSG00000083642 ENST00000315596 Transcript frameshift_variant 3332/7497 3146/4344 1049/1447 Q/X cAa/ca 1 1 PDS5B HGNC 20418 protein_coding YES CCDS41878.1 ENSP00000313851 Q9NTI5 UPI000006D4A9 NM_015032.3 27/35 PANTHER:PTHR12663,PANTHER:PTHR12663:SF1 HIGH 1 deletion 2 PASS ACAA . 50 33332313
CCR7 1236 . GRCh37 17 38712161 38712161 + Intron DEL T T - rs372297045 TCGA-A1-A0SD-01A-11D-A10Y-09 TCGA-A1-A0SD-10A-01D-A110-09 T T c.61-91del ENST00000246657 CCR7,intron_variant,,ENST00000246657,NM_001838.3;CCR7,intron_variant,,ENST00000578085,;CCR7,intron_variant,,ENST00000579344,; - ENSG00000126353 ENST00000246657 Transcript intron_variant rs372297045 1 -1 CCR7 HGNC 1608 protein_coding YES CCDS11369.1 ENSP00000246657 P32248 J3KTN5,J3KSS9,A0N0Q0 UPI0000001C2F NM_001838.3 2/2 0.004 MODIFIER 1 deletion 1 PASS TCTT . 50 38712160
ATP9A 10079 . GRCh37 20 50342307 50342308 + Intron DEL TC TC - novel TCGA-A1-A0SD-01A-11D-A10Y-09 TCGA-A1-A0SD-10A-01D-A110-09 TC TC c.327+50_327+51del ENST00000338821 ATP9A,intron_variant,,ENST00000311637,;ATP9A,intron_variant,,ENST00000338821,NM_006045.1;ATP9A,intron_variant,,ENST00000402822,;ATP9A,downstream_gene_variant,,ENST00000477492,;,regulatory_region_variant,,ENSR00001644001,; - ENSG00000054793 ENST00000338821 Transcript intron_variant 1 -1 ATP9A HGNC 13540 protein_coding YES CCDS33489.1 ENSP00000342481 O75110 Q2NLD0,B4DR18 UPI000004D334 NM_006045.1 3/27 MODIFIER 1 deletion PASS TTTCT . 50 50342306
## ENSEMBL VARIANT EFFECT PREDICTOR v101.0
## Output produced at 2020-10-30 16:15:42
## Output produced at 2020-10-30 17:08:17
## Using cache in /Users/ypradat/.vep/homo_sapiens/101_GRCh37
## Using API version 101, DB version ?
## ensembl-funcgen version 101.b918a49
## ensembl-io version 101.943b6c2
## ensembl-variation version 101.851c7e0
## ensembl version 101.856c8e8
## gnomAD version r2.1
## dbSNP version 153
## gencode version GENCODE 19
## ensembl-variation version 101.851c7e0
## genebuild version 2011-04
## gencode version GENCODE 19
## dbSNP version 153
## gnomAD version r2.1
## 1000genomes version phase3
## ESP version 20141103
## COSMIC version 90
## polyphen version 2.2.2
## assembly version GRCh37.p13
## 1000genomes version phase3
## ClinVar version 201912
## HGMD-PUBLIC version 20194
## ClinVar version 201912
## sift version sift5.2.2
## polyphen version 2.2.2
## regbuild version 1.0
## COSMIC version 90
## Column descriptions:
## Uploaded_variation : Identifier of uploaded variant
## Location : Location of variant in standard coordinate format (chr:start or chr:start-end)
......@@ -87,12 +87,3 @@
## MOTIF_SCORE_CHANGE : The difference in motif score of the reference and variant sequences for the TFBP
## TRANSCRIPTION_FACTORS : List of transcription factors which bind to the transcription factor binding profile
#Uploaded_variation Location Allele Gene Feature Feature_type Consequence cDNA_position CDS_position Protein_position Amino_acids Codons Existing_variation Extra
rs143272992 1:16386305-16386306 C ENSG00000185519 ENST00000375662.4 Transcript intron_variant - - - - - rs372070031 IMPACT=MODIFIER;STRAND=-1;SYMBOL=FAM131C;SYMBOL_SOURCE=HGNC;HGNC_ID=26717;BIOTYPE=protein_coding;CANONICAL=YES;CCDS=CCDS41270.1;ENSP=ENSP00000364814;SWISSPROT=Q96AQ9;UNIPARC=UPI000022B016;INTRON=5/6;HGVSc=ENST00000375662.4:c.451+58dup;AFR_AF=0.2731;AMR_AF=0.3573;EAS_AF=0.3581;EUR_AF=0.3757;SAS_AF=0.5051;MAX_AF=0.5051;MAX_AF_POPS=SAS
3_147121630_TC/- 3:147121630-147121631 - ENSG00000174963 ENST00000525172.2 Transcript intron_variant - - - - - rs142316820 IMPACT=MODIFIER;STRAND=-1;SYMBOL=ZIC4;SYMBOL_SOURCE=HGNC;HGNC_ID=20393;BIOTYPE=protein_coding;CANONICAL=YES;CCDS=CCDS54652.1;ENSP=ENSP00000435509;SWISSPROT=Q8N9L1;TREMBL=C9JZU7,C9JD04,C9J6T3,B3KPI4;UNIPARC=UPI0001914D88;INTRON=1/4;HGVSc=ENST00000525172.2:c.135+120_135+121del
rs112208190 3:184043926-184043927 - ENSG00000114867 ENST00000424196.1 Transcript intron_variant - - - - - rs34901174 IMPACT=MODIFIER;STRAND=1;SYMBOL=EIF4G1;SYMBOL_SOURCE=HGNC;HGNC_ID=3296;BIOTYPE=protein_coding;CANONICAL=YES;CCDS=CCDS54687.1;ENSP=ENSP00000416255;SWISSPROT=Q04637;TREMBL=Q96I65,C9JWW9,C9JWH7,C9JSU8,C9J987,C9J6B6,C9J556;UNIPARC=UPI00015E0966;INTRON=20/31;HGVSc=ENST00000424196.1:c.3243+217_3243+218del
rs116873396 7:22533452-22533453 - ENSG00000105889 ENST00000404369.4 Transcript frameshift_variant,splice_region_variant 503-504 87-88 29-30 HE/QX caTGag/caag - IMPACT=HIGH;STRAND=-1;SYMBOL=STEAP1B;SYMBOL_SOURCE=HGNC;HGNC_ID=41907;BIOTYPE=protein_coding;CANONICAL=YES;CCDS=CCDS56469.1;ENSP=ENSP00000384370;TREMBL=C9JL51,C9JE84,B5MCI2;UNIPARC=UPI000173A267;EXON=3/5;HGVSc=ENST00000404369.4:c.87_88del;HGVSp=ENSP00000384370.4:p.His29GlnfsTer24
11_112042480_T/- 11:112042480 - ENSG00000150783 ENST00000280358.4 Transcript intron_variant - - - - - rs1225064086 IMPACT=MODIFIER;STRAND=1;SYMBOL=TEX12;SYMBOL_SOURCE=HGNC;HGNC_ID=11734;BIOTYPE=protein_coding;CANONICAL=YES;CCDS=CCDS31679.1;ENSP=ENSP00000280358;SWISSPROT=Q9BXU0;UNIPARC=UPI00001377E3;INTRON=4/4;HGVSc=ENST00000280358.4:c.228-9del;gnomAD_AF=1.711e-05;gnomAD_AFR_AF=8.319e-05;gnomAD_AMR_AF=0;gnomAD_ASJ_AF=0;gnomAD_EAS_AF=8.285e-05;gnomAD_FIN_AF=0;gnomAD_NFE_AF=1.133e-05;gnomAD_OTH_AF=0;gnomAD_SAS_AF=0;MAX_AF=8.319e-05;MAX_AF_POPS=gnomAD_AFR
12_49431404_-/T 12:49431403-49431404 T ENSG00000167548 ENST00000301067.7 Transcript frameshift_variant 9735-9736 9735-9736 3245-3246 -/X -/A - IMPACT=HIGH;STRAND=-1;SYMBOL=KMT2D;SYMBOL_SOURCE=HGNC;HGNC_ID=7133;BIOTYPE=protein_coding;CANONICAL=YES;CCDS=CCDS44873.1;ENSP=ENSP00000301067;SWISSPROT=O14686;TREMBL=Q6PIA1,Q59FG6,F8VWW4;UNIPARC=UPI0000EE84D6;EXON=34/54;HGVSc=ENST00000301067.7:c.9735dup;HGVSp=ENSP00000301067.7:p.Pro3246ThrfsTer5
13_33332314_A/- 13:33332314 - ENSG00000083642 ENST00000315596.10 Transcript frameshift_variant 3332 3146 1049 Q/X cAa/ca - IMPACT=HIGH;STRAND=1;SYMBOL=PDS5B;SYMBOL_SOURCE=HGNC;HGNC_ID=20418;BIOTYPE=protein_coding;CANONICAL=YES;CCDS=CCDS41878.1;ENSP=ENSP00000313851;SWISSPROT=Q9NTI5;UNIPARC=UPI000006D4A9;EXON=27/35;HGVSc=ENST00000315596.10:c.3148del;HGVSp=ENSP00000313851.10:p.Thr1050GlnfsTer12;HGVS_OFFSET=2
17_38712161_T/- 17:38712161 - ENSG00000126353 ENST00000246657.2 Transcript intron_variant - - - - - rs372297045 IMPACT=MODIFIER;STRAND=-1;SYMBOL=CCR7;SYMBOL_SOURCE=HGNC;HGNC_ID=1608;BIOTYPE=protein_coding;CANONICAL=YES;CCDS=CCDS11369.1;ENSP=ENSP00000246657;SWISSPROT=P32248;TREMBL=J3KTN5,J3KSS9,A0N0Q0;UNIPARC=UPI0000001C2F;INTRON=2/2;HGVSc=ENST00000246657.2:c.61-91del;AFR_AF=0;AMR_AF=0;EAS_AF=0.004;EUR_AF=0;SAS_AF=0;MAX_AF=0.004;MAX_AF_POPS=EAS
20_50342307_TC/- 20:50342307-50342308 - ENSG00000054793 ENST00000338821.5 Transcript intron_variant - - - - - - IMPACT=MODIFIER;STRAND=-1;SYMBOL=ATP9A;SYMBOL_SOURCE=HGNC;HGNC_ID=13540;BIOTYPE=protein_coding;CANONICAL=YES;CCDS=CCDS33489.1;ENSP=ENSP00000342481;SWISSPROT=O75110;TREMBL=Q2NLD0,B4DR18;UNIPARC=UPI000004D334;INTRON=3/27;HGVSc=ENST00000338821.5:c.327+50_327+51del
channels:
- defaults
dependencies:
- numpy
- pandas
- pytest
- pytest-cov
- ipython
from setuptools import setup
import os
from setuptools import setup, Command
class CleanCommand(Command):
user_options = []
def initialize_options(self):
self.cwd = None
def finalize_options(self):
self.cwd = os.getcwd()
def run(self):
assert os.getcwd() == self.cwd, 'Must be in package root: %s' % self.cwd
os.system ('rm -rf ./build ./dist ./*.pyc ./*.tgz ./*.egg-info')
setup(
name = "variant_annotator",
......@@ -9,4 +20,8 @@ setup(
"numpy",
"pandas",
],
cmdclass={
'clean': CleanCommand
}
)
[run]
omit = */__init__.py, *tests*
"""
The :mod:`variant_annotator` module defines functions for annotating variants using a combination of manual, vep and
vcf2maf annotations.
"""
from ._main import run_annotator
from ._manual import run_manual_annotator
from ._vcf2maf import run_vcf2maf_annotator
from ._vep import run_vep_annotator
__all__ = [
'run_annotator',
'run_manual_annotator',
'run_vcf2maf_annotator',
'run_vep_annotator'
]
# -*- coding: utf-8 -*-
"""
@created: Aug 13 2020
@modified: Oct 30 2020
@author: Yoann Pradat
CentraleSupelec
MICS laboratory
9 rue Juliot Curie, Gif-Sur-Yvette, 91190 France
Main functions for running each step and the assembling step.
"""
import os
import numpy as np
import pandas as pd
from typing import Union
from ._manual import run_manual_annotator
from ._vcf2maf import run_vcf2maf_annotator
from ._vep import run_vep_annotator
DataFrame = pd.core.frame.DataFrame
#### # FUNCTION FOR ONE VCF
#### # #######################################################################################################
from dataclasses import dataclass, field
@dataclass
class VepConfig:
"""
Config for running VEP inside VCF2MAF and separately (custom options, optional).
Parameters
--------
data: str
path to the .vep data where the reference genome is located. Default: $HOME/.vep
fasta: str
relative path to fasta file from folder. Default
"$HOME/.vep/homo_sapiens/101_GRCh37/Homo_sapiens.GRCh37.75.dna.primary_assembly.fa"
n_fork: int, optional.
number of forks to be used when running VEP. Use at least 2.
custom_run: bool, optional
set to True to run VEP separately from vcf2maf.
custom_opt: str or list, optional.
additional options to add to the vep cmd. For instance
'--custom ~/.vep/custom/ClinVar/clinvar.vcf.gz,ClinVar,vcf,exact,0,CLNSIG,CLNREVSTAT,CLNDN'
custom_overwrite: bool, optional.
set to True to overwrite any existing previous custom run of VEP.
"""
data: str=os.path.expanduser("~/.vep")
fasta: str=os.path.expanduser("~/.vep/homo_sapiens/101_GRCh37/Homo_sapiens.GRCh37.75.dna.primary_assembly.fa")
n_fork: int=4
custom_run: bool=False
custom_opt: Union[str, list]=None
custom_overwrite: bool=False
@dataclass
class Vcf2mafConfig:
"""
Run vcf2maf. For VEP-related options, see VepConfig class.
Parameters
--------
run: bool, optional
set to False to not use vcf2maf.
overwrite: bool, optional.
set to True to overwrite any existing previous run of vcf2maf.
"""
run: bool=True
overwrite: bool=False
def run_annotator(vcf_folder: str, vcf_file: str, col_normal: str, col_tumor: str, tumor_id: str, normal_id: str,
infos_n_reads: list, infos_other: list, dt_folders: dict, vcf2maf_config: Vcf2mafConfig,
vep_config: VepConfig, dt_identifiers: dict=None) -> None:
"""
Run the manual, vcf2maf and/or vep annotations on one VCF file and assemble.
Parameters
--------
vcf_file: str
name of the vcf file
vcf_folder: str
path to the folder where the vcf is
col_normal: str
name of the column in the vcf for the normal sample
col_tumor: str
name of the column in the vcf for the tumor sample
infos_n_reads: list
list of sigles that contain read info
infos_other: list
list of sigles that need extraction
dt_folders: dict
dict with the following keys:
* manual_out_folder
* vcf2maf_tmp_folder
* vcf2maf_out_folder
* vep_out_folder
* maf_folder
vcf2maf_config: object
See Vcf2mafConfig class.
vep_config: object
See VepConfig class.
dt_identifiers: dict, optional
dict with key, value pairs that will be added as single-value columns in the maf file
"""
vcf_path = os.path.join(vcf_folder, vcf_file)
out_file = vcf_file.replace(".vcf", ".txt")
#### # 1. RUN EACH ANNOTATOR
#### # ###################################################################################################
manual_out_path = os.path.join(dt_folders["manual_out_folder"], out_file)
run_manual_annotator(
vcf_path = vcf_path,
out_path = manual_out_path,
col_normal = col_normal,
col_tumor = col_tumor,
infos_n_reads = infos_n_reads,
infos_other = infos_other
)
if vcf2maf_config.run:
vcf2maf_out_path = os.path.join(dt_folders["vcf2maf_out_folder"], out_file)
run_vcf2maf_annotator(
vep_data = vep_config.data,
vep_n_fork = vep_config.n_fork,
vcf_path = vcf_path,
out_path = vcf2maf_out_path,
tmp_folder = dt_folders["vcf2maf_tmp_folder"],
tumor_id = tumor_id,
normal_id = normal_id,
fasta = vep_config.fasta,
overwrite = vcf2maf_config.overwrite
)
if vep_config.custom_run:
vep_out_path = os.path.join(dt_folders["vep_out_folder"], out_file)
run_vep_annotator(
vep_data = vep_config.data,
vep_n_fork = vep_config.n_fork,
vcf_path = vcf_path,
out_path = vep_out_path,
fasta = vep_config.fasta,
vep_custom = vep_config.custom_opt,
overwrite = vep_config.custom_overwrite,
)
#### # 2. ASSEMBLE ANNOTATIONS
#### ######################################################################################################
ddf_maf = {}
#### vep manual
ddf_maf["manual"] = pd.read_csv(
filepath_or_buffer = manual_out_path,
sep = "\t"
)
if dt_identifiers is not None:
for k,v in dt_identifiers.items():
ddf_maf["manual"].insert(0, k, v)
#### maf vcf2maf
if vcf2maf_config.run:
skipsymbol = "#"
with open(vcf2maf_out_path) as file:
skiprows = sum(line.startswith(skipsymbol) for line in file.readlines())
ddf_maf["vcf2maf"] = pd.read_csv(
filepath_or_buffer = vcf2maf_out_path,
sep = "\t",
skiprows = skiprows
)
#### vep custom
if vep_config.custom_run:
skipsymbol = "##"
with open(vep_out_path) as file:
skiprows = sum(line.startswith(skipsymbol) for line in file.readlines())
df_alone = pd.read_csv(
filepath_or_buffer = vep_out_path,
sep = "\t",
skiprows = skiprows
)
df_alone_extra = df_alone.Extra.apply(lambda x: dict(item.split("=") for item in x.split(";")))
df_alone_extra = df_alone_extra.apply(pd.Series)
df_alone = pd.concat((df_alone, df_alone_extra), axis=1)
ddf_maf["alone"] = df_alone
#### check that all scripts ran ok the vcf file
#### by check that all maf files have the same number of lines
list_n_rows = [df_maf.shape[0] for df_maf in ddf_maf.values()]
if len(set(list_n_rows)) > 1:
print("SHAPE error: not all MAF have the same number of rows")
#### choose column per source
#### take all columns from VCF2MAF except for some that are from the manual extraction
#### for instance: reads number are sometimes not extracted by VCF2MAF
maf_columns = []
cols_manual = [x for x in ddf_maf["manual"].columns if x.startswith(("n_", "t_"))] + [
"Variant_Quality",
"Filter_VCF",
"Tumor_Sample_UUID",
"Matched_Norm_Sample_UUID",
]
for column in cols_manual:
if column not in ddf_maf["manual"].columns:
#### UUID is for instance only available for TCGA projects
print("WARNING: %s is not in manual" % column, flush=True)
else:
maf_columns.append(ddf_maf["manual"][column])
if vcf2maf_config.run and vep_config.custom_run:
#### add flags column source
#### vcf2maf
ddf_maf["vcf2maf"].columns = ["%s_VCF2MAF" % x for x in ddf_maf["vcf2maf"].columns]
for column in ddf_maf["vcf2maf"].columns:
if column in dt_identifiers.keys() or column in cols_manual:
#### prioritize identifiers from input
pass
else:
maf_columns.append(ddf_maf["vcf2maf"][column])
#### vep
ddf_maf["alone"].columns = ["%s_VEP" % x for x in ddf_maf["alone"].columns]
for column in ddf_maf["alone"].columns:
maf_columns.append(ddf_maf["alone"][column])
elif vcf2maf_config.run:
#### vcf2maf
for column in ddf_maf["vcf2maf"].columns:
if column in dt_identifiers.keys() or column in cols_manual:
#### prioritize identifiers from input
pass
else:
maf_columns.append(ddf_maf["vcf2maf"][column])
elif vep_config.custom_run:
#### vep
for column in ddf_maf["alone"].columns:
maf_columns.append(ddf_maf["alone"][column])
#### add identifier columns if any
if dt_identifiers is not None:
for column in dt_identifiers.keys():
if column not in ddf_maf["manual"].columns:
print("WARNING: %s is not in manual" % column, flush=True)
else:
maf_columns.append(ddf_maf["manual"][column])
#### # 3. SAVE
#### ######################################################################################################
maf_out_path = os.path.join(dt_folders["maf_folder"], out_file)
df_maf = pd.concat(maf_columns, axis=1)
df_maf.to_csv(
path_or_buf = maf_out_path,
sep = "\t",
header = True,
index = False
)
print("maf file saved at %s" % maf_out_path, flush=True)
# -*- coding: utf-8 -*-
"""
@created: Aug 13 2020
@modified: Oct 30 220
@author: Yoann Pradat
CentraleSupelec
MICS laboratory
9 rue Juliot Curie, Gif-Sur-Yvette, 91190 France
Functions for manually parsing VCF files.
"""
import os
import numpy as np
import pandas as pd
import re
from ._util import load_vcf
DataFrame = pd.core.frame.DataFrame
#### # SUBFUNCTIONS
#### #####################################################################################################
def get_matches(regex: str, string: str) -> list:
"""
Get the matches from applying a regex on a string.
"""
matches = re.finditer(regex, string, re.MULTILINE)
lt_matches = []
for match in matches:
lt_matches += [match.group()]
return lt_matches
def get_format_info(df_vcf, col_caller, info="FT") -> pd.Series:
mask_caller = ~(df_vcf[col_caller].str.startswith("."))
col_position = "position_%s" % (info)
df_vcf.loc[:, col_position] = np.nan
def _get_pos(x):
if info not in x:
return np.nan
else:
return x.split(":").index(info)
def _get_val(x):
if np.isnan(x[1]):
return np.nan
else:
return x[0].split(":")[int(x[1])]
df_vcf.loc[mask_caller, col_position] = df_vcf.loc[mask_caller, "FORMAT"].apply(_get_pos)
s_filter = df_vcf.loc[mask_caller, [col_caller, col_position]].apply(_get_val, axis=1)
del df_vcf[col_position]
return s_filter
def add_chr_prefix(filepath_orig, filepath_dest):
with open(filepath_orig, 'r') as vcf_file_orig, open(filepath_dest, 'w') as vcf_file_dest:
vcf_lines = vcf_file_orig.readlines()
for vcf_line in vcf_lines:
if vcf_line.startswith("#"):
vcf_file_dest.write(vcf_line)
elif any(vcf_line.startswith(str(x)) for x in list(range(23)) + ["X", "Y"]):
vcf_line = "chr" + vcf_line
vcf_file_dest.write(vcf_line)
else:
vcf_file_dest.write(vcf_line)
def remove_chr_prefix(filepath_orig, filepath_dest):
with open(filepath_orig, 'r') as vcf_file_orig, open(filepath_dest, 'w') as vcf_file_dest:
vcf_lines = vcf_file_orig.readlines()
for vcf_line in vcf_lines:
if vcf_line.startswith("#"):
vcf_file_dest.write(vcf_line)
elif vcf_line.startswith("chr"):
vcf_file_dest.write(vcf_line[3:])
else:
vcf_file_dest.write(vcf_line)
def process_info(df_vcf: DataFrame) -> DataFrame:
"""
Processes the INFO field with contains the key=value fields like
DB: dbSNP membership
DP: read depth
Gene: Hugo gene symbol
MQ0: Number of mapping quality zero reads
SS: Somatic status
VC: variant classification
VT: variant type
TID: ensembl transcript identifier
VLSC: final somatic score between 0 and 255
"""
def keyval_to_dict(x):
if x == ".":
return np.nan
else:
return dict(item.split("=") if "=" in item else [item, item] for item in x.split(";"))
df_vcf_info = df_vcf["INFO"].apply(keyval_to_dict).apply(pd.Series)
df_vcf_info = df_vcf_info.loc[:, df_vcf_info.isnull().mean(axis=0) < 1]
return df_vcf_info
def extract_n_reads(df_vcf_reads: DataFrame, infos_n_reads: list) -> DataFrame:
"""
TODO: clarify the rules/meaning of DP, AD, DP4 and other.
"""
df_n_reads = pd.DataFrame(index = df_vcf_reads.index)
if set(["DP", "AD", "TIR", "TAR", "DP4"]).issubset(set(infos_n_reads)):
#### depth
df_n_reads.loc[:, "depth"] = df_vcf_reads["DP"].astype(float)
#### ref_count, alt_count in this order: TIR/TAR, DP4
if df_vcf_reads["TAR"].isnull().mean() < 1:
df_tar_counts = df_vcf_reads["TAR"].str.split(",").apply(pd.Series)
df_n_reads.loc[:,"ref_count"] = df_tar_counts[0]