#NEWLINE# def process( sequence , sample_id = None , group_id = None , source = None , threshold = None ) : #NEWLINE# #INDENT# 'Process a sequence of exon lines.\n\n    Args:\n        sequence (sequence): list of chanjo bed lines\n        sample_id (Optional[str]): unique sample id, else auto-guessed\n        grouip_id (Optional[str]): id to group samples\n        source (Optional[str]): path to coverage source (BAM/Sambamba)\n        threshold (Optional[int]): completeness level to disqualify exons\n\n    Returns:\n        Result: iterators of `Transcript`, transcripts processed, sample model\n    ' #NEWLINE# exons = sambamba . depth_output ( sequence ) #NEWLINE# transcripts = groupby_tx ( exons , sambamba = True ) #NEWLINE# raw_stats = ( ( tx_id , tx_stat ( tx_id , exons , threshold = threshold ) ) for ( tx_id , exons ) in iteritems ( transcripts ) ) #NEWLINE# if ( sample_id is None ) : #NEWLINE# #INDENT# sample_id = next ( itervalues ( transcripts ) ) [ 0 ] [ 'sampleName' ] #NEWLINE# #UNINDENT# sample_obj = Sample ( id = sample_id , group_id = group_id , source = source ) #NEWLINE# models = ( make_model ( sample_obj , tx_id , raw_stat ) for ( tx_id , raw_stat ) in raw_stats ) #NEWLINE# return Result ( models = models , count = len ( transcripts ) , sample = sample_obj )