3
ëyû^s  ã               @   sN   d dl mZmZmZmZ d dlZd dlZd dlZd dlZej	e
ƒZdd„ ZdS )é    )Úabsolute_importÚdivisionÚprint_functionÚunicode_literalsNc             C   s:   t jdd| ƒ\}}|dkr6dj| ƒ}tj|ƒ t|ƒ‚|S )zJ
    extracts the gene name from the Trinity identifier as the prefix
    z_i\d+$Ú é   z6Error, couldn't extract gene_id from transcript_id: {})ÚreÚsubnÚformatÚloggerÚcriticalÚRuntimeError)Útranscript_nameÚ	gene_nameÚcountÚerrmsg© r   úP/broad/hptmp/bhaas/trinityrnaseq/Analysis/SuperTranscripts/pylib/Trinity_util.pyÚget_Trinity_gene_name   s    

r   )Ú
__future__r   r   r   r   ÚosÚsysr   ÚloggingÚ	getLoggerÚ__name__r   r   r   r   r   r   Ú<module>   s   
