File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed
Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -317,20 +317,23 @@ def query(
317317 'end2' : 'end2' ,
318318 }
319319
320- if open_region :
321- second = gr
322-
323- if (second is not None ) or open_region :
320+ if second is not None :
324321 sdf = self .df .query (
325322 f"{ field_names ['chrom1' ]} == '{ gr .chrom } ' and { field_names ['start1' ]} >= { gr .start } and { field_names ['end1' ]} <= { gr .end } "
326323 f"and { field_names ['chrom2' ]} == '{ second .chrom } ' and { field_names ['start2' ]} >= { second .start } and { field_names ['end2' ]} <= { second .end } "
327324 )
328325 return sdf
329326 else :
330- sdf = self .df .query (
331- f"{ field_names ['chrom1' ]} == '{ gr .chrom } ' and { field_names ['start1' ]} >= { gr .start } and { field_names ['end1' ]} <= { gr .end } "
332- f"and { field_names ['chrom2' ]} == '{ gr .chrom } "
333- )
327+ if open_region :
328+ sdf = self .df .query (
329+ f"{ field_names ['chrom1' ]} == '{ gr .chrom } ' and { field_names ['start1' ]} >= { gr .start } and { field_names ['end1' ]} <= { gr .end } "
330+ f"and { field_names ['chrom2' ]} == '{ gr .chrom } "
331+ )
332+ else :
333+ sdf = self .df .query (
334+ f"{ field_names ['chrom1' ]} == '{ gr .chrom } ' and { field_names ['start1' ]} >= { gr .start } and { field_names ['end1' ]} <= { gr .end } "
335+ f"and { field_names ['chrom2' ]} == '{ gr .chrom } ' and { field_names ['start2' ]} >= { gr .start } and { field_names ['end2' ]} <= { gr .end } "
336+ )
334337 return sdf
335338 else :
336339 chrom_str = 'chrom'
You can’t perform that action at this time.
0 commit comments