o
    Rŀg                     @   sZ   d Z ddlmZ ddlmZ ddlmZ G dd deZedkr+ddlmZ e  d	S d	S )
z?Command line wrapper for the multiple alignment program MUSCLE.    )_Option)_Switch)AbstractCommandlinec                   @   s   e Zd ZdZdddZdS )MuscleCommandlinea  Command line wrapper for the multiple alignment program MUSCLE.

    http://www.drive5.com/muscle/

    Notes
    -----
    Last checked against version: 3.7, briefly against 3.8

    References
    ----------
    Edgar, Robert C. (2004), MUSCLE: multiple sequence alignment with high
    accuracy and high throughput, Nucleic Acids Research 32(5), 1792-97.

    Edgar, R.C. (2004) MUSCLE: a multiple sequence alignment method with
    reduced time and space complexity. BMC Bioinformatics 5(1): 113.

    Examples
    --------
    >>> from Bio.Align.Applications import MuscleCommandline
    >>> muscle_exe = r"C:\Program Files\Alignments\muscle3.8.31_i86win32.exe"
    >>> in_file = r"C:\My Documents\unaligned.fasta"
    >>> out_file = r"C:\My Documents\aligned.fasta"
    >>> muscle_cline = MuscleCommandline(muscle_exe, input=in_file, out=out_file)
    >>> print(muscle_cline)
    "C:\Program Files\Alignments\muscle3.8.31_i86win32.exe" -in "C:\My Documents\unaligned.fasta" -out "C:\My Documents\aligned.fasta"

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

    musclec                    sF  g d g dddg g dg dg dg dg t g d	d
dddt ddgddddtddgdtddgd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) fd*d!dd"t d+d,gd- fd.d!dd"t d/d0gd1d2d! dd"t d3d4gd5d6d! dd"t d7d8gd9fd:d!dd"t d;d<gd=fd>d!dd"t d?d@gdAdBd! dd"t dCdDgdEdFd! dd"t dGdHgdIdJd! dd"t dKdLgdMdNd! dd"t dOdPgdQdddt dRdSgdTdddt dUdVgdWdddt dXdYgdZd[d! dd"t d\d]gd^d_d! dd"t d`dagdbdcd! dd"t dddegdfdgd! dd"t dhdigdjdkd! dd"t dldmgdndod! dd"t dpdqgdrdsd! dd"t dtdugdvfdwd!dd"t dxdygdzd{d! dd"t d|d}gd~fdd!dd"t ddgdfdd!dd"t ddgddddt ddgdfdd!dd"t ddgddd! dd"t ddgddd! dd"t ddgddddt ddgddd! dd"t ddgdddt ddgdddt ddgddddt ddgdfdd!dd"t ddgdfdd!dd"tddgdtddgdtddgdtddgdtddgdtddgdtddgdt ddgddddt ddgddddt ddgddddt ddgddddt ddgddddt ddgddddt ddgddd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tddgdtddgdtddgdtddgdtddgdtddgdtd dgdtddgdtddgdtd	d
gd| _tj| |fi | dS (  zInitialize the class.)upgmaupgmbneighborjoining)kmer6_6kmer20_3kmer20_4kbit20_3kmer4_6pctid_kimura	pctid_log)sppsdpxpspfspm)pseudomidlongestspanminavgleafdist)proteinrnadnanucleoauto)noneclustalwhenikoff
henikoffpbgscthreeway)z-inininputzInput filenameTF)filenameequatez-outoutzOutput filenamez-diagsdiagsz-Find diagonals (faster for similar sequences)z-profileprofilezPerform a profile alignmentz-in1in1z*First input filename for profile alignmentz-in2in2z-Second input filename for a profile alignmentz-anchorspacinganchorspacingz&Minimum spacing between anchor columnsc                 S   
   t | tS N
isinstanceintx r6   R/var/www/html/myenv/lib/python3.10/site-packages/Bio/Align/Applications/_Muscle.py<lambda>h      
 z,MuscleCommandline.__init__.<locals>.<lambda>)checker_functionr(   z-centercenterz%Center parameter - should be negativec                 S   r/   r0   r2   floatr4   r6   r6   r7   r8   p   r9   z	-cluster1cluster1z%Clustering method used in iteration 1c                       |  v S r0   r6   r4   CLUSTERING_ALGORITHMSr6   r7   r8   w       z	-cluster2cluster2z%Clustering method used in iteration 2c                    r?   r0   r6   r4   r@   r6   r7   r8      rB   z-diaglength
diaglengthzMinimum length of diagonalc                 S   r/   r0   r1   r4   r6   r6   r7   r8      r9   z-diagmargin
diagmarginz/Discard this many positions at ends of diagonalc                 S   r/   r0   r1   r4   r6   r6   r7   r8      r9   z
-distance1	distance1z Distance measure for iteration 1c                    r?   r0   r6   r4   )DISTANCE_MEASURES_ITER1r6   r7   r8      rB   z
-distance2	distance2z Distance measure for iteration 2c                    r?   r0   r6   r4   )DISTANCE_MEASURES_ITER2r6   r7   r8      rB   z
-gapextend	gapextendzGap extension penaltyc                 S   r/   r0   r<   r4   r6   r6   r7   r8      r9   z-gapopengapopenz Gap open score - negative numberc                 S   r/   r0   r<   r4   r6   r6   r7   r8      r9   z-hydrohydroz"Window size for hydrophobic regionc                 S   r/   r0   r1   r4   r6   r6   r7   r8      r9   z-hydrofactorhydrofactorz3Multiplier for gap penalties in hydrophobic regionsc                 S   r/   r0   r<   r4   r6   r6   r7   r8      r9   z-loglogzLog file namez-logalogaz'Log file name (append to existing file)z-matrixmatrixzgpath to NCBI or WU-BLAST format protein substitution matrix - also set -gapopen, -gapextend and -centerz
-diagbreak	diagbreakzRMaximum distance between two diagonals that allows them to merge into one diagonalc                 S   r/   r0   r1   r4   r6   r6   r7   r8      r9   z-maxdiagbreakmaxdiagbreakz+Deprecated in v3.8, use -diagbreak instead.c                 S   r/   r0   r1   r4   r6   r6   r7   r8      r9   z	-maxhoursmaxhourszMaximum time to run in hoursc                 S   r/   r0   r<   r4   r6   r6   r7   r8     r9   z	-maxitersmaxiterszMaximum number of iterationsc                 S   r/   r0   r1   r4   r6   r6   r7   r8     r9   z	-maxtreesmaxtreesz/Maximum number of trees to build in iteration 2c                 S   r/   r0   r1   r4   r6   r6   r7   r8     r9   z-minbestcolscoreminbestcolscorez0Minimum score a column must have to be an anchorc                 S   r/   r0   r<   r4   r6   r6   r7   r8   &  r9   z-minsmoothscoreminsmoothscorez9Minimum smoothed score a column must have to be an anchorc                 S   r/   r0   r<   r4   r6   r6   r7   r8   0  r9   z	-objscoreobjscorez1Objective score used by tree dependent refinementc                    r?   r0   r6   r4   )OBJECTIVE_SCORESr6   r7   r8   E  rB   z-refinewindowrefinewindowzLength of window for -refinewc                 S   r/   r0   r1   r4   r6   r6   r7   r8   M  r9   z-root1root1z'Method used to root tree in iteration 1c                    r?   r0   r6   r4   TREE_ROOT_METHODSr6   r7   r8   T  rB   z-root2root2z'Method used to root tree in iteration 2c                    r?   r0   r6   r4   r\   r6   r7   r8   ^  rB   z
-scorefile	scorefilez_Score file name, contains one line for each column in the alignment with average BLOSUM62 scorez-seqtypeseqtypezSequence typec                    r?   r0   r6   r4   )SEQUENCE_TYPESr6   r7   r8   |  rB   z-smoothscoreceilsmoothscoreceilz+Maximum value of column score for smoothingc                 S   r/   r0   r<   r4   r6   r6   r7   r8     r9   z-smoothwindowsmoothwindowz'Window used for anchor column smoothingc                 S   r/   r0   r1   r4   r6   r6   r7   r8     r9   z-spscorespscorez0Compute SP objective score of multiple alignmentz-sueffsueffz!Constant used in UPGMB clusteringc                 S   r/   r0   r<   r4   r6   r6   r7   r8     r9   z-tree1tree1z!Save Newick tree from iteration 1)r(   z-tree2tree2z!Save Newick tree from iteration 2z-usetreeusetreez#Use given Newick tree as guide treez-weight1weight1z$Weighting scheme used in iteration 1c                    r?   r0   r6   r4   WEIGHTING_SCHEMESr6   r7   r8     rB   z-weight2weight2z$Weighting scheme used in iteration 2c                    r?   r0   r6   r4   rj   r6   r7   r8     rB   z-clwclwz6Write output in CLUSTALW format (with a MUSCLE header)z
-clwstrict	clwstrictz8Write output in CLUSTALW format with version 1.81 headerz-fastafastazWrite output in FASTA formatz-htmlhtmlzWrite output in HTML formatz-msfmsfzWrite output in MSF formatz-phyiphyiz)Write output in PHYLIP interleaved formatz-physphysz(Write output in PHYLIP sequential formatz-phyioutphyioutz5Write PHYLIP interleaved output to specified filenamez-physoutphysoutz4Write PHYLIP sequential format to specified filenamez-htmlouthtmloutz'Write HTML output to specified filenamez-clwoutclwoutz@Write CLUSTALW output (with MUSCLE header) to specified filenamez-clwstrictoutclwstrictoutzFWrite CLUSTALW output (with version 1.81 header) to specified filenamez-msfoutmsfoutz-Write MSF format output to specified filenamez	-fastaoutfastaoutz/Write FASTA format output to specified filenamez-anchorsanchorsz?Use anchor optimisation in tree dependent refinement iterationsz
-noanchors	noanchorszFDo not use anchor optimisation in tree dependent refinement iterationsz-brennerbrennerz)Use Steve Brenner's root alignment methodz-clusterclusterzCPerform fast clustering of input sequences, use -tree1 to save treez-dimerdimerzGUse faster (slightly less accurate) dimer approximationfor the SP scorez-groupgroupz!Group similar sequences in outputz-lelez+Use log-expectation profile score (VTML240)z-svsvz(Use sum-of-pairs profile score (VTML240)z-spr   z/Use sum-of-pairs protein profile score (PAM200)z-spnspnz1Use sum-of-pairs protein nucleotide profile scorez-quietquietz Do not display progress messagesz-refinerefinez!Only do tree dependent refinementz-refinewrefinewz?Only do tree dependent refinement using sliding window approachz-corecorezDo not catch exceptionsz-nocorenocorezCatch exceptionsz-stablestablez@Do not group similar sequences in output (not supported in v3.8)z-verboseverbosez%Write parameter settings and progressz-versionversionz'Write version string to stdout and exitN)r   r   
parametersr   __init__)selfcmdkwargsr6   )rA   rG   rI   rY   ra   r]   rk   r7   r   .   s  
!(
2
:CN
Z
ais}       (  /  >  F  O  X  b  w
     
    
    #    /
    8    A    J    X    _
    g
    o    v
     
      !      *      1      4      7      9      ;      =      C      I      O      U      \      b      k      q      x      ~                                       "        '        ,        0        6        <        ?        C
        [        ^        `zMuscleCommandline.__init__N)r   )__name__
__module____qualname____doc__r   r6   r6   r6   r7   r      s    r   __main__)run_doctestN)	r   Bio.Applicationr   r   r   r   r   
Bio._utilsr   r6   r6   r6   r7   <module>   s        "
