3030
3131
3232class ReadAssignmentAggregator :
33- def __init__ (self , args , sample , read_groups , gffutils_db = None , chr_id = None , gzipped = False , grouping_strategy_names = None ):
33+ def __init__ (self , args , sample , string_pools , gffutils_db = None , chr_id = None , gzipped = False , grouping_strategy_names = None ):
3434 self .args = args
35- self .read_groups = read_groups
35+ self .string_pools = string_pools
3636 self .grouping_strategy_names = grouping_strategy_names if grouping_strategy_names else ["default" ]
3737 self .common_header = "# Command line: " + args ._cmd_line + "\n # IsoQuant version: " + args ._version + "\n "
3838 self .io_support = IOSupport (self .args )
@@ -95,8 +95,9 @@ def __init__(self, args, sample, read_groups, gffutils_db=None, chr_id=None, gzi
9595 if self .args .count_exons and self .args .genedb :
9696 exon_counts_path = sample .get_exon_counts_file (chr_id ) if chr_id else sample .out_exon_counts_tsv
9797 intron_counts_path = sample .get_intron_counts_file (chr_id ) if chr_id else sample .out_intron_counts_tsv
98- self .exon_counter = ExonCounter (exon_counts_path , ignore_read_groups = True )
99- self .intron_counter = IntronCounter (intron_counts_path , ignore_read_groups = True )
98+ # string_pools=None means ungrouped counting
99+ self .exon_counter = ExonCounter (exon_counts_path )
100+ self .intron_counter = IntronCounter (intron_counts_path )
100101 self .global_counter .add_counters ([self .exon_counter , self .intron_counter ])
101102
102103 if self .args .read_group and self .args .genedb :
@@ -112,12 +113,12 @@ def __init__(self, args, sample, read_groups, gffutils_db=None, chr_id=None, gzi
112113 gene_counter = create_gene_counter (gene_out_file ,
113114 self .args .gene_quantification ,
114115 complete_feature_list = self .gene_set ,
115- read_groups = self .read_groups [ group_idx ] ,
116+ string_pools = self .string_pools ,
116117 group_index = group_idx )
117118 transcript_counter = create_transcript_counter (transcript_out_file ,
118119 self .args .transcript_quantification ,
119120 complete_feature_list = self .transcript_set ,
120- read_groups = self .read_groups [ group_idx ] ,
121+ string_pools = self .string_pools ,
121122 group_index = group_idx )
122123
123124 self .global_counter .add_counters ([gene_counter , transcript_counter ])
@@ -129,8 +130,8 @@ def __init__(self, args, sample, read_groups, gffutils_db=None, chr_id=None, gzi
129130 else :
130131 exon_out_file = f"{ sample .out_exon_grouped_counts_tsv } _{ strategy_name } "
131132 intron_out_file = f"{ sample .out_intron_grouped_counts_tsv } _{ strategy_name } "
132- exon_counter = ExonCounter (exon_out_file , group_index = group_idx )
133- intron_counter = IntronCounter (intron_out_file , group_index = group_idx )
133+ exon_counter = ExonCounter (exon_out_file , string_pools = self . string_pools , group_index = group_idx )
134+ intron_counter = IntronCounter (intron_out_file , string_pools = self . string_pools , group_index = group_idx )
134135 self .global_counter .add_counters ([exon_counter , intron_counter ])
135136
136137 if self .args .read_group and not self .args .no_model_construction :
@@ -145,12 +146,12 @@ def __init__(self, args, sample, read_groups, gffutils_db=None, chr_id=None, gzi
145146 transcript_model_counter = create_transcript_counter (
146147 transcript_model_out_file ,
147148 self .args .transcript_quantification ,
148- read_groups = self .read_groups [ group_idx ] ,
149+ string_pools = self .string_pools ,
149150 group_index = group_idx )
150151 gene_model_counter = create_gene_counter (
151152 gene_model_out_file ,
152153 self .args .gene_quantification ,
153- read_groups = self .read_groups [ group_idx ] ,
154+ string_pools = self .string_pools ,
154155 group_index = group_idx )
155156
156157 self .transcript_model_global_counter .add_counter (transcript_model_counter )
0 commit comments