Skip to content

Commit

Permalink
Merge pull request #42 from zktuong/devel
Browse files Browse the repository at this point in the history
v0.0.26

last PR for the year maybe?
  • Loading branch information
zktuong committed Dec 29, 2020
2 parents 0248ca6 + 8d072cc commit f254c8e
Show file tree
Hide file tree
Showing 12 changed files with 1,041 additions and 495 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Expand Up @@ -6,3 +6,10 @@
*/*/*/__pycache__/
*/*/__pycache__/
*/__pycache__/
dist/sc-dandelion-0.0.26.tar.gz
sc_dandelion.egg-info/dependency_links.txt
sc_dandelion.egg-info/not-zip-safe
sc_dandelion.egg-info/PKG-INFO
sc_dandelion.egg-info/requires.txt
sc_dandelion.egg-info/SOURCES.txt
sc_dandelion.egg-info/top_level.txt
12 changes: 6 additions & 6 deletions README.md
Expand Up @@ -2,7 +2,7 @@

![dandelion_logo](notebooks/img/dandelion_logo.png)

Version = 0.0.25
Version = 0.0.26

## Intro
Hi there! I have put together a python package for analyzing single cell BCR/V(D)J data from 10x Genomics 5' solution! It streamlines the pre-processing, leveraging some tools from immcantation suite, and integrates with scanpy/anndata for single-cell BCR analysis. It also includes a couple of functions for visualization.
Expand Down Expand Up @@ -36,11 +36,11 @@ First, install [scanpy](https://scanpy.readthedocs.io/en/latest/installation.htm
# these are required by dandelion
conda install -c conda-forge distance joblib plotnine adjustText
conda install -c bioconda igblast blast # if this doesn't work, download them manually (see below)
conda install -c conda-forge rpy2
# or pip install rpy2
conda install -c conda-forge "rpy2>=3.3.2,<3.3.5" # to make compatible for R version 4
# or pip install "rpy2>=3.3.2,<3.3.5"
# If it fails because it's compiling using clang, first, work out where the path is to your gcc compiler (use brew to install gcc if needed):
# then run
# env CC=/path/to/location/of/bin/gcc-9 pip install rpy2
# env CC=/path/to/location/of/bin/gcc-9 pip install "rpy2>=3.3.2,<3.3.5"

# Use pip to install the following with --no-cache-dir --upgrade if necessary
# and then lastly install this
Expand Down Expand Up @@ -68,7 +68,7 @@ python -m ipykernel install --user --name dandelion --display-name "Python (dand
```

## Required database
Last but not least, you will need to download the database folder in this repository and place them somewhere accessible. The igblast and germline database folders were originally downloaded with immcantation's docker image (4.1.0) (https://immcantation.readthedocs.io/en/4.1.0/docker/intro.html). The blast database were downloaded from IMGT manually curated. I have uploaded a copy of the required databases in a separate [repository](https://github.com/zktuong/databases_for_vdj)(Last update: 28/11/2020). Once you've unpacked the folders, export the the path to the database folders as environmental variables in your `~/.bash_profile` or `~/.zshenv` like below. This will allow dandelion to access them easily. In the future, the databases will have to be updated accordingly.
Last but not least, you will need to download the database folder in this repository and place them somewhere accessible. The igblast and germline database folders were originally downloaded with immcantation's docker image (4.1.0) (https://immcantation.readthedocs.io/en/4.1.0/docker/intro.html). The blast database were downloaded from IMGT and manually curated. I have uploaded a copy of the required databases in a separate [repository](https://github.com/zktuong/databases_for_vdj)(Last update: 28/11/2020). Once you've unpacked the folders, export the the path to the database folders as environmental variables in your `~/.bash_profile` or `~/.zshenv` like below. This will allow dandelion to access them easily. In the future, the databases will have to be updated accordingly.

So for example, if I unpack into `~/Documents`
```bash
Expand Down Expand Up @@ -119,7 +119,7 @@ changeo>=1.0.0
presto>=0.6.0
polyleven>=0.5
networkx>=2.4
rpy2>=3.3.2
rpy2>=3.3.2,<3.3.5
```

R packages
Expand Down
4 changes: 3 additions & 1 deletion dandelion/plotting/_plotting.py
Expand Up @@ -2,7 +2,7 @@
# @Author: Kelvin
# @Date: 2020-05-18 00:15:00
# @Last Modified by: Kelvin
# @Last Modified time: 2020-12-13 20:47:47
# @Last Modified time: 2020-12-16 22:29:11

import seaborn as sns
import pandas as pd
Expand All @@ -16,6 +16,7 @@
from adjustText import adjust_text
from plotnine import ggplot, theme_classic, aes, geom_line, xlab, ylab, options, ggtitle, labs, scale_color_manual
from scanpy.plotting import palettes
from time import sleep
import matplotlib.pyplot as plt
from itertools import combinations

Expand Down Expand Up @@ -60,6 +61,7 @@ def clone_rarefaction(self, groupby, clone_key=None, palette=None, figsize=(6,4)
# remove those with no counts
rowsum = res_.sum(axis = 1)
print('removing due to zero counts:', ', '.join([res_.index[i] for i, x in enumerate(res_.sum(axis = 1) == 0) if x]))
sleep(0.5)
res_ = res_[~(res_.sum(axis = 1) == 0)]

# set up for calculating rarefaction
Expand Down
2 changes: 1 addition & 1 deletion dandelion/tools/__init__.py
Expand Up @@ -2,7 +2,7 @@
# @Author: Kelvin
# @Date: 2020-05-13 23:21:45
# @Last Modified by: Kelvin
# @Last Modified time: 2020-11-18 19:54:50
# @Last Modified time: 2020-12-17 13:00:55

from ._tools import find_clones, transfer, define_clones, clone_size, clone_overlap
from ._network import extract_edge_weights, clone_degree, clone_centrality, generate_network
Expand Down

0 comments on commit f254c8e

Please sign in to comment.