Skip to content

Commit

Permalink
Flake8 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kjaisingh committed Feb 18, 2025
1 parent a976cd7 commit 1f85580
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/svtk/svtk/cli/baf_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def preprocess(chrom, start, end, tbx, samples, window=None, called_samples=None
"""
if window is None:
window = end - start

bafs = deque()
if window < 1000000:
for record in tbx.fetch(chrom, max(1, start - window), end + window, parser=pysam.asTuple()):
Expand All @@ -47,7 +47,7 @@ def preprocess(chrom, start, end, tbx, samples, window=None, called_samples=None
bafs.append(np.array(record))
for record in tbx.fetch(chrom, end, end + 1000000, parser=pysam.asTuple()):
bafs.append(np.array(record))

bafs = pd.DataFrame(np.array(bafs))
if bafs.empty:
return bafs, bafs, called_samples
Expand All @@ -65,7 +65,7 @@ def preprocess(chrom, start, end, tbx, samples, window=None, called_samples=None

if bafs.empty:
return bafs, bafs, called_samaples

bafs['pos'] = bafs.pos.astype(int)
bafs['baf'] = bafs.baf.astype(float)
bafs.loc[bafs.pos <= start, 'region'] = 'before'
Expand All @@ -79,7 +79,7 @@ def preprocess(chrom, start, end, tbx, samples, window=None, called_samples=None
for colname in cols:
if colname not in het_counts.columns:
het_counts[colname] = 0

# Report BAF for variants inside CNV
called_bafs = bafs.loc[bafs.region == 'inside'].copy()
return het_counts, called_bafs, called_samaples
Expand Down Expand Up @@ -148,8 +148,8 @@ def main(argv):
type = dat[5]
try:
het_counts, called_bafs, samplelist = preprocess(
chrom, start, end, tbx, samples=splist,
outlier_sample_ids=outlier_samples,
chrom, start, end, tbx, samples=splist,
outlier_sample_ids=outlier_samples,
called_samples=samplelist
)
except ValueError:
Expand Down
2 changes: 1 addition & 1 deletion src/svtk/svtk/pesr/pesr_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def choose_background(self, record, whitelist=None, blacklist=None):
non_outlier_called = [s for s in called if s not in self.outlier_sample_ids]
if len(non_outlier_called) > 0:
called = non_outlier_called

non_outlier_background = [s for s in background if s not in self.outlier_sample_ids]
if len(non_outlier_background) > 0:
background = non_outlier_background
Expand Down

0 comments on commit 1f85580

Please sign in to comment.