o
    Rŀg'                     @   sf   d Z ddlm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r1dd	lm	Z	 e	  d
S d
S )zCCommand line wrapper for the multiple alignment program DIALIGN2-2.    )	_Argument)_Option)_Switch)AbstractCommandlinec                   @   s   e Zd ZdZdddZdS )DialignCommandlinea  Command line wrapper for the multiple alignment program DIALIGN2-2.

    http://bibiserv.techfak.uni-bielefeld.de/dialign/welcome.html

    Notes
    -----
    Last checked against version: 2.2

    References
    ----------
    B. Morgenstern (2004). DIALIGN: Multiple DNA and Protein Sequence
    Alignment at BiBiServ. Nucleic Acids Research 32, W33-W36.

    Examples
    --------
    To align a FASTA file (unaligned.fasta) with the output files names
    aligned.* including a FASTA output file (aligned.fa), use:

    >>> from Bio.Align.Applications import DialignCommandline
    >>> dialign_cline = DialignCommandline(input="unaligned.fasta",
    ...                                    fn="aligned", fa=True)
    >>> print(dialign_cline)
    dialign2-2 -fa -fn aligned unaligned.fasta

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

    
dialign2-2c                 K   sT  || _ g 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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/d0d1 d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dJdd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dedfd1 dd2tdgdhgditdjdkgdltdmdngdodpd1 dd2tdqdrgdstdtgdudvdvdw| _tj| |fi | dxS )yzInitialize the class.z-afcafczCreates additional output file '\*.afc' containing data of all fragments considered for alignment WARNING: this file can be HUGE !z-afc_vafc_vzbLike '-afc' but verbose: fragments are explicitly printed. WARNING: this file can be EVEN BIGGER !z-ancanczLAnchored alignment. Requires a file <seq_file>.anc containing anchor points.z-cscszbIf segments are translated, not only the 'Watson strand' but also the 'Crick strand' is looked at.z-cwcwz+Additional output file in CLUSTAL W format.z-dsdsz'dna alignment speed up' - non-translated nucleic acid fragments are taken into account only if they start with at least two matches. Speeds up DNA alignment at the expense of sensitivity.z-fafaz'Additional output file in FASTA format.z-ffffzCreates file \*.frg containing information about all fragments that are part of the respective optimal pairwise alignmnets plus information about consistency in the multiple alignmentz-fnfnz.Output files are named <out_file>.<extension>.F)equatez-fopfopzpCreates file \*.fop containing coordinates of all fragments that are part of the respective pairwise alignments.z-fsmfsmz`Creates file \*.fsm containing coordinates of all fragments that are part of the final alignmentz-iwiwzOverlap weights switched off (by default, overlap weights are used if up to 35 sequences are aligned). This option speeds up the alignment but may lead to reduced alignment quality.z-lgslgsz'long genomic sequences' - combines the following options: -ma, -thr 2, -lmax 30, -smin 8, -nta, -ff, -fop, -ff, -cs, -ds, -pst z-lgs_tlgs_tzLike '-lgs' but with all segment pairs assessed at the peptide level (rather than 'mixed alignments' as with the '-lgs' option). Therefore faster than -lgs but not very sensitive for non-coding regions.z-lmaxlmaxzMaximum fragment length = x  (default: x = 40 or x = 120 for 'translated' fragments). Shorter x speeds up the program but may affect alignment quality.c                 S   
   t | tS N
isinstanceintx r   S/var/www/html/myenv/lib/python3.10/site-packages/Bio/Align/Applications/_Dialign.py<lambda>~      
 z-DialignCommandline.__init__.<locals>.<lambda>)checker_functionr   z-loloz(Long Output) Additional file \*.log with information about fragments selected for pairwise alignment and about consistency in multi-alignment procedure.z-mamazc'mixed alignments' consisting of P-fragments and N-fragments if nucleic acid sequences are aligned.z-maskmaskzResidues not belonging to selected fragments are replaced by '\*' characters in output alignment (rather than being printed in lower-case characters)z-matmatzmCreates file \*mat with substitution counts derived from the fragments that have been selected for alignment.z-mat_thrmat_thrzCLike '-mat' but only fragments with weight score > t are consideredz	-max_linkmax_linkzP'maximum linkage' clustering used to construct sequence tree (instead of UPGMA).z	-min_linkmin_linkz"'minimum linkage' clustering used.z-motmotz'motif' option.z-msfmsfz#Separate output file in MSF format.z-nnzHInput sequences are nucleic acid sequences. No translation of fragments.z-ntntzlInput sequences are nucleic acid sequences and 'nucleic acid segments' are translated to 'peptide segments'.z-ntantaz'no textual alignment' - textual alignment suppressed. This option makes sense if other output files are of interest -- e.g. the fragment files created with -ff, -fop, -fsm or -lo.z-ooz=Fast version, resulting alignments may be slightly different.z-owowzOverlap weights enforced (By default, overlap weights are used only if up to 35 sequences are aligned since calculating overlap weights is time consuming).z-pstpstz'print status'. Creates and updates a file \*.sta with information about the current status of the program run.  This option is recommended if large data sets are aligned since it allows the user to estimate the remaining running time.z-sminsminzMinimum similarity value for first residue pair (or codon pair) in fragments. Speeds up protein alignment or alignment of translated DNA fragments at the expense of sensitivity.z-starsstarszMaximum number of '\*' characters indicating degree of local similarity among sequences. By default, no stars are used but numbers between 0 and 9, instead.c                 S   s   | t dv S )N
   )ranger   r   r   r    r!      s    z-stdostdoz#Results written to standard output.z-tataznStandard textual alignment printed (overrides suppression of textual alignments in special options, e.g. -lgs)z-thrthrzThreshold T = x.c                 S   r   r   r   r   r   r   r    r!      r"   z-xfrxfrzg'exclude fragments' - list of fragments can be specified that are NOT considered for pairwise alignmentinputz%Input file name. Must be FASTA formatT)filenameis_requiredN)program_namer   r   r   
parametersr   __init__)selfcmdkwargsr   r   r    r@   -   s  &+05<BIQW\bglqrsty            (  )  /  5  :  AzDialignCommandline.__init__N)r   )__name__
__module____qualname____doc__r@   r   r   r   r    r      s    r   __main__)run_doctestN)
rG   Bio.Applicationr   r   r   r   r   rD   
Bio._utilsrI   r   r   r   r    <module>   s    e
