Skip to content

Commit c14c97b

Browse files
committed
reworked documentation
1 parent bd508b6 commit c14c97b

File tree

1 file changed

+13
-24
lines changed

1 file changed

+13
-24
lines changed

python_codon_tables/README.rst

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ Python Codon Tables
44
.. image:: https://travis-ci.org/Edinburgh-Genome-Foundry/codon-usage-tables.svg?branch=master
55
:target: https://travis-ci.org/Edinburgh-Genome-Foundry/codon-usage-tables
66

7-
Provides codon usage tables as dictionnaries, for Python 3+
7+
Provides codon usage tables as dictionnaries, for Python 3+.
88

9-
Supported organisms include:
9+
Tables for the following organisms are provided with the library (any other
10+
table can be downloaded using a TaxID):
1011

1112
- *B. subtilis*
1213
- *C. elegans*
@@ -18,9 +19,6 @@ Supported organisms include:
1819
- *M. musculus domesticus*
1920
- *S. cerevisiae*
2021

21-
It is also possible to download new tables directly with
22-
``download_codons_table(taxid=316407)``.
23-
2422
All the tables are from `kazusa.or.jp <http://www.kazusa.or.jp/codon/readme_codon.html>`_
2523
and here is the original paper to cite:
2624

@@ -66,25 +64,16 @@ Usage
6664
print (table['T']['ACA']) # returns 0.4
6765
print (table['*']['UAA']) # returns 0.61
6866
69-
# LOAD ALL TABLES AT ONCE
67+
# LOAD ONE TABLE BY TAXID (it will get it from the internet if it is not
68+
# in the builtin tables)
69+
table = pct.get_codons_table(1423)
70+
print (table['T']['ACA']) # returns 0.4
71+
print (table['*']['UAA']) # returns 0.61
72+
73+
# LOAD ALL BUIL-IN TABLES AT ONCE
7074
codons_tables = pct.get_all_available_codons_tables()
7175
print (codons_tables['c_elegans_6239']['L']['CUA']) # returns 0.09
7276
73-
# GET A TABLE DIRECTLY FROM THE INTERNET
74-
table = pct.download_codons_table(taxid=316407)
75-
print (table['*']['UGA']) # returns 0.29
76-
77-
If you have an internet connection you can also enter any taxid in
78-
``get_codons_table`` and the table will be downloaded from the Kasuza website.
79-
You can write for instance:
80-
81-
.. code:: python
82-
83-
table = get_codons_table(1423)
84-
table = get_codons_table("1423")
85-
table = get_codons_table("b_subtilis_1423")
86-
table = get_codons_table("b_subtilis")
87-
88-
In the last line above we provided a "shorthand" notation ``b_subtilis``, which
89-
will be automatically extended to b_subtilis_1423 as it appears so in the
90-
built-in table (use this feature at your own risks!)
77+
In ``get_codons_table`` you can also provide a "shorthand" notation
78+
``b_subtilis``, which will be automatically extended to ``b_subtilis_1423`` as
79+
it appears so in the built-in table (use this feature at your own risks!)

0 commit comments

Comments
 (0)