File: example.rst

package info (click to toggle)
python-screed 1.1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 820 kB
  • sloc: python: 3,356; makefile: 169; sh: 32; javascript: 16
file content (34 lines) | stat: -rw-r--r-- 623 bytes parent folder | download | duplicates (5)
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
===============
screed examples
===============

.. contents:

Basic Usage
===========

Load screed, index the database, and return a dictionary-like object:

 >>> import screed
 >>> db = screed.read_fasta_sequences('../screed/tests/test.fa')

Get the list of sequence names, sort alphabetically, and look at the
first one:

 >>> names = db.keys()
 >>> names.sort()
 >>> names[0]
 u'ENSMICT00000000730'

Retrieve that record:

 >>> r = db[names[0]]
 >>> print r.keys()
 [u'description', u'id', u'name', u'sequence']

Print out the internal ID number and the name:

 >>> print r.id
 13
 >>> print r.name
 ENSMICT00000000730