o
    RÅ€gí  ã                   @   s"   d Z ddlmZ G dd„ dƒZdS )z)Genome Diagram Feature cross-link module.é    )Úcolorsc                   @   sb   e Zd ZdZejddfdd„Zedd„ ƒZedd	„ ƒZ	d
d„ Z
edd„ ƒZedd„ ƒZdd„ ZdS )Ú	CrossLinkz;Hold information for drawing a cross link between features.NFc                 C   s"   || _ || _|| _|| _|| _dS )a•  Create a new cross link.

        Arguments featureA and featureB should GenomeDiagram feature objects,
        or 3-tuples (track object, start, end), and currently must be on
        different tracks.

        The color and border arguments should be ReportLab colour objects, or
        for border use a boolean False for no border, otherwise it defaults to
        the same as the main colour.

        The flip argument draws an inverted cross link, useful for showing a
        mapping where one sequence has been reversed. It is conventional to
        also use a different colour (e.g. red for simple links, blue for any
        flipped links).
        N)ÚfeatureAÚfeatureBÚcolorÚborderÚflip)Úselfr   r   r   r   r   © r
   úY/var/www/html/myenv/lib/python3.10/site-packages/Bio/Graphics/GenomeDiagram/_CrossLink.pyÚ__init__   s
   
zCrossLink.__init__c                 C   ó.   z| j jW S  ty   | j \}}}| Y S w )zStart position of Feature A.)r   ÚstartÚAttributeError©r	   Útrackr   Úendr
   r
   r   ÚstartA(   ó   
þzCrossLink.startAc                 C   ó.   z| j jW S  ty   | j \}}}| Y S w )zEnd position of Feature A.)r   r   r   r   r
   r
   r   ÚendA1   r   zCrossLink.endAc                 C   óv   z| j \}}}||v sJ ‚|W S  ty:   |D ]}| ¡ D ]}t|dƒr5| j |j ¡ v r5|     Y S qqY d S w ©NÚfeatures)r   Ú	TypeErrorÚget_setsÚhasattrr   Úvalues©r	   Útracksr   r   r   Úfeature_setr
   r
   r   Ú_trackA:   ó   
€ýúzCrossLink._trackAc                 C   r   )zStart position of Feature B.)r   r   r   r   r
   r
   r   ÚstartBG   r   zCrossLink.startBc                 C   r   )zEnd position of Feature B.)r   r   r   r   r
   r
   r   ÚendBP   r   zCrossLink.endBc                 C   r   r   )r   r   r   r   r   r   r   r
   r
   r   Ú_trackBY   r"   zCrossLink._trackB)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ú
lightgreenr   Úpropertyr   r   r!   r#   r$   r%   r
   r
   r
   r   r      s    
ÿ



r   N)r)   Úreportlab.libr   r   r
   r
   r
   r   Ú<module>   s   