B
    bÿ                 @   s  d Z ddlmZmZmZ G dd deZG dd deZG dd deZG d	d
 d
eZG dd deZ	G dd deZ
G dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd  d eZG d!d" d"eZG d#d$ d$eZG d%d& d&eZG d'd( d(eZG d)d* d*eZG d+d, d,eZG d-d. d.eZG d/d0 d0eZG d1d2 d2eZG d3d4 d4eZG d5d6 d6eZG d7d8 d8eZe d9krdd:l!m"Z" e"  d;S )<a#  Code to interact with and run various EMBOSS programs (OBSOLETE).

These classes follow the AbstractCommandline interfaces for running
programs.

We have decided to remove this module in future, and instead recommend
building your command and invoking it via the subprocess module directly.
    )_Option_SwitchAbstractCommandlinec               @   s   e Zd ZdZdddZdS )_EmbossMinimalCommandLinea  Base Commandline object for EMBOSS wrappers (PRIVATE).

    This is provided for subclassing, it deals with shared options
    common to all the EMBOSS tools:

    Attributes:
     - auto               Turn off prompts
     - stdout             Write standard output
     - filter             Read standard input, write standard output
     - options            Prompt for standard and additional values
     - debug              Write debug output to program.dbg
     - verbose            Report some/full command line options
     - help               Report command line options. More
                          information on associated and general
                          qualifiers can be found with -help -verbose
     - warning            Report warnings
     - error              Report errors
     - fatal              Report fatal errors
     - die                Report dying program messages

    Nc             K   s   |d k	st tddgdtddgdtddgd	td
dgdtddgdtddgdtddgdtddgdtddgdtddgdg
}y|| j | _W n tk
r   || _Y nX tj| |f| d S )Nz-autoautozTurn off prompts.

Automatic mode disables prompting, so we recommend you set this argument all the time when calling an EMBOSS tool from Biopython.z-stdoutstdoutzWrite standard output.z-filterfilterz+Read standard input, write standard output.z-optionsZoptionszPrompt for standard and additional values.

If you are calling an EMBOSS tool from within Biopython, we DO NOT recommend using this option.z-debugdebugz"Write debug output to program.dbg.z-verboseverbosez%Report some/full command line optionsz-helphelpztReport command line options.

More information on associated and general qualifiers can be found with -help -verbosez-warningZwarningzReport warnings.z-errorerrorzReport errors.z-dieZdiezReport dying program messages.)AssertionErrorr   
parametersAttributeErrorr   __init__)selfcmdkwargsextra_parameters r   6lib/python3.7/site-packages/Bio/Emboss/Applications.pyr   .   s.    
z"_EmbossMinimalCommandLine.__init__)N)__name__
__module____qualname____doc__r   r   r   r   r   r      s   r   c               @   s"   e Zd ZdZdddZdd ZdS )_EmbossCommandLinezBase Commandline object for EMBOSS wrappers (PRIVATE).

    This is provided for subclassing, it deals with shared options
    common to all the EMBOSS tools plus:

     - outfile            Output filename

    Nc             K   s`   |d k	st tddgdddg}y|| j | _W n tk
rJ   || _Y nX tj| |f| d S )Nz-outfileoutfilezOutput filenameT)filename)r   r   r   r   r   r   )r   r   r   r   r   r   r   r   a   s    z_EmbossCommandLine.__init__c             C   s$   | j s| js| jstdt| S )Nz]You must either set outfile (output filename), or enable filter or stdout (output to stdout).)r   r   r   
ValueErrorr   	_validate)r   r   r   r   r   o   s    z_EmbossCommandLine._validate)N)r   r   r   r   r   r   r   r   r   r   r   W   s   
r   c               @   s   e Zd ZdZdddZdS )Primer3Commandlinea  Commandline object for the Primer3 interface from EMBOSS.

    The precise set of supported arguments depends on your version of EMBOSS.
    This version accepts arguments current at EMBOSS 6.1.0:

    >>> cline = Primer3Commandline(sequence="mysequence.fas", auto=True, hybridprobe=True)
    >>> cline.explainflag = True
    >>> cline.osizeopt=20
    >>> cline.psizeopt=200
    >>> cline.outfile = "myresults.out"
    >>> cline.bogusparameter = 1967  # Invalid parameter
    Traceback (most recent call last):
        ...
    ValueError: Option name bogusparameter was not found.
    >>> print(cline)
    eprimer3 -auto -outfile=myresults.out -sequence=mysequence.fas -hybridprobe=True -psizeopt=200 -osizeopt=20 -explainflag=True

    eprimer3c          4   K   sv  t ddgdddt ddgdt d	d
gdt ddgdt ddgdt ddgdt ddgdt ddgdt ddgdt ddgd t d!d"gd#t d$d%gd&t d'd(gd)t d*d+gd,t d-d.gd/t d0d1gd2t d3d4gd5t d6d7gd8t d9d:gd;t d<d=gd>t d?d@gdAt dBdCgdDt dEdFgdGt dHdIgdJt dKdLgdMt dNdOgdPt dQdRgdSt dTdUgdVt dWdXgdYt dZd[gd\t d]d^gd_t d`dagdbt dcddgdet dfdggdht didjgdkt dldmgdnt dodpgdqt drdsgdtt dudvgdwt dxdygdzt d{d|gd}t d~dgdt ddgdt ddgdt ddgdt ddgdt ddgdt ddgdt ddgdt ddgdg2| _tj| |f| dS )zInitialize the class.z	-sequencesequencez Sequence to choose primers from.T)is_requiredz-taskZtaskz#Tell eprimer3 what task to perform.z-hybridprobeZhybridprobez-Find an internal oligo to use as a hyb probe.z
-numreturnZ	numreturnz)Maximum number of primer pairs to return.z-includedregionZincludedregionz3Subregion of the sequence in which to pick primers.z-targettargetz(Sequence to target for flanking primers.z-excludedregionZexcludedregionz'Regions to exclude from primer picking.z-forwardinputZforwardinputz&Sequence of a forward primer to check.z-reverseinputZreverseinputz&Sequence of a reverse primer to check.z-gcclampZgcclampz:The required number of Gs and Cs at the 3' of each primer.z-osizeZosizez!Optimum length of a primer oligo.z-minsizeZminsizez!Minimum length of a primer oligo.z-maxsizemaxsizez!Maximum length of a primer oligo.z-otmZotmz[Melting temperature for primer oligo (OBSOLETE).

Option replaced in EMBOSS 6.6.0 by -opttmz-opttmZopttmz]Optimum melting temperature for a primer oligo.

Option added in EMBOSS 6.6.0, replacing -otmz-mintmZmintmz/Minimum melting temperature for a primer oligo.z-maxtmZmaxtmz/Maximum melting temperature for a primer oligo.z
-maxdifftmZ	maxdifftmzOMaximum difference in melting temperatures between forward and reverse primers.z-ogcpercentZ
ogcpercentzOptimum GC% for a primer.z-mingcZmingczMinimum GC% for a primer.z-maxgcZmaxgczMaximum GC% for a primer.z	-saltconcZsaltconcz)Millimolar salt concentration in the PCR.z-dnaconcZdnaconcz7Nanomolar concentration of annealing oligos in the PCR.z	-maxpolyxZmaxpolyxz;Maximum allowable mononucleotide repeat length in a primer.z	-psizeoptZpsizeoptz!Optimum size for the PCR product.z-prangeZprangez/Acceptable range of length for the PCR product.z-ptmoptZptmoptz0Optimum melting temperature for the PCR product.z-ptmminZptmminz5Minimum allowed melting temperature for the amplicon.z-ptmmaxZptmmaxz5Maximum allowed melting temperature for the amplicon.z-oexcludedregionZoexcludedregionz+Do not pick internal oligos in this region.z-oligoinputZ
oligoinputzSequence of the internal oligo.z	-osizeoptZosizeoptz!Optimum length of internal oligo.z	-ominsizeZominsizez!Minimum length of internal oligo.z	-omaxsizeZomaxsizez!Maximum length of internal oligo.z-otmoptZotmoptz.Optimum melting temperature of internal oligo.z-otmminZotmminz.Minimum melting temperature of internal oligo.z-otmmaxZotmmaxz.Maximum melting temperature of internal oligo.z-ogcoptZogcoptzOptimum GC% for internal oligo.z-ogcminZogcminzMinimum GC% for internal oligo.z-ogcmaxZogcmaxzMaximum GC% for internal oligo.z
-osaltconcZ	osaltconcz6Millimolar concentration of salt in the hybridisation.z	-odnaconcZodnaconcz?Nanomolar concentration of internal oligo in the hybridisation.z	-oanyselfZoanyselfz;Maximum allowable alignment score for self-complementarity.z	-oendselfZoendselfz<Max 3'-anchored self-complementarity global alignment score.z
-opolyxmaxZ	opolyxmaxz:Maximum length of mononucleotide repeat in internal oligo.z-mispriminglibraryfileZmispriminglibraryfilez8File containing library of sequences to avoid amplifyingz-maxmisprimingZmaxmisprimingz]Maximum allowed similarity of primers to sequences in library specified by -mispriminglibraryz-omishybmaxZ
omishybmaxzgMaximum alignment score for hybridisation of internal oligo to library specified by -mishyblibraryfile.z-mishyblibraryfileZmishyblibraryfilez;Library file of seqs to avoid internal oligo hybridisation.z-explainflagZexplainflagz,Produce output tags with eprimer3 statisticsN)r   r   r   r   )r   r   r   r   r   r   r      s    








zPrimer3Commandline.__init__N)r!   )r   r   r   r   r   r   r   r   r   r    {   s   r    c               @   s   e Zd ZdZdddZdS )PrimerSearchCommandlinez<Commandline object for the primersearch program from EMBOSS.primersearchc             K   sl   t ddddgdddt dd	d
dgddddt ddgdddt ddgdt ddgdg| _tj| |f| dS )zInitialize the class.z-seqallz
-sequences	sequencesZseqallz)Sequence to look for the primer pairs in.T)r#   z-infilez-primersZprimersZinfilez/File containing the primer pairs to search for.)r   r#   z-mismatchpercentZmismatchpercentz;Allowed percentage mismatch (any integer value, default 0).z-snucleotidesnucleotidez"Sequences are nucleotide (boolean)z	-sproteinsproteinzSequences are protein (boolean)N)r   r   r   r   )r   r   r   r   r   r   r   7  s"    


z PrimerSearchCommandline.__init__N)r'   )r   r   r   r   r   r   r   r   r   r&   4  s   r&   c               @   s   e Zd ZdZdddZdS )FDNADistCommandlinezCommandline object for the fdnadist program from EMBOSS.

    fdnadist is an EMBOSS wrapper for the PHYLIP program dnadist for
    calulating distance matrices from DNA sequence files.
    fdnadistc             K   s   t ddgddddt ddgddd	t d
dgdt ddgdt ddgdt ddgdt ddgdt ddgdt ddgdt dd gd!t d"d#gd$t d%d&gd't d(d)gd*g| _tj| |f| d+S ),zInitialize the class.z	-sequencer"   zseq file to use (phylip)T)r   r#   z-methodmethodzsub. model [f,k,j,l,s])r#   z-gammagammazgamma [g, i,n]z-ncategoriesncategoriesz number of rate catergories (1-9)z-rateratezrate for each categoryz-categoriesZ
categoriesz$File of substitution rate categoriesz-weightsweightszweights filez-gammacoefficientgammacoefficientzvalue for gamma (> 0.001)z
-invarfracZ	invarfraczproportoin of invariant sitesz-ttratiottratiozts/tv ratioz
-freqsfromZ	freqsfromzuse emprical base freqsz	-basefreqbasefreqzspecify basefreqsz-lowerlowerzlower triangle matrix (y/N)N)r   r   r   r   )r   r   r   r   r   r   r   _  s*    


zFDNADistCommandline.__init__N)r,   )r   r   r   r   r   r   r   r   r   r+   X  s   r+   c               @   s   e Zd ZdZdddZdS )FTreeDistCommandlinezCommandline object for the ftreedist program from EMBOSS.

    ftreedist is an EMBOSS wrapper for the PHYLIP program treedist used for
    calulating distance measures between phylogentic trees.
    	ftreedistc             K   sh   t ddgddddt ddgdt d	d
gdt ddgdt ddgdt ddgdg| _tj| |f| dS )zInitialize the class.z-intreefile
intreefileztree file to score (phylip)T)r   r#   z-dtypeZdtypez*distance type ([S]ymetric, [b]ranch score)z-pairingZpairingz<tree pairing method ([A]djacent pairs, all [p]ossible pairs)z-styleZstylez*output style - [V]erbose, [f]ill, [s]parsez-norootZnorootztreat trees as rooted [N/y]z-outgrnooutgrnoz2which taxon to root the trees with (starts from 0)N)r   r   r   r   )r   r   r   r   r   r   r     s    
zFTreeDistCommandline.__init__N)r7   )r   r   r   r   r   r   r   r   r   r6   ~  s   r6   c               @   s   e Zd ZdZdddZdS )FNeighborCommandlinezCommandline object for the fneighbor program from EMBOSS.

    fneighbor is an EMBOSS wrapper for the PHYLIP program neighbor used for
    calulating neighbor-joining or UPGMA trees from distance matrices.
    	fneighborc             K   s   t ddgddddt ddgdt d	d
gdt ddgdt ddgdt ddgdt ddgdt ddgdt ddgdt ddgd g
| _tj| |f| d!S )"zInitialize the class.z	-datafiledatafilezdist file to use (phylip)T)r   r#   z-matrixtypeZ
matrixtypez)is martrix [S]quare pr [u]pper or [l]owerz	-treetypeZtreetypeznj or UPGMA tree (n/u)z-outgrnor9   ztaxon to use as OGz-jumbleZjumblezrandommise input order (Y/n)z-seedseedzprovide a random seedz-trouttroutzwrite tree (Y/n)z-outtreefileouttreefilezfilename for output treez	-progressZprogresszprint progress (Y/n)z
-treeprintZ	treeprintzprint tree (Y/n)N)r   r   r   r   )r   r   r   r   r   r   r     s"    zFNeighborCommandline.__init__N)r;   )r   r   r   r   r   r   r   r   r   r:     s   r:   c               @   s   e Zd ZdZdddZdS )FSeqBootCommandlinezCommandline object for the fseqboot program from EMBOSS.

    fseqboot is an EMBOSS wrapper for the PHYLIP program seqboot used to
    pseudo-sample alignment files.
    fseqbootc             K   s   t ddgddddt ddgdt d	d
gdt ddgdt ddgdt ddgdt ddgdt ddgdt ddgdt ddgd t d!d"gd#t d$d%gd&t d'd(gd)g| _tj| |f| d*S )+zInitialize the class.z	-sequencer"   zseq file to sample (phylip)T)r   r#   z-categoriescatergorieszfile of input categoriesz-weightsr1   z weights filez-testZtestz'specify operation, default is bootstrapz-regularZregularzabsolute number to resamplez-fracsampleZ
fracsamplezfraction to resamplez-rewriteformatZrewriteformatz'output format ([P]hyilp, [n]exus, [x]mlz-seqtypeZseqtypez&output format ([D]na, [p]rotein, [r]naz
-blocksizeZ	blocksizezprint progress (Y/n)z-repsZrepsz%how many replicates, defaults to 100)z-justweightsZ
jusweightsz.what to write out [D]atasets of just [w]eightsz-seedr=   zspecify random seedz-dotdiffdotdiffzUse dot-differencing? [Y/n]N)r   r   r   r   )r   r   r   r   r   r   r     s,    zFSeqBootCommandline.__init__N)rA   )r   r   r   r   r   r   r   r   r   r@     s   r@   c               @   s   e Zd ZdZdddZdS )FDNAParsCommandlinea  Commandline object for the fdnapars program from EMBOSS.

    fdnapars is an EMBOSS version of the PHYLIP program dnapars, for
    estimating trees from DNA sequences using parsiomny. Calling this command
    without providing a value for the option "-intreefile" will invoke
    "interactive mode" (and as a result fail if called with subprocess) if
    "-auto" is not set to true.
    fdnaparsc             K   s   t ddgddddt ddgdt d	d
gdt ddgdt ddgdt ddgdt ddgdt ddgdt ddgdt ddgd t d!d"gd#t d$d%gd&t d'd(gd)t d*d+gd,t d-d.gd/g| _tj| |f| d0S )1zInitialize the class.z	-sequencer"   zseq file to use (phylip)T)r   r#   z-intreefiler8   zPhylip tree filez-weightsr1   zweights filez	-maxtreesZmaxtreeszmax trees to save during runz	-thoroughZthoroughzmore thorough search (Y/n)z
-rearrangeZ	rearrangez#Rearrange on just 1 best tree (Y/n)z-transversionZtransversionzUse tranversion parsimony (y/N)z-njumblenjumblez7number of times to randomise input order (default is 0)z-seedr=   zprovide random seedz-outgrnor9   zSpecify outgroupz-threshthreshzUse threshold parsimony (y/N)z
-threshold	thresholdzThreshold valuez-troutr>   zWrite trees to file (Y/n)z-outtreefiler?   zfilename for output treez-dotdiffrC   zUse dot-differencing? [Y/n]N)r   r   r   r   )r   r   r   r   r   r   r     s.    
zFDNAParsCommandline.__init__N)rE   )r   r   r   r   r   r   r   r   r   rD     s   rD   c               @   s   e Zd ZdZdddZdS )FProtParsCommandlinea  Commandline object for the fdnapars program from EMBOSS.

    fprotpars is an EMBOSS version of the PHYLIP program protpars, for
    estimating trees from protein  sequences using parsiomny. Calling this
    command without providing a value for the option "-intreefile" will invoke
    "interactive mode" (and as a result fail if called with subprocess) if
    "-auto" is not set to true.
    	fprotparsc             K   s   t ddgddddt ddgdt d	d
gddddt ddgdt ddgdt ddgdt ddgdt ddgdt ddgdt ddgd t d!d"gd#t d$d%gd&g| _tj| |f| d'S )(zInitialize the class.z	-sequencer"   zseq file to use (phylip)T)r   r#   z-intreefiler8   zPhylip tree file to scorez-outtreefiler?   zphylip tree output filez-weightsr1   zweights filez
-whichcode	whichcodez which genetic code, [U,M,V,F,Y]]z-njumblerF   z7number of times to randomise input order (default is 0)z-seedr=   zprovide random seedz-outgrnor9   zSpecify outgroupz-threshrG   zUse threshold parsimony (y/N)z
-thresholdrH   zThreshold valuez-troutr>   zWrite trees to file (Y/n)z-dotdiffrC   zUse dot-differencing? [Y/n]N)r   r   r   r   )r   r   r   r   r   r   r     s.    zFProtParsCommandline.__init__N)rJ   )r   r   r   r   r   r   r   r   r   rI     s   rI   c               @   s   e Zd ZdZdddZdS )FProtDistCommandlinezCommandline object for the fprotdist program from EMBOSS.

    fprotdist is an EMBOSS wrapper for the PHYLIP program protdist used to
    estimate trees from protein sequences using parsimony
    	fprotdistc             K   s   t ddgddddt ddgdt d	d
gdt ddgdt ddgdt ddgdt ddgdt ddgdt ddgdt ddgd t d!d"gd#t d$d%gd&t d'd(gd)t d*d+gd,g| _tj| |f| d-S ).zInitialize the class.z	-sequencer"   zseq file to use (phylip)T)r   r#   z-ncategoriesr/   z number of rate catergories (1-9)z-rater0   zrate for each categoryz-catergoriesrB   zfile of ratesz-weightsr1   zweights filez-methodr-   zsub. model [j,h,d,k,s,c]z-gammar.   zgamma [g, i,c]z-gammacoefficientr2   zvalue for gamma (> 0.001)z-invarcoefficientZinvarcoefficientz4float for variation of substitution rate among sitesz-aacategZaacategz"Choose the category to use [G,C,H]z
-whichcoderK   zgenetic code [c,m,v,f,y]z-easeZeasez-Pob change catergory (float between -0 and 1)z-ttratior3   z#Transition/transversion ratio (0-1)z	-basefreqr4   z+DNA base frequencies (space separated list)N)r   r   r   r   )r   r   r   r   r   r   r   >  s0    

zFProtDistCommandline.__init__N)rM   )r   r   r   r   r   r   r   r   r   rL   7  s   rL   c               @   s   e Zd ZdZdddZdS )FConsenseCommandlinezCommandline object for the fconsense program from EMBOSS.

    fconsense is an EMBOSS wrapper for the PHYLIP program consense used to
    calculate consensus trees.
    	fconsensec          	   K   st   t ddgddddt ddgdt d	d
gdt ddgdt ddgdt ddgdt ddgdg| _tj| |f| dS )zInitialize the class.z-intreefiler8   z-file with phylip trees to make consensus fromT)r   r#   z-methodr-   z!consensus method [s, mr, MRE, ml]z-mlfracZmlfracz8cut-off freq for branch to appear in consensus (0.5-1.0)z-rootrootztreat trees as rooted (YES, no)z-outgrnor9   z&OTU to use as outgroup (starts from 0)z-troutr>   z-outtreefiler?   z"Phylip tree output file (optional)N)r   r   r   r   )r   r   r   r   r   r   r   h  s    zFConsenseCommandline.__init__N)rO   )r   r   r   r   r   r   r   r   r   rN   a  s   rN   c               @   s   e Zd ZdZdddZdS )WaterCommandlinez5Commandline object for the water program from EMBOSS.waterc             K   s   t ddgddddt ddgddddt d	d
gdddt ddgdddt ddgdddtddgdtddgdt ddgdt ddgdt d d!gd"t d#d$gd%g| _tj| |f| d&S )'zInitialize the class.z
-asequence	asequencezFirst sequence to alignT)r   r#   z
-bsequence	bsequencezSecond sequence to alignz-gapopengapopenzGap open penalty)r#   z
-gapextend	gapextendzGap extension penaltyz	-datafiler<   zMatrix file)r   z-nobriefnobriefz(Display extended identity and similarityz-briefbriefz%Display brief identity and similarityz-similarity
similarityz'Display percent identity and similarityz-snucleotider)   z"Sequences are nucleotide (boolean)z	-sproteinr*   zSequences are protein (boolean)z-aformataformatz5Display output in a different specified output formatN)r   r   r   r   r   )r   r   r   r   r   r   r     s4    



zWaterCommandline.__init__N)rR   )r   r   r   r   r   r   r   r   r   rQ     s   rQ   c               @   s   e Zd ZdZdddZdS )NeedleCommandlinez6Commandline object for the needle program from EMBOSS.needlec             K   s   t ddgddddt ddgddddt d	d
gdddt ddgdddt ddgdddt ddgdt ddgdt ddgdtddgdtd d!gd"t d#d$gd%t d&d'gd(t d)d*gd+t d,d-gd.g| _tj| |f| d/S )0zInitialize the class.z
-asequencerS   zFirst sequence to alignT)r   r#   z
-bsequencerT   zSecond sequence to alignz-gapopenrU   zGap open penalty)r#   z
-gapextendrV   zGap extension penaltyz	-datafiler<   zMatrix file)r   z
-endweight	endweightzApply And gap penaltiesz-endopenendopenz0The score taken away when an end gap is created.z
-endextend	endextendzPThe score added to the end gap penality for each base or residue in the end gap.z-nobriefrW   z(Display extended identity and similarityz-briefrX   z%Display brief identity and similarityz-similarityrY   z'Display percent identity and similarityz-snucleotider)   z"Sequences are nucleotide (boolean)z	-sproteinr*   zSequences are protein (boolean)z-aformatrZ   z5Display output in a different specified output formatN)r   r   r   r   r   )r   r   r   r   r   r   r     sB    



zNeedleCommandline.__init__N)r\   )r   r   r   r   r   r   r   r   r   r[     s   r[   c               @   s   e Zd ZdZdddZdS )NeedleallCommandlinez9Commandline object for the needleall program from EMBOSS.	needleallc             K   s   t ddgddddt ddgddddt d	d
gdddt ddgdddt ddgdddt ddgdt ddgdt ddgdt ddgdt d d!gd"td#d$gd%td&d'gd(t d)d*gd+t d,d-gd.t d/d0gd1t d2d3gd4g| _tj| |f| d5S )6zInitialize the class.z
-asequencerS   zFirst sequence to alignT)r   r#   z
-bsequencerT   zSecond sequence to alignz-gapopenrU   zGap open penalty)r#   z
-gapextendrV   zGap extension penaltyz	-datafiler<   zMatrix file)r   z	-minscoreminscorez:Exclude alignments with scores below this threshold score.z
-errorfileZ	errorfilezError file to be written to.z
-endweightr]   zApply And gap penaltiesz-endopenr^   z0The score taken away when an end gap is created.z
-endextendr_   zPThe score added to the end gap penality for each base or residue in the end gap.z-nobriefrW   z(Display extended identity and similarityz-briefrX   z%Display brief identity and similarityz-similarityrY   z'Display percent identity and similarityz-snucleotider)   z"Sequences are nucleotide (boolean)z	-sproteinr*   zSequences are protein (boolean)z-aformatrZ   z5Display output in a different specified output formatN)r   r   r   r   r   )r   r   r   r   r   r   r     sJ    



zNeedleallCommandline.__init__N)ra   )r   r   r   r   r   r   r   r   r   r`     s   r`   c               @   s   e Zd ZdZdddZdS )StretcherCommandlinez9Commandline object for the stretcher program from EMBOSS.	stretcherc          
   K   s   t ddgddddt ddgddddt d	d
gdddd dt ddgdddd dt ddgdddt ddgdt ddgdt ddgdg| _tj| |f| d S )!zInitialize the class.z
-asequencerS   zFirst sequence to alignT)r   r#   z
-bsequencerT   zSecond sequence to alignz-gapopenrU   zGap open penaltyc             S   s
   t | tS )N)
isinstanceint)valuer   r   r   <lambda>-      z/StretcherCommandline.__init__.<locals>.<lambda>)r#   Zchecker_functionz
-gapextendrV   zGap extension penaltyc             S   s
   t | tS )N)re   rf   )rg   r   r   r   rh   3  ri   z	-datafiler<   zMatrix file)r   z-snucleotider)   z"Sequences are nucleotide (boolean)z	-sproteinr*   zSequences are protein (boolean)z-aformatrZ   z5Display output in a different specified output formatN)r   r   r   r   )r   r   r   r   r   r   r     s8    



zStretcherCommandline.__init__N)rd   )r   r   r   r   r   r   r   r   r   rc     s   rc   c               @   s   e Zd ZdZdddZdS )FuzznucCommandlinez7Commandline object for the fuzznuc program from EMBOSS.fuzznucc             K   s^   t ddgdddt ddgdddt d	d
gdt ddgdt ddgdg| _tj| |f| dS )zInitialize the class.z	-sequencer"   zSequence database USAT)r#   z-patternpatternz5Search pattern, using standard IUPAC one-letter codesz
-pmismatch	pmismatchzNumber of mismatchesz-complementZ
complementzSearch complementary strandz-rformatrformatz'Specify the report format to output in.N)r   r   r   r   )r   r   r   r   r   r   r   E  s    zFuzznucCommandline.__init__N)rk   )r   r   r   r   r   r   r   r   r   rj   B  s   rj   c               @   s   e Zd ZdZdddZdS )FuzzproCommandlinez7Commandline object for the fuzzpro program from EMBOSS.fuzzproc             K   sR   t ddgdddt ddgdddt d	d
gdt ddgdg| _tj| |f| dS )zInitialize the class.z	-sequencer"   zSequence database USAT)r#   z-patternrl   z5Search pattern, using standard IUPAC one-letter codesz
-pmismatchrm   zNumber of mismatchesz-rformatrn   z'Specify the report format to output in.N)r   r   r   r   )r   r   r   r   r   r   r   Z  s    zFuzzproCommandline.__init__N)rp   )r   r   r   r   r   r   r   r   r   ro   W  s   ro   c               @   s   e Zd ZdZdddZdS )Est2GenomeCommandlinez:Commandline object for the est2genome program from EMBOSS.
est2genomec             K   s   t ddgdddt ddgdddt d	d
gdt ddgdt ddgdt ddgdt ddgdt ddgdt ddgdt ddgd t d!d"gd#t d$d%gd&t d'd(gd)t d*d+gd,t d-d.gd/t d0d1gd2t d3d4gd5g| _tj| |f| d6S )7zInitialize the class.z-estZestzEST sequence(s)T)r#   z-genomeZgenomezGenomic sequencez-matchmatchzScore for matching two basesz	-mismatchmismatchzCost for mismatching two basesz-gappenaltyZ
gappenaltyzECost for deleting a single base in either sequence, excluding intronsz-intronpenaltyZintronpenaltyz*Cost for an intron, independent of length.z-splicepenaltyZsplicepenaltyzUCost for an intron, independent of length and starting/ending on donor-acceptor sitesz	-minscorerb   z:Exclude alignments with scores below this threshold score.z-reversereversez+Reverse the orientation of the EST sequencez-spliceZsplicez$Use donor and acceptor splice sites.z-modemodezCThis determines the comparion mode. 'both', 'forward', or 'reverse'z-bestZbestz:You can print out all comparisons instead of just the bestz-spaceZspacezfor linear-space recursion.z-shuffleZshuffleZShufflez-seedr=   zRandom number seedz-alignZalignzShow the alignment.z-widthwidthzAlignment widthN)r   r   r   r   )r   r   r   r   r   r   r   n  s>    
zEst2GenomeCommandline.__init__N)rr   )r   r   r   r   r   r   r   r   r   rq   k  s   rq   c               @   s   e Zd ZdZdddZdS )ETandemCommandlinez7Commandline object for the etandem program from EMBOSS.etandemc          	   K   s|   t ddgddddt ddgddd	t d
dgddd	t ddgdt ddgdt ddgdt ddgdg| _tj| |f| dS )zInitialize the class.z	-sequencer"   SequenceT)r   r#   z
-minrepeatZ	minrepeatzMinimum repeat size)r#   z
-maxrepeat	maxrepeatzMaximum repeat sizez
-thresholdrH   zThreshold scorez	-mismatchrt   zAllow N as a mismatchz-uniformZuniformzAllow uniform consensusz-rformatrn   zOutput report formatN)r   r   r   r   )r   r   r   r   r   r   r     s    zETandemCommandline.__init__N)ry   )r   r   r   r   r   r   r   r   r   rx     s   rx   c               @   s   e Zd ZdZdddZdS )EInvertedCommandlinez9Commandline object for the einverted program from EMBOSS.	einvertedc          	   K   sz   t ddgddddt ddgddddt d	d
gdddt ddgdddt ddgdddt ddgdg| _tj| |f| dS )zInitialize the class.z	-sequencer"   rz   T)r   r#   z-gapZgapzGap penaltyz
-thresholdrH   zMinimum score threshold)r#   z-matchrs   zMatch scorez	-mismatchrt   zMismatch scorez
-maxrepeatr{   z6Maximum separation between the start and end of repeatN)r   r   r   r   )r   r   r   r   r   r   r     s    
zEInvertedCommandline.__init__N)r}   )r   r   r   r   r   r   r   r   r   r|     s   r|   c               @   s   e Zd ZdZdddZdS )PalindromeCommandlinez:Commandline object for the palindrome program from EMBOSS.
palindromec          
   K   s|   t ddgddddt ddgddd	t d
dgddd	t ddgddd	t ddgddd	t ddgddd	g| _tj| |f| dS )zInitialize the class.z	-sequencer"   rz   T)r   r#   z
-minpallenZ	minpallenzMinimum palindrome length)r#   z
-maxpallenZ	maxpallenzMaximum palindrome lengthz	-gaplimitZgaplimitzMaximum gap between repeatsz-nummismatchesZnummismatcheszNumber of mismatches allowedz-overlapZoverlapzReport overlapping matchesN)r   r   r   r   )r   r   r   r   r   r   r     s*    zPalindromeCommandline.__init__N)r   )r   r   r   r   r   r   r   r   r   r~     s   r~   c               @   s   e Zd ZdZdddZdS )TranalignCommandlinez9Commandline object for the tranalign program from EMBOSS.	tranalignc             K   s\   t ddgddddt ddgddddt d	d
gddddt ddgdg| _tj| |f| dS )zInitialize the class.z
-asequencerS   z#Nucleotide sequences to be aligned.T)r   r#   z
-bsequencerT   zProtein sequence alignmentz-outseqoutseqzOutput sequence file.z-tabletablezCode to useN)r   r   r   r   )r   r   r   r   r   r   r     s"    zTranalignCommandline.__init__N)r   )r   r   r   r   r   r   r   r   r   r     s   r   c               @   s   e Zd ZdZdddZdS )DiffseqCommandlinez7Commandline object for the diffseq program from EMBOSS.diffseqc          
   K   s~   t ddgddddt ddgddddt d	d
gdddt ddgddddt ddgddddt ddgdg| _tj| |f| dS )zInitialize the class.z
-asequencerS   zFirst sequence to compareT)r   r#   z
-bsequencerT   zSecond sequence to comparez	-wordsizewordsizez-Word size to use for comparisons (10 default))r#   z	-aoutfeatZaoutfeatz,File for output of first sequence's featuresz	-boutfeatZboutfeatz-File for output of second sequence's featuresz-rformatrn   zOutput report file formatN)r   r   r   r   )r   r   r   r   r   r   r     s4    zDiffseqCommandline.__init__N)r   )r   r   r   r   r   r   r   r   r   r     s   r   c               @   s   e Zd ZdZdddZdS )IepCommandlinea  Commandline for EMBOSS iep: calculated isoelectric point and charge.

    Examples
    --------
    >>> from Bio.Emboss.Applications import IepCommandline
    >>> iep_cline = IepCommandline(sequence="proteins.faa",
    ...                            outfile="proteins.txt")
    >>> print(iep_cline)
    iep -outfile=proteins.txt -sequence=proteins.faa

    You would typically run the command line with iep_cline() or via the
    Python subprocess module, as described in the Biopython tutorial.

    iepc             K   sh   t ddgddddt ddgdt d	d
gdt ddgdt ddgdt ddgdg| _tj| |f| dS )zInitialize the class.z	-sequencer"   zProtein sequence(s) filenameT)r   r#   z-aminoZaminozZNumber of N-termini

                    Integer 0 (default) or more.
                    z	-carboxylZcarboxylzZNumber of C-termini

                    Integer 0 (default) or more.
                    z-lysinemodifiedZlysinemodifiedzaNumber of modified lysines

                    Integer 0 (default) or more.
                    z-disulphidesZdisulphideszcNumber of disulphide bridges

                    Integer 0 (default) or more.
                    z
-noterminiZ	noterminiz=Exclude (True) or include (False) charge at N and C terminus.N)r   r   r   r   )r   r   r   r   r   r   r   C  s*    
zIepCommandline.__init__N)r   )r   r   r   r   r   r   r   r   r   r   3  s   r   c               @   s"   e Zd ZdZdddZdd ZdS )	SeqretCommandlinea  Commandline object for the seqret program from EMBOSS.

    This tool allows you to interconvert between different sequence file
    formats (e.g. GenBank to FASTA). Combining Biopython's Bio.SeqIO module
    with seqret using a suitable intermediate file format can allow you to
    read/write to an even wider range of file formats.

    This wrapper currently only supports the core functionality, things like
    feature tables (in EMBOSS 6.1.0 onwards) are not yet included.
    seqretc             K   sR   t ddgdddt ddgdddt d	d
gdt ddgdg| _tj| |f| dS )zInitialize the class.z	-sequencer"   zInput sequence(s) filenameT)r   z-outseqr   zOutput sequence file.z-sformatZsformatz.Input sequence(s) format (e.g. fasta, genbank)z	-osformatZosformatz/Output sequence(s) format (e.g. fasta, genbank)N)r   r   r   r   )r   r   r   r   r   r   r   ~  s    
zSeqretCommandline.__init__c             C   s>   | j s| js| jstd| js4| js4| js4tdt| S )Nz]You must either set outfile (output filename), or enable filter or stdout (output to stdout).z\You must either set sequence (input filename), or enable filter or stdin (input from stdin).)r   r   r   r   r"   Zstdintr   r   )r   r   r   r   r     s    zSeqretCommandline._validateN)r   )r   r   r   r   r   r   r   r   r   r   r   r  s   

r   c               @   s   e Zd ZdZdddZdS )SeqmatchallCommandlineak  Commandline object for the seqmatchall program from EMBOSS.

    e.g.
    >>> cline = SeqmatchallCommandline(sequence="opuntia.fasta", outfile="opuntia.txt")
    >>> cline.auto = True
    >>> cline.wordsize = 18
    >>> cline.aformat = "pair"
    >>> print(cline)
    seqmatchall -auto -outfile=opuntia.txt -sequence=opuntia.fasta -wordsize=18 -aformat=pair

    seqmatchallc             K   sD   t ddgddddt ddgdt d	d
gdg| _tj| |f| dS )zInitialize the class.z	-sequencer"   zReadable set of sequencesT)r   r#   z	-wordsizer   z(Word size (Integer 2 or more, default 4)z-aformatrZ   z5Display output in a different specified output formatN)r   r   r   r   )r   r   r   r   r   r   r     s    

zSeqmatchallCommandline.__init__N)r   )r   r   r   r   r   r   r   r   r   r     s   r   __main__)run_doctestN)#r   ZBio.Applicationr   r   r   r   r   r    r&   r+   r6   r:   r@   rD   rI   rL   rN   rQ   r[   r`   rc   rj   ro   rq   rx   r|   r~   r   r   r   r   r   r   Z
Bio._utilsr   r   r   r   r   <module>   s@   @$ :$& &****49+1$(?/!
