-
Notifications
You must be signed in to change notification settings - Fork 6
/
README
106 lines (66 loc) · 1.93 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
uniprot\_tools
==============
uniprot provides a command-line and python interface to access the
uniprot database
available services: map, retrieve
**map** map a list of ids from one format onto another using uniprots
mapping api
::
Args:
query: id or list of ids to be mapped
f: from ACC | P_ENTREZGENEID | ...
t: to ...
format: tab by default
Help:
for a list of all possible mappings visit
'http://www.uniprot.org/faq/28'
**retrieve** request entries by uniprot acc using batch retrieval
::
Args:
query: list of ids to retrieve
format: txt by default
Help:
possible formats:
txt, xml, rdf, fasta, gff
Installation
------------
From pypi (recommended)
~~~~~~~~~~~~~~~~~~~~~~~
::
pip install uniprot_tools
From source (UNIX) as standalone only
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Clone the git repository
::
git clone https://github.com/jdrudolph/uniprot.git
Use ``distutils`` to install the package
::
cd uniprot
sudo python setup.py install
Example
-------
standalone
~~~~~~~~~~
::
uniprot map ACC P_ENTREZGENEID acc_file map_file
This will read UniprotIDs seperated by whitespaces from ``acc_file`` and
store them to ``map_file``.
::
uniprot retrieve acc_file entries.txt
Retrieve textual etries for all uniprot ids in ``acc_file`` and save to
``entries.txt``
Using a pipe:
::
echo P31749 | uniprot map ACC P_ENTREZGENEID
will print the result to ``stdout`` which can be redirected further
::
echo P31749 | uniprot retrieve
will print the result to ``stdout`` which can be redirected further
inside a python script
~~~~~~~~~~~~~~~~~~~~~~
::
import uniprot as uni
print uni.map('P31749', f='ACC', t='P_ENTREZGENEID') # map single id
print uni.map(['P31749','Q16204'], f='ACC', t='P_ENTREZGENEID') # map list of ids
print uni.retrieve('P31749')
print uni.retrieve(['P31749','Q16204'])