Skip to content

Commit

Permalink
Fix incompatibility with latest vdjdb release (#578)
Browse files Browse the repository at this point in the history
* Fix incompatibility with latest vdjdb release

* Update changelog
  • Loading branch information
grst authored Dec 5, 2024
1 parent 0d0201a commit 51df89e
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 98 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,5 @@ dmypy.json
.pyre/

.DS_Store

uv.lock
10 changes: 7 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning][].
[keep a changelog]: https://keepachangelog.com/en/1.0.0/
[semantic versioning]: https://semver.org/spec/v2.0.0.html

## [Unreleased]
## v0.20.0

### Backwards-incompatible changes

Expand All @@ -19,8 +19,12 @@ and this project adheres to [Semantic Versioning][].

### Additions

- The function `pl.logoplot_cdr3_motif` has been added that allows to plot sequence logos of
CDR3 sequences using [logomaker](https://logomaker.readthedocs.io/en/latest/) ([#534](https://github.com/scverse/scirpy/pull/534))
- Add `pl.logoplot_cdr3_motif` that allows to plot sequence logos of
CDR3 sequences using [logomaker](https://logomaker.readthedocs.io/en/latest/) ([#534](https://github.com/scverse/scirpy/pull/534)).

### Fixes

- Make `datasets.vdjdb` compatible with the latest release of VDJDB ([#578](https://github.com/scverse/scirpy/pull/578)).

### Documentation

Expand Down
193 changes: 100 additions & 93 deletions docs/tutorials/tutorial_3k_tcr.ipynb

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions src/scirpy/datasets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def vdjdb(cached: bool = True, *, cache_path="data/vdjdb.h5ad") -> AnnData:
urllib.request.urlretrieve(url, d / "vdjdb.tar.gz")
with zipfile.ZipFile(d / "vdjdb.tar.gz") as zf:
zf.extractall(d)
df = pd.read_csv(d / "vdjdb_full.txt", sep="\t", low_memory=False)
df = pd.read_csv(next(iter(d.glob("**/vdjdb_full.txt"))), sep="\t", low_memory=False)

tcr_cells = []
for idx, row in tqdm(df.iterrows(), total=df.shape[0], desc="Processing VDJDB entries"):
Expand Down Expand Up @@ -245,7 +245,6 @@ def vdjdb(cached: bool = True, *, cache_path="data/vdjdb.h5ad") -> AnnData:
"meta.donor.MHC",
"meta.donor.MHC.method",
"meta.structure.id",
"vdjdb.score",
]
for f in INCLUDE_CELL_METADATA_FIELDS:
cell[f] = row[f]
Expand Down

0 comments on commit 51df89e

Please sign in to comment.