Package: primervcf
primervcfpackageInstallation:The package worked with python version >=3.8.
Only tested in linux x64 system.python package:primer3-py>=0.6.1pyssw >=0.1.7primerdiffer >=0.1.4biopython>=1.7.8PyVCF3>=1.0.3other program in your $PATH:ncbi-blastexample code to install the packages under python3 with pip and condapipinstallprimervcf# will also install all other python dependenciescondainstall-cbiocondablast# install ncbi blast, which is not included in pip installationWalkthroughDesign primers based on the VCF file provided, parser the deletion, and force primers to overalp the deletionCheck all long indel regions (>=indel_cutoff, default is 10) to design primers.Check local region to make sure the indel is not a local tamdem repeat (using ssw alignment).Use the whole genome (--genome1) as db to make a specificity check, to ensure the primer can only amplify one region.The dis-similarity between genome and the strain could be individual/strain/population level (<=1%).UseC.briggsaeQR25 strain as example. The fasta files and the vcf can be downloaded separately
fromcb5.faand
fromQR25.vcf.Quick examplevcf2del.py-fQR25.vcf-oQR25_del.bed
primerdesign_vcf.py-gcb5.fa-bQR25_del.bed--prefixQR25Explanations:usage:vcf2del.py[-h][-dWKDIR][-fFILE][-oOUT][-lLENGTH]optionalarguments:-h,--helpshowthishelpmessageandexit-dWKDIR,--wkdirWKDIRThedirpathcontainthefile,ifnotgiven,usethecurrentdir-fFILE,--fileFILEthevcffileusedasinput-oOUT,--outOUTbedfileoutput-lLENGTH,--lengthLENGTHtheminlengthforadeletiontobeused,defaultis10# run examplevcf2del.py-fQR25.vcf-oQR25_del.bed# check the result in file "QR25_del.bed"headQR25_del.bed
ChrI144730144744ChrI423135423167ChrI461207461222ChrI465639465661ChrI492790492800# run primerdesign_vcf.py to output primerusage:primerdesign_vcf.py[-h][-dWKDIR][-gGENOME][-bBEDFILE][--alignlenALIGNLEN][--free3lenFREE3LEN][-nPRIMERNUMBER][--debugDEBUG][--prefixPREFIX][--primer3configPRIMER3CONFIG]optionalarguments:-h,--helpshowthishelpmessageandexit-dWKDIR,--wkdirWKDIRThedirpathcontainthefile,ifnotgiven,usethecurrentdir-gGENOME,--genomeGENOMEthefastafileusedtodesignprimerandcheckspecificity-bBEDFILE,--bedfileBEDFILEthebedfilecontainingthedeletionregioninterval--alignlenALIGNLENthecutoffofprimerminalignlengthasarighthit,defaultis16--free3lenFREE3LENthecutoffofprimer3'alignlengthasarighthit,defaultis2-nPRIMERNUMBER,--primernumberPRIMERNUMBERtheprimerdesignedforeachregion,defaultis5,donothavemuchimpactforprimerdesign--debugDEBUGopendebugmodeornot,defaultisno--prefixPREFIXprefixofoutputfile,defaultisprimers--primer3configPRIMER3CONFIGtheconfigfilefortheprimer3# run example, chose only the first 10 deletion to design primersheadQR_25_del.bed>QR25_delhead.bed
primerdesign_vcf.py-gcb5.fa-bQR25_delhead.bed--prefixQR25Control parameters: design primers with given parametersThe default primer design parameter is described ingeneral_setting.py:primer3_general_settings={'PRIMER_OPT_SIZE':20,'PRIMER_PICK_LEFT_PRIMER':1,'PRIMER_PICK_RIGHT_PRIMER':1,'PRIMER_PICK_INTERNAL_OLIGO':0,'PRIMER_MIN_SIZE':18,'PRIMER_MAX_SIZE':23,'PRIMER_OPT_TM':57.0,'PRIMER_MIN_TM':46.0,'PRIMER_MAX_TM':63.0,'PRIMER_MIN_GC':20.0,'PRIMER_MAX_GC':80.0,'PRIMER_PRODUCT_SIZE_RANGE':[[250,650]],'PRIMER_NUM_RETURN':10,'PRIMER_MIN_THREE_PRIME_DISTANCE':10,'PRIMER_LIB_AMBIGUITY_CODES_CONSENSUS':0}The new parameter can be supplemnted as a file with the terms which need to be changed, for example, create a file with name of config.txt# content of config.txt# only changed the product size, the others are the same the default{'PRIMER_PRODUCT_SIZE_RANGE':[[100,200]]}Other scripts which might be useful if you want to start from fastq mappingusage:fq2vcf.py[-h][-dWKDIR][-fFILE][-gGENOME][-pPREFIX][-cCORE]optionalarguments:-h,--helpshowthishelpmessageandexit-dWKDIR,--wkdirWKDIRThedirpathcontainthefile,ifnotgiven,usethecurrentdir-fFILE,--fileFILEthefastqfileusedasinput-gGENOME,--genomeGENOMEthegenomefileusedformapping-pPREFIX,--prefixPREFIXtheoutvcffilenameprefix,defaultisusingthefileprefixoffastq-cCORE,--coreCOREthecoreusedforbwamemmappingandsamtoolssort,defaultis16# this script require the bwa mem in your $PATH# which can be installed by "conda install -c bioconda bwa"# example, the SRR1793006 reads are from QR25 strain, can be downloaded from NCBI SRA databasefq2vcf.py-fSRR1793006_1.fastq,SRR1793006_2.fastq-gcb5.fa-c32Citation:Please kindly cite our paper in bioinformatics if you find primerdiffer or primervcf useful in your work:Link to publication.Ren, X., Shao, Y., Zhang, Y., Ni, Y., Bi, Y., & Li, R. (2023). Primerdiffer: a python command line module for large-scale primer design in haplotype genotyping. Bioinformatics, btad188.