Skip to content

Commit

Permalink
Update and run all jupyter notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
dvklopfenstein committed Jan 14, 2019
1 parent 08a4798 commit 5fbcf3c
Show file tree
Hide file tree
Showing 10 changed files with 864 additions and 1,596 deletions.
2 changes: 1 addition & 1 deletion goatools/rpt/rpt_lev_depth.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def _write_summary_cnts(self, cnts):
self.log.write('Lev BP MF CC BP MF CC\n')
self.log.write('--- ---- ---- ---- ---- ---- ----\n')
for i in range(max_val+1):
vals = ['{:>5}'.format(cnts[desc][i][ns]) for desc in cnts for ns in self.nss]
vals = ['{:>5}'.format(cnts[desc][i][ns]) for desc in sorted(cnts) for ns in self.nss]
self.log.write('{:>02} {}\n'.format(i, ' '.join(vals)))

@staticmethod
Expand Down
79 changes: 42 additions & 37 deletions notebooks/annotation_coverage.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {
"collapsed": false
},
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
Expand All @@ -49,11 +47,18 @@
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {
"collapsed": false
},
"outputs": [],
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" 20,385 items READ: gene2go\n",
" 11,563 items READ: gene2go\n"
]
}
],
"source": [
"from goatools.associations import read_ncbi_gene2go\n",
"\n",
Expand All @@ -70,11 +75,17 @@
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {
"collapsed": false
},
"outputs": [],
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" 31,948 items READ: gene2go\n"
]
}
],
"source": [
"from collections import defaultdict, namedtuple\n",
"\n",
Expand All @@ -94,14 +105,12 @@
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {
"collapsed": false
},
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
"from goatools.test_data.genes_NCBI_9606_ProteinCoding import GeneID2nt as GeneID2nt_human\n",
"from goatools.test_data.genes_NCBI_7227_ProteinCoding import GeneID2nt as GeneID2nt_fly\n",
"from goatools.test_data.genes_NCBI_9606_ProteinCoding import GENEID2NT as GeneID2nt_human\n",
"from goatools.test_data.genes_NCBI_7227_ProteinCoding import GENEID2NT as GeneID2nt_fly\n",
"lst = [\n",
" (9606, GeneID2nt_human),\n",
" (7227, GeneID2nt_fly)\n",
Expand All @@ -118,10 +127,8 @@
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {
"collapsed": false
},
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
"cov_data = []\n",
Expand Down Expand Up @@ -156,19 +163,17 @@
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {
"collapsed": false
},
"execution_count": 10,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" taxid GOs GeneIDs Coverage\n",
"------ ------ ------- ----------------------\n",
" 9606 16,436 18,273 87% GO coverage of 20,913 protein-coding genes\n",
" 7227 6,995 10,591 76% GO coverage of 13,919 protein-coding genes\n"
" 9606 17,975 18,475 88% GO coverage of 20,913 protein-coding genes\n",
" 7227 8,352 10,635 76% GO coverage of 13,919 protein-coding genes\n"
]
}
],
Expand All @@ -191,29 +196,29 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Copyright (C) 2016, DV Klopfenstein, H Tang. All rights reserved."
"Copyright (C) 2016-2019, DV Klopfenstein, H Tang. All rights reserved."
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"display_name": "Python 3",
"language": "python",
"name": "python2"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.11"
"pygments_lexer": "ipython3",
"version": "3.6.1"
}
},
"nbformat": 4,
"nbformat_minor": 0
"nbformat_minor": 1
}
Loading

0 comments on commit 5fbcf3c

Please sign in to comment.