diff --git a/_pytadbit/parsers/hic_bam_parser.py b/_pytadbit/parsers/hic_bam_parser.py index d5046082..b92b746b 100644 --- a/_pytadbit/parsers/hic_bam_parser.py +++ b/_pytadbit/parsers/hic_bam_parser.py @@ -374,13 +374,6 @@ def _read_bam_frag(inbam, filter_exclude, all_bins, sections1, sections2, refs = bamfile.references bam_start = start - 2 bam_start = max(0, bam_start) - section_pos = [] - for sec in sections1: - if sec not in section_pos: - section_pos.append(sec[0]) - for sec in sections2: - if sec not in section_pos: - section_pos.append(sec[0]) try: dico = {} for r in bamfile.fetch(region=region, @@ -677,7 +670,7 @@ def read_bam(inbam, filter_exclude, resolution, ncpus=8, if ncpus == 1: read_bam_frag(inbam, filter_exclude, all_bins, bins_dict1, bins_dict2, rand_hash, - resolution, tmpdir, region, b, e,) + resolution, tmpdir, region, b, e) else: procs.append(pool.apply_async( read_bam_frag, args=(inbam, filter_exclude, all_bins, diff --git a/_pytadbit/parsers/sam_parser.py b/_pytadbit/parsers/sam_parser.py index 4954847e..e88a149a 100644 --- a/_pytadbit/parsers/sam_parser.py +++ b/_pytadbit/parsers/sam_parser.py @@ -108,7 +108,7 @@ def parse_sam(f_names1, f_names2=None, out_file1=None, out_file2=None, if mapper.lower()=='gem': condition = lambda x: x[1][0][0] != 'N' elif mapper.lower() in ['bowtie', 'bowtie2']: - condition = lambda x: 'XS' in dict(x) + condition = lambda x: 'XS' == x[0][0] else: warn('WARNING: unrecognized mapper used to generate file\n') condition = lambda x: x[1][1] != 1