-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
123 lines (83 loc) · 3.85 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
Transform human mtDNA sequence to variant sites and vice versa.
oldowan.mtconvert is a small, pure Python, bioinformatic utility to (1)
transform human mitochondral DNA sequence data into variant sites relative to
the revised Cambridge Reference Sequence (rCRS) and (2) transform variant sites
data into DNA sequence. Further information on the rCRS and variant site
nomenclature for human mtDNA sequences is available at the mtconvert_ website.
Installation Instructions
=========================
This package is pure Python and has no dependencies outside of the standard
library. The easist way to install is using ``easy_install`` from the
setuptools_ package. This usually goes something like this::
$ easy_install oldowan.mtconvert
or on a unix-like system, assuming you are installing to the main Python
``site-packages`` directory as a non-privileged user, this::
$ sudo easy_install oldowan.mtconvert
You may also use the standard python distutils setup method. Download the
current source archive from the file list towards the bottom of this page,
unarchive it, and install. On Mac OS X and many other unix-like systems, having
downloaded the archive and changed to the directory containing this archive in
your shell, this might go something like::
$ tar xvzf oldowan.mtconvert*
$ cd oldowan.mtconvert*
$ python setup.py install
Quick Start
===========
Import ``seq2sites`` and ``sites2seq`` from oldowan.mtconvert::
>>> from oldowan.mtconvert import seq2sites, sites2seq
Convert sequence to sites::
>>> seq = """TTCTTTCATGGGGAAGCAGATTTGGGTACCACCCAA
GTATTGACTCACCCATCAACAACCGCTATGTATTTCGTACATTACTGCC
AGCCACCATGAATATTGTACAGTACCATAAATACTTGACCACCTGTAGT
ACATAAAAACCCAATCCACATCAAAACCCCCTCCCCATGCTTACAAGCA
AGTACAGCAATCAACCTTCAACTATCACACATCAACTGCAACTCCAAAG
CCACCCCTCACCCACTAGGATACCAACAAACCTACCCACCCTTAACAGT
ACATAGTACATAAAGCCATTTACCGTACATAGCACATTACAGTCAAATC
CCTTCTCGTCCC"""
>>> seq2sites(seq)
Sequences must be contiguous! Separate runs of sequence, such as HVR1 and HVR2
without the intervening sequence interval, must be analyzed separately.
There is also a cutoff on the number of ambigous sites (N) allowed in the
sequence. By default, this is 10 - but this is an option that can be set::
>>> seq2sites(seq, ambig_cutoff=20)
Convert a list of variable sites to sequence. The default sequence region that
is returned is hypervariable region 1 (HVR1), which is positions 16024 to 16365
of the rCRS (in biological one-based numbering)::
>>> sites2seq('16129A 16223T')
Predefined sequence regions are:
- HVR1: 16024-16365
- HVR2: 73-340
- HVR1to2: 16024-340
- coding: 577-15992
- all: 1-16559
So, to convert a list of HVR2 sites to sequence::
>>> sites2seq('73G', region='HVR2')
Sites may also be provided in a list::
>>> sites2seq(['16129A', '16223T', '73G'], region='HVR1to2')
The rCRS sequence will be returned given an empty string, empty list, or the
string 'rCRS'. All of the following are equivalent::
>>> sites2seq('')
>>> sites2seq([])
>>> sites2seq('rCRS')
Arbitrary positions may be selected by passing a list of sites to the
``region`` option::
>>> sites2seq('', region=[1,2,3])
The Python range function is convenient for this, but you must remember that
the range does not include its ending position::
>>> sites2seq('', region=range(73,341)) # include 340, but not 341
Release History ===============
1.0.0 (March 25, 2009)
initial release of module.
1.0.1 (March 25, 2009)
minor versioning fix
1.0.2 (May 27, 2009)
partial RFLP implementation
1.0.3 (June 22, 2015)
add fix for spurious deletions at end of query
1.0.4 (June 22, 2015)
improve fix for spurious deletions at end of query
1.0.5 (June 22, 2015)
sites outside requested region should pass silently; fix for insertions
1.0.6 (August 4, 2015)
fix version number install problem
.. _setuptools: http://peak.telecommunity.com/DevCenter/EasyInstall