Skip to content

Commit dd26daf

Browse files
MarkusPiotrowskipeterjc
authored andcommitted
Manually improving markup and code style of multiple pages.
1 parent dd7883d commit dd26daf

6 files changed

+249
-244
lines changed

wiki/Degenerated_Codons.md

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Degenerated Codons
2+
title: Methods for Degenerated Codons
33
permalink: wiki/Degenerated_Codons
44
layout: wiki
55
redirect_from:
@@ -19,15 +19,16 @@ Solution
1919
``` python
2020
from Bio.Data.CodonTable import unambiguous_dna_by_id
2121

22-
def altcodons( codon, table ):
23-
"""
24-
list codons that code for the same aminoacid / are also stop
22+
23+
def altcodons(codon, table):
24+
"""List codons that code for the same aminonacid / are also stop.
25+
2526
@param codon
2627
@table code table id
2728
@return list of codons
28-
"""
2929
30-
tab = unambiguous_dna_by_id[ table ]
30+
"""
31+
tab = unambiguous_dna_by_id[table]
3132

3233
if codon in tab.stop_codons:
3334
return tab.stop_codons
@@ -37,42 +38,39 @@ def altcodons( codon, table ):
3738
except:
3839
return []
3940

40-
return [k for ( k, v ) in tab.forward_table.iteritems() if v == aa and k[0] == codon[0] and k[1] == codon[1]]
41+
return [k for (k, v) in tab.forward_table.iteritems()
42+
if v == aa and k[0] == codon[0] and k[1] == codon[1]]
43+
44+
45+
def degeneration(codon, table):
46+
"""Determine how many codons code for the same amino acid / are also stop
4147
42-
def degeneration( codon, table ):
43-
"""
44-
determine how many codons code for the same amino acid / are also stop
45-
as codon
46-
4748
@param codon the codon
48-
@param table code table id
49-
@param the number of codons also coding for the aminoacid codon codes for
49+
@param table code table id
50+
@param the number of codons also coding for the amino acid codon codes for
51+
5052
"""
53+
return len(altcodons(codon, table))
5154

52-
return len( altcodons( codon, table ) )
5355

54-
def isXdegenerated( x, codon, table ):
55-
"""
56-
determine if codon is x-fold degenerated
56+
def is_x_degenerated(x, codon, table):
57+
"""Determine if codon is x-fold degenerated.
5758
5859
@param codon the codon
59-
@param table code table id
60+
@param table code table id
6061
@param true if x <= the degeneration of the codon
61-
"""
62-
63-
return ( x <= len( altcodons( codon, table ) ) )
6462
65-
def degenerated_subseq( seq, x, table ):
66-
"""
67-
get a subsequence consisting of the x-fold degenerated codons only
6863
"""
64+
return (x <= len(altcodons(codon, table)))
65+
6966

67+
def degenerated_subseq(seq, x, table):
68+
"""Get a subsequence consisting of the x-fold degenerated codons only."""
7069
data = ""
71-
for i in range( 0, len( seq ), 3 ):
70+
for i in range(0, len(seq), 3):
7271
codon = seq[i:i + 3].tostring()
73-
if isXdegenerated( x, codon, table ):
72+
if isXdegenerated(x, codon, table):
7473
data += codon
7574
return data
76-
```
7775

78-
<category:Cookbook>
76+
```

wiki/Deprecation_policy.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ remove such code from Biopython, while avoiding any nasty surprises for
1111
users who may be relying on older code.
1212

1313
We keep a plain text file in the Biopython source code to record these
14-
changes, available
15-
[here](http://biopython.open-bio.org/SRC/biopython/DEPRECATED) or on
16-
[github](http://github.com/biopython/biopython/blob/master/DEPRECATED).
14+
changes, available on
15+
[GitHub](http://github.com/biopython/biopython/blob/master/DEPRECATED) or
16+
[here](http://biopython.open-bio.org/SRC/biopython/DEPRECATED).
1717

1818
This is the current policy for deprecating and removing code from
1919
Biopython:
2020

2121
- First, ask on the biopython and biopython-dev [mailing
22-
lists](mailing_lists "wikilink") whether a given piece of code has
22+
lists](Mailing_lists "wikilink") whether a given piece of code has
2323
any users. Please keep in mind that not all users are following the
2424
biopython-dev mailing list.
2525
- Consider declaring the module as "obsolete" for a release
@@ -35,13 +35,15 @@ Biopython:
3535
ideally with examples or a reference to the tutorial.
3636
- Most importantly, add a DeprecationWarning to the code:
3737

38-
`import warnings`
39-
`warnings.warn("Bio.SomeModule has been deprecated, and we intend to remove it"`
40-
`              " in a future release of Biopython. Please use the SomeOtherModule"`
41-
`              " instead, as described in the Tutorial. If you would like to"`
42-
`              " continue using Bio.SomeModule, please contact the Biopython"`
43-
`              " developers via the mailing list.",`
44-
`              DeprecationWarning)`
38+
```
39+
import warnings
40+
warnings.warn("Bio.SomeModule has been deprecated, and we intend to remove it"
41+
              " in a future release of Biopython. Please use the SomeOtherModule"
42+
              " instead, as described in the Tutorial. If you would like to"
43+
              " continue using Bio.SomeModule, please contact the Biopython"
44+
              " developers via the mailing list.",
45+
              DeprecationWarning)
46+
```
4547

4648
- In principle, we require that two Biopython releases carrying the
4749
deprecation warning are made before the code can be

wiki/Documentation.md

Lines changed: 40 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ permalink: wiki/Documentation
44
layout: page
55
---
66

7-
#### Documentation
8-
97
New to Biopython? Check out the [Getting
108
Started](Getting_Started "wikilink") page, or follow one of the links
119
below.
@@ -32,8 +30,9 @@ below.
3230
- Wiki documentation,
3331
- [Seq](Seq "wikilink") and [SeqRecord](SeqRecord "wikilink")
3432
objects
35-
- [Bio.SeqIO](SeqIO "wikilink") - sequence input/output
33+
- [Bio.SeqIO](SeqIO "wikilink") - sequence input/output
3634
- [Bio.AlignIO](AlignIO "wikilink") - alignment input/output
35+
- [Bio.Restriction](Restriction "wikilink") - using restriction enzymes
3736
- [Bio.PopGen](PopGen "wikilink") - population genetics
3837
- [Bio.PDB](The_Biopython_Structural_Bioinformatics_FAQ "wikilink") -
3938
structural bioinformatics
@@ -48,87 +47,91 @@ below.
4847
- Documentation for the cluster module in Biopython. This describes
4948
the underlying C library and the Python interface.
5049

51-
[PDF](http://biopython.org/DIST/docs/cluster/cluster.pdf)
50+
[PDF (2008)](http://biopython.org/DIST/docs/cluster/cluster.pdf) |
51+
[PDF (2013)](http://bonsai.hgc.jp/~mdehoon/software/cluster/cluster.pdf)
5252

5353
- Cookbook-style documentation:
5454
- [Cookbook documentation](Category%3ACookbook "wikilink") (on
55-
the wiki)
55+
the wiki).
5656
- The Biopython Structural Bioinformatics FAQ (i.e. how to use the
5757
Bio.PDB module).
58-
5958

60-
[PDF](http://biopython.org/DIST/docs/cookbook/biopdb_faq.pdf)
61-
62-
- Working with restriction enzymes.
59+
[PDF](http://biopython.org/DIST/docs/tutorial/biopdb_faq.pdf)
6360

61+
- [Working with restriction enzymes](Restriction "wikilink").
6462

65-
[HTML](http://biopython.org/DIST/docs/cookbook/Restriction.html)
6663

6764
#### Documentation for Developers
6865

6966
- List of [Active projects](Active_projects "wikilink") to get
7067
involved with.
7168
- How to [contribute code](Contributing "wikilink") to Biopython.
7269
- [Deprecation policy](Deprecation_policy "wikilink")
73-
- Instructions for [building a release](building_a_release "wikilink")
70+
- Instructions for [building a release](Building_a_release "wikilink")
7471
of Biopython.
75-
- Details about the biopython.org [website](website "wikilink").
72+
- Details about the biopython.org [website](https://github.com/biopython/biopython.github.io).
7673

7774
#### Online Course Notes
7875

7976
- Andrew Dalke taught an introduction to programming for
8077
Bioinformatics in Python class at the National Bioinformatics
8178
Network in South Africa.
8279

83-
<http://www.dalkescientific.com/writings/NBN/>
80+
[html](http://www.dalkescientific.com/writings/NBN/)
8481

85-
- Ravinder Singh and Scott Kelley teach a Bioinformatics course using
86-
Biopython at the University of Colorado.
87-
88-
<http://www.colorado.edu/catalog/2012-13/courses?college=ARSC&department=B-MCDB>
82+
- Kristian Rother wrote a GitBook for learning Biopython with two case studies
83+
84+
[GitBook](https://www.gitbook.com/book/krother/biopython-tutorial/details)
8985

9086

9187
#### Papers
9288

9389
We have a separate list of [publications citing or using
9490
Biopython](Publications "wikilink"). If you use Biopython in a
9591
scientific publication, please cite the application note
96-
<cite>CockEtAl2009</cite> and/or one of the other listed papers:
92+
([Cock *et al.*, 2009](http://dx.doi.org/10.1093/bioinformatics/btp163))
93+
and/or one of the other listed papers:
9794

98-
<biblio>
95+
1. Cock PA, Antao T, Chang JT, Bradman BA, Cox CJ, Dalke A, Friedberg I, Hamelryck T, Kauff F,
96+
Wilczynski B and de Hoon MJL (2009) Biopython: freely available Python tools for computational
97+
molecular biology and bioinformatics. [Bioinformatics, 25, 1422-1423](http://dx.doi.org/10.1093/bioinformatics/btp163)
9998

100-
1. CockEtAl2009 pmid=19304878
99+
// This application note covers the whole of Biopython
101100

102-
// This application note covers the whole of Biopython
101+
2. Chapman BA and Chang JT (2000). Biopython: Python tools for computational biology.
102+
[ACM SIGBIO Newsletter, 20, 15-19](http://dx.doi.org/10.1145/360262.360268).
103103

104-
1. ChapmanAndChang2000 Chapman BA and Chang JT. *Biopython: Python
105-
tools for computational biology.* ACM SIGBIO Newsletter 2000 Aug;
106-
20, 15-19. [HTML](http://biopython.org/DIST/docs/acm/ACMbiopy.html)
104+
[HTML](http://biopython.org/DIST/docs/acm/ACMbiopy.html)
107105
| [PDF](http://biopython.org/DIST/docs/acm/ACMbiopy.pdf)
108106

109-
// This served as the official project announcement.
107+
// This served as the official project announcement.
110108

111-
1. HamelryckAndManderick2003 pmid=14630660
109+
3. Hamelryck T and Manderick B (2003) PDB file parser and structure class implemented in Python.
110+
[Bioinformatics, 22, 2308-2310](http://dx.doi.org/10.1093/bioinformatics/btg299)
112111

113-
// The Bio.PDB module is described here.
112+
// The `Bio.PDB` module is described here.
114113

115-
1. DeHoonEtAl2004 pmid=14871861
114+
4. de Hoon MJ, Imoto S, Nolan J and Miyano S (2004) Open source clustering software.
115+
[Bioinformatics, 20, 1454-1453](http://dx.doi.org/10.1093/bioinformatics/bth078)
116116

117-
// The Bio.Cluster module is described here.
117+
// The `Bio.Cluster` module is described here.
118118

119-
1. PritchardEtAl2006 pmid=16377612
119+
5. Pritchard L, White JA, Birch PR and Toth IK (2006) GenomeDiagram: a Python package for the
120+
visualization of large-scale genomic data. [Bioinformatics, 22, 616-617](http://dx.doi.org/10.1093/bioinformatics/btk021)
120121

121-
// This describes GenomeDiagram, which has now been integrated into
122-
Biopython.
122+
// This describes `GenomeDiagram`, which has now been integrated into Biopython.
123123

124-
1. CockEtAl2009b pmid=20015970
124+
6. Cock PJ, Fields CJ, Goto N, Heuer ML and Rice PM (2009) The Sanger FASTQ file format for sequences with
125+
quality scores, and the Solexa/Illumina FASTQ variants.
126+
[Nucleic Acids Res., 38, 1767-1771](http://dx.doi.org/10.1093/nar/gkp1137)
125127

126-
// This describes the FASTQ file format as supported in Biopython,
127-
BioPerl, BioRuby, BioJava and EMBOSS
128+
// This describes the FASTQ file format as supported in Biopython, BioPerl, BioRuby, BioJava and EMBOSS
128129

129-
1. TalevichEtAl2012 pmid=22909249
130+
7. Talevich E, Invergo BM, Cock PJ and Chapman BA (2012) Bio.Phylo: a unified toolkit for processing, analyzing
131+
and visualizing phylogenetic trees in Biopython.
132+
[BMC Bioinformatics, 13, 209](http://dx.doi.org/10.1186/1471-2105-13-209)
130133

131-
// This describes the Bio.Phylo and Bio.Phylo.PAML modules. </biblio>
134+
// This describes the `Bio.Phylo` and `Bio.Phylo.PAML modules`.
132135

133136
#### Presentations
134137

0 commit comments

Comments
 (0)