Sarment ManualLaurent Guéguen |
.seq
, and a filename in FASTA format must end with .fa
or .fst
;
> import sequence > s=sequence.Sequence(fic="toto.fa") > len(s) 10 > b=s[3:5] > print b 3 ACG > b[2]='A' > print s[3:5] 3 ACA > b[:2]="TT" > print s[3:5] # b and s are still linked 3 TTA > b[:2]="ACG" > print b 4 ACGA > print s[3:5] # b and s are no longer linked 3 TTA
|
|
#
). For example, such vectors can be letters frequencies.#
97',1);
#
97',1);
>>> import matrice >>> m=matrice.Matrice(fic="es.mat") >>> print m 5 #20 B 0 1 2 1 3 4 1 4 5 1 >>> len(m) 5 >>> m.desc() ['#20', 'B'] >>> m.max(20) 5 >>> n=m[1:4] >>> print n 3 #20 B 2 1 3 4 1 4 >>> n.val('#20',1) 3.0 >>> n.g_val(7,20,1) >>> print n 3 #20 B 2 1 7 4 1 4 >>> print m 5 #20 B 0 1 2 1 1 4 1 4 5 1
|
|
^
is used to represent beginnings and
ends of sequences. Such a character is handy to build markovian models
from a Compte (see
Proportion).[s,c]
with s a
string and c a number, the word s in added with count c.
.
is a wildcard for all letters, ^
excepted.
>>> import compte >>> c=compte.Compte() >>> c.add_seq("ABCBA",3) >>> c.add_seq("BCBAA",3) >>> c.add_seq("BABAB",3) >>> print c AA^ 1 ABA 1 ABC 1 AB^ 1 A^^ 2 CBA 2 BAA 1 BAB 2 BA^ 1 BCB 2 B^^ 1 ^AB 1 ^BA 1 ^BC 1 >>> c['A'] 6 >>> c['A.'] # number of 'A's followed by a letter 4 >>> c['BAB'] 2 >>> c['BCB'] 2 >>> c['B.B'] 4 >>> c['B^'] # number of ending 'B's 1
^
is kept;
^
;
^
;
"^"
stands for the limits of the
sequence, the words terminating with this symbol are counted as
" same length or longer than given length "-words;
|
|
A | 0.34 |
C | 0.15 |
G | 0.23 |
T | 0.28 |
^
is used to represent beginnings and
ends of sequences."^"
stands for the limits of the
sequence, the words terminating with this symbol are counted as
" same length or longer than given length "-words;
^
stands for begin or end of sequence.
|
|
^
), put character null ('\0') at that position,
and exit;^
, using
strip method;
^
, using
rstrip method;
|
|
|
|
|
||||||
|
|
||||
|
|
|||||
|
|{}
) operator
along the edges of the tree, and the posteriors are output in
their specific format. The order in backward-or operator is not
related with any order in the proportions. Priority is given to
the most specific prior. The −100000 labels are for no-matching
priors.`'
.|()
) and
forward-or (|`'
) operators.
−100000 labels are for not-matching posteriors.>>> import lexique >>> l=lexique.Lexique(str="1:A 2,3:BC") >>> print l 3,2:CB 1:A >>> import descripteur >>> d=descripteur.Descripteur(3,str="Z") >>> print d Z >>> l[2]=d >>> print l 3,2:CZ 1:A >>> d.read_str("P") >>> print l 3,2:CZ 1:A >>> e=descripteur.Descripteur(3,str="Y") >>> l[5]=e 5:Y >>> print l 5:Y 3,2:CZ 1:A >>> l[4,3]=e,d Bad descriptor number 3 already used >>> l[4,6]=e,d 4,6:YP >>> print l 6,4:PY 5:Y 3,2:CZ 1:A >>> del l[3] >>> del l[2] >>> print l 6,4:PY 5:Y 1:A >>> l[3,2]="X",e 3,2:XY >>> print l 2,3:YX 6,4:PY 5:Y 1:A
|
|||||||||||||||||||||||||
|
$
is a wildcard, and cannot be used as a
standard letter. It is used in method
read_str, and is set
successively on all of the letters of the second string argument of
this method. For example:
lit_str("$", "ACG")
builds Lexique: A C G
lit_str("A$A", "TG")
builds Lexique:
ATA AGA
lit_str("`A$$'", "CGT")
builds Lexique:`ACC' `ACG' `ACT' `AGC' `AGG' `AGT' `ATC' `ATG' `ATT'
A
returns 1 on A, and 0 elsewhere, whereas
descriptor A(0.7)
returns 0.7 on A, and 0 elsewhere.letter ::= "a"..."z"|"A"..."Z"
! | returns 1 in any position (even if out of bounds); |
^ |
returns 1 if the position is out of bounds, 0 otherwise. |
special ::= "^" | "!"
^
are 33 and
94, these codes must be used very cautiously.character ::= #0..255
here-plus ::= +(descriptors)
here-mult ::= *(descriptors)
|(`AB'A(0.1)`AC'A(0.2)`AA'A(0.3))
returns 0.1.|(`AB'A(0.1)`AB'A(0.2))
returns 0.1.here-or ::= |(descriptorsdescriptors)
`A(0.5)CB(0.3)'
returns 0.5.forward ::= `descriptors'
|`BC(0.1)CC(0.2)AC(0.3)'
returns 0.1.|`BC(-0.1)BC(0.2)'
returns −0.1.|`B|`BC(0.1)CC(0.2)AC(0.3)'C|`BC(0.4)CC(0.5)AC(0.6)'A|`BC(0.7)CC(0.8)AC(0.9)''
returns 0.7.forward-or ::= |`descriptorsdescriptors'
{A(0.5)CB(0.3)}
returns 0.3.backward ::= {descriptors}
backward-plus ::= +{descriptors}
|{BC(0.1)CC(0.2)AC(0.3)}
returns 0.1.|{BC(-0.1)BC(0.2)}
returns −0.1.|{B|{BC(0.1)CC(0.2)AC(0.3)}C|{BC(0.4)CC(0.5)AC(0.6)}A|{BC(0.7)CC(0.8)AC(0.9)}}
returns 0.3.backward-or ::= |{descriptorsdescriptors}
This document was translated from LATEX by HEVEA.