Skip to content

Commit

Permalink
fix to get accurate pileups with pysam (deepchem#4121)
Browse files Browse the repository at this point in the history
  • Loading branch information
KitVB authored Sep 11, 2024
1 parent 5cd9e6f commit 632c427
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
10 changes: 6 additions & 4 deletions deepchem/data/tests/test_deepvariant_featurizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ def test_candidate_windows(self):
candidate_windows = self.featurizer._featurize(datapoint)

# Assert the number of reads
self.assertEqual(len(candidate_windows), 14)
self.assertEqual(candidate_windows[13],
('chr2', 193, 197, 18, 21,
['GTAAATTGATTTGAATTTTATTTCTTGGTAATGAGG']))
self.assertEqual(len(candidate_windows), 15)
self.assertEqual(candidate_windows[13][0], 'chr2')
self.assertEqual(candidate_windows[13][1], 136)
self.assertEqual(candidate_windows[13][2], 137)
self.assertEqual(candidate_windows[13][3], 102)
self.assertEqual(candidate_windows[13][4], 21)


if __name__ == "__main__":
Expand Down
5 changes: 1 addition & 4 deletions deepchem/feat/bio_seq_featurizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,7 @@ def _featurize(self, datapoint):

if (self.get_pileup):
pileup_columns = []
for pileupcolumn in datapoint.pileup(
reference=record.reference_name,
start=record.reference_start,
end=record.reference_end):
for pileupcolumn in datapoint.pileup():
pileup_info = {
"name":
pileupcolumn.reference_name,
Expand Down

0 comments on commit 632c427

Please # to comment.