o
    UÝ¢gs  ã                   @  s6   d Z ddlmZ dZG dd„ dƒZG dd„ deƒZdS )	zDefiniton of the Metric class.é    )ÚannotationsÚreference_pathc                   @  s   e Zd Zdd„ ZdS )ÚMetricsc                 C  s,   |j  ¡ D ]\}}|d urt| ||ƒ qd S ©N)Ú__dict__ÚitemsÚsetattr)ÚselfÚotherÚkÚv© r   úa/oak/stanford/groups/akundaje/marinovg/programs/cellranger-9.0.1/lib/python/cellranger/metrics.pyÚupdate   s
   €þzMetrics.updateN)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r      s    r   c                   @  s0   e Zd Zdddd„Zeddd	„ƒZddd„ZdS )ÚBarcodeFilterResultsr   Údefault_valueÚintc                 C  s,   || _ || _|| _|| _t|ƒ| _|| _d S r   )Úfiltered_bcsÚfiltered_bcs_lbÚfiltered_bcs_ubÚfiltered_bcs_varÚfloatÚfiltered_bcs_cvÚfiltered_bcs_cutoff)r	   r   r   r   r   Ú__init__   s   

zBarcodeFilterResults.__init__Ún_bcsÚreturnc                 C  s.   t ƒ }| |_| |_| |_d|_d|_d|_|S )Nr   )r   r   r   r   r   r   r   )r   Úresr   r   r   Úinit_with_constant_call   s   z,BarcodeFilterResults.init_with_constant_callÚiÚsampleú
str | NoneÚmethodÚstrúdict[str, int | float]c                   s,   |rd| nd‰‡ ‡‡fdd„| j  ¡ D ƒS )NÚ_Ú c                   s"   i | ]\}}d ˆ ˆ|ˆf |“qS )zgem_group_%d%s_%s_%sr   )Ú.0ÚkeyÚvalue©r"   r%   Zsample_prefixr   r   Ú
<dictcomp>,   s    ÿÿz<BarcodeFilterResults.to_dict_with_prefix.<locals>.<dictcomp>)r   r   )r	   r"   r#   r%   r   r-   r   Úto_dict_with_prefix(   s   þz(BarcodeFilterResults.to_dict_with_prefixN)r   )r   r   )r   r   r   r   )r"   r   r#   r$   r%   r&   r   r'   )r   r   r   r   Ústaticmethodr!   r/   r   r   r   r   r      s
    
r   N)Ú__doc__Ú
__future__r   ZREFERENCE_PATHr   r   r   r   r   r   Ú<module>   s
   