Skip to content

Commit

Permalink
Merge 173f8c1 into 242050a
Browse files Browse the repository at this point in the history
  • Loading branch information
cameronmartino committed Mar 8, 2019
2 parents 242050a + 173f8c1 commit e87481b
Show file tree
Hide file tree
Showing 12 changed files with 65 additions and 9 deletions.
45 changes: 45 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# DEICODE changelog

## Version 0.1.6 (2019-3-8)

In PR#27

### Features

### Backward-incompatible changes [stable]

### Backward-incompatible changes [experimental]

### Performance enhancements

### Bug fixes

* Centered the feature and sample loadings for biplot visualization (issue #26).

### Deprecated functionality [stable]

### Deprecated functionality [experimental]

### Miscellaneous

* Fixed the broken image links.

## Version 0.1.5

Original "working" code

### Features

### Backward-incompatible changes [stable]

### Backward-incompatible changes [experimental]

### Performance enhancements

### Bug fixes

### Deprecated functionality [stable]

### Deprecated functionality [experimental]

### Miscellaneous
2 changes: 1 addition & 1 deletion deicode/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
#
# ----------------------------------------------------------------------------

__version__ = "0.1.5"
__version__ = "0.1.6"
2 changes: 2 additions & 0 deletions deicode/q2/_method.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ def sample_filter(val, id_, md): return sum(val) > min_sample_count
feature_loading = pd.DataFrame(opt.feature_weights, index=table.columns)
feature_loading = feature_loading.rename(columns=rename_cols)
feature_loading.sort_values('PC1', inplace=True, ascending=True)
feature_loading -= feature_loading.mean(axis=0)

# Sample Loadings
sample_loading = pd.DataFrame(opt.sample_weights, index=table.index)
sample_loading = sample_loading.rename(columns=rename_cols)
sample_loading -= sample_loading.mean(axis=0)

# % var explained
proportion_explained = pd.Series(opt.explained_variance_ratio,
Expand Down
2 changes: 2 additions & 0 deletions deicode/scripts/_rpca.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@ def sample_filter(val, id_, md): return sum(val) > min_sample_depth
feature_loading = pd.DataFrame(opt.feature_weights, index=table.columns)
feature_loading = feature_loading.rename(columns=rename_cols)
feature_loading.sort_values('PC1', inplace=True, ascending=True)
feature_loading -= feature_loading.mean(axis=0)

# Sample Loadings
sample_loading = pd.DataFrame(opt.sample_weights, index=table.index)
sample_loading = sample_loading.rename(columns=rename_cols)
sample_loading -= sample_loading.mean(axis=0)

proportion_explained = pd.Series(opt.explained_variance_ratio,
index=list(rename_cols.values()))
Expand Down
Binary file added ipynb/tutorials/etc/img8.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ipynb/tutorials/etc/img9.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 13 additions & 6 deletions ipynb/tutorials/moving-pictures.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 1,
"metadata": {},
"outputs": [
{
Expand All @@ -104,7 +104,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 2,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -135,7 +135,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 3,
"metadata": {},
"outputs": [
{
Expand All @@ -161,14 +161,14 @@
"source": [
"Biplots are exploratory visualization tools that allow us to represent the features (i.e. taxonomy or OTUs) that strongly influence the principal component axis as arrows. The interpretation of the compositional biplot differs slightly from classical biplot interpretation (we can view the qzv file at [view.qiime2](https://view.qiime2.org). The important features with regard to sample clusters are not a single arrow but by the log ratio between features represented by arrows pointing in different directions. A visualization tool for these log ratios is coming soon to QIIME. \n",
"\n",
"![](http://i66.tinypic.com/28rm5pj.png)\n",
"![](etc/img8.png)\n",
"\n",
"From this visualization we noticed that BodySite seems to explain the clusters well. We can run [PERMANOVA](https://docs.qiime2.org/2019.1/plugins/available/diversity/beta-group-significance/) on the distances to get a statistical significance for this. "
]
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 4,
"metadata": {},
"outputs": [
{
Expand All @@ -194,8 +194,15 @@
"source": [
"Indeed we can now see that the clusters we saw in the biplot were significant by viewing the BodySite_significance.qzv at [view.qiime2](https://view.qiime2.org).\n",
"\n",
"![](http://i66.tinypic.com/vy6y6c.jpg)"
"![](etc/img9.png)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
4 changes: 2 additions & 2 deletions ipynb/tutorials/moving-pictures.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ qiime emperor biplot \

Biplots are exploratory visualization tools that allow us to represent the features (i.e. taxonomy or OTUs) that strongly influence the principal component axis as arrows. The interpretation of the compositional biplot differs slightly from classical biplot interpretation (we can view the qzv file at [view.qiime2](https://view.qiime2.org). The important features with regard to sample clusters are not a single arrow but by the log ratio between features represented by arrows pointing in different directions. A visualization tool for these log ratios is coming soon to QIIME.

![](etc/img6.png)
![](etc/img8.png)

From this visualization we noticed that BodySite seems to explain the clusters well. We can run [PERMANOVA](https://docs.qiime2.org/2019.1/plugins/available/diversity/beta-group-significance/) on the distances to get a statistical significance for this.

Expand All @@ -131,7 +131,7 @@ From this visualization we noticed that BodySite seems to explain the clusters w

Indeed we can now see that the clusters we saw in the biplot were significant by viewing the BodySite_significance.qzv at [view.qiime2](https://view.qiime2.org).

![](etc/img7.png)
![](etc/img9.png)

## Citation

Expand Down
Binary file not shown.
Binary file modified ipynb/tutorials/qiime2-moving-pictures-tutorial/biplot.qzv
Binary file not shown.
Binary file modified ipynb/tutorials/qiime2-moving-pictures-tutorial/distance.qza
Binary file not shown.
Binary file modified ipynb/tutorials/qiime2-moving-pictures-tutorial/ordination.qza
Binary file not shown.

0 comments on commit e87481b

Please sign in to comment.