o
    RŀgH)                     @   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 PRANK.    )_Option)_Switch)AbstractCommandlinec                   @   s   e Zd ZdZdddZdS )PrankCommandlineaW  Command line wrapper for the multiple alignment program PRANK.

    http://www.ebi.ac.uk/goldman-srv/prank/prank/

    Notes
    -----
    Last checked against version: 081202

    References
    ----------
    Loytynoja, A. and Goldman, N. 2005. An algorithm for progressive
    multiple alignment of sequences with insertions. Proceedings of
    the National Academy of Sciences, 102: 10557--10562.

    Loytynoja, A. and Goldman, N. 2008. Phylogeny-aware gap placement
    prevents errors in sequence alignment and evolutionary analysis.
    Science, 320: 1632.

    Examples
    --------
    To align a FASTA file (unaligned.fasta) with the output in aligned
    FASTA format with the output filename starting with "aligned" (you
    can't pick the filename explicitly), no tree output and no XML output,
    use:

    >>> from Bio.Align.Applications import PrankCommandline
    >>> prank_cline = PrankCommandline(d="unaligned.fasta",
    ...                                o="aligned", # prefix only!
    ...                                f=8, # FASTA output
    ...                                notree=True, noxml=True)
    >>> print(prank_cline)
    prank -d=unaligned.fasta -o=aligned -f=8 -noxml -notree

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

    prankc                    s  t tdd g 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ddtddgd f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g d-d.td/d0gd1td2d3gd4d5d dtd6d7gd8d9d dtd:d;gd<d=d dtd>d?gd@dAd dtdBdCgdDdEd dtdFdGgdHtdIdJgdKtdLdMgdNtdOdPgdQdRd dtdSdTgdUtdVdWgdXtdYdZgd[td\d]gd^td_d`gdatdbdcgddtdedfgdgdhd dtdidjgdkdld dtdmdngdotdpdqgdrtdsdtgdudvd dtdwdxgdydzd dtd{d|gd}d~d dtddgddd dtddgdtddgdtddgdtddgd| _tj| |fi | dS )zInitialize the class.      z-ddzInput filenameT)filenameis_requiredz-ttzInput guide tree filename)r
   z-treetreez!Input guide tree as Newick stringz-mmz8User-defined alignment model filename. Default: HKY2/WAGz-oozOutput filenames prefix. Default: 'output'
 Will write: output.?.fas (depending on requested format), output.?.xml and output.?.dndz-ffzOutput alignment format. Default: 8 FASTA
Option are:
1. IG/Stanford	8. Pearson/Fasta
2. GenBank/GB 	11. Phylip3.2
3. NBRF       	12. Phylip
4. EMBL       	14. PIR/CODATA
6. DNAStrider 	15. MSF
7. Fitch      	17. PAUP/NEXUSc                    s   |  v S N xOUTPUT_FORMAT_VALUESr   Q/var/www/html/myenv/lib/python3.10/site-packages/Bio/Align/Applications/_Prank.py<lambda>W   s    z+PrankCommandline.__init__.<locals>.<lambda>)checker_functionz-noxmlnoxmlz>Do not output XML files (PRANK versions earlier than v.120626)z-notreenotreezCDo not output dnd tree files (PRANK versions earlier than v.120626)z-showxmlshowxmlz+Output XML files (PRANK v.120626 and later)z	-showtreeshowtreez0Output dnd tree files (PRANK v.120626 and later)z-shortnames
shortnameszTruncate names at first spacez-quietquietzReduce verbosity)z-Fz+FFz1Force insertions to be always skipped: same as +Fz-dotsdotszShow insertion gaps as dotsz-gaprategapratez0Gap opening rate. Default: dna 0.025 prot 0.0025c                 S   
   t | tS r   
isinstancefloatr   r   r   r   r   v      
 z-gapextgapextz6Gap extension probability. Default: dna 0.5 / prot 0.5c                 S   r#   r   r$   r   r   r   r   r   |   r'   z	-dnafreqsdnafreqszdDNA frequencies - 'A,C,G,T'. eg '25,25,25,25' as a quote surrounded string value. Default: empiricalc                 S   r#   r   )r%   bytesr   r   r   r   r      r'   z-kappakappaz)Transition/transversion ratio. Default: 2c                 S   r#   r   r%   intr   r   r   r   r      r'   z-rhorhoz#Purine/pyrimidine ratio. Default: 1c                 S   r#   r   r,   r   r   r   r   r      r'   z-codoncodonzCodon aware alignment or notz-termgaptermgapzPenalise terminal gaps normallyz-nopostnopostz2Do not compute posterior support. Default: computez-pwdistpwdistzPExpected pairwise distance for computing guidetree. Default: dna 0.25 / prot 0.5c                 S   r#   r   r$   r   r   r   r   r      r'   z-onceoncez3Run only once. Default: twice if no guidetree givenz-twicetwicezAlways run twicez-skipinsskipinsz$Skip insertions in posterior supportz-uselogsuselogsz8Slower but should work for a greater number of sequencesz	-writeancwriteanczOutput ancestral sequencesz-printnodes
printnodesz&Output each node; mostly for debuggingz
-matresize	matresizezMatrix resizing multiplierc                 S      t | ttfS r   r%   r&   r-   r   r   r   r   r          z-matinitsizematinitsizezMatrix initial size multiplierc                 S   r:   r   r;   r   r   r   r   r      r<   z-longseqlongseqz!Save space in pairwise alignmentsz
-pwgenomic	pwgenomicz#Do pairwise alignment, no guidetreez-pwgenomicdistpwgenomicdistz-Distance for pairwise alignment. Default: 0.3c                 S   r#   r   r$   r   r   r   r   r      r'   z-scalebranchesscalebranchesz-Scale branch lengths. Default: dna 1 / prot 2c                 S   r#   r   r,   r   r   r   r   r      r'   z-fixedbranchesfixedbranchesz'Use fixed branch lengths of input valuec                 S   r#   r   r$   r   r   r   r   r      r'   z-maxbranchesmaxbranchesz)Use maximum branch lengths of input valuec                 S   r#   r   r$   r   r   r   r   r      r'   z-realbranchesrealbranchesz Disable branch length truncationz
-translate	translatezTranslate to proteinz-mttranslatemttranslatez#Translate to protein using mt tablez-convertconvertz?Convert input alignment to new format. Do not perform alignmentN)listranger   r   
parametersr   __init__)selfcmdkwargsr   r   r   rK   5   s  	
!%),0159;AGNTZ\_eknoptuz       
        $  '  (  ,  1zPrankCommandline.__init__N)r   )__name__
__module____qualname____doc__rK   r   r   r   r   r      s    &r   __main__)run_doctestN)	rR   Bio.Applicationr   r   r   r   rO   
Bio._utilsrT   r   r   r   r   <module>   s    ^
