Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
BIOINF588
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Etienne MORICE
BIOINF588
Commits
9fad68fe
Commit
9fad68fe
authored
6 years ago
by
Amaury LEROY
Browse files
Options
Downloads
Patches
Plain Diff
Create projet_steyeart.py
parent
8606ce6c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
projet_steyeart.py
+51
-0
51 additions, 0 deletions
projet_steyeart.py
with
51 additions
and
0 deletions
projet_steyeart.py
0 → 100644
+
51
−
0
View file @
9fad68fe
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 22 15:39:51 2019
@author: Amaury Leroy
"""
import
re
from
Bio.ExPASy
import
Prosite
help
(
Prosite
)
# Questions 1/2 en important depuis mes fichiers,
#j'ai préféré ça plutôt que de télécharger direct mais faudrait changer
handle
=
open
(
"
prosite.dat.txt
"
)
for
record
in
Prosite
.
parse
(
handle
):
if
"
P-loop
"
in
record
.
description
:
print
(
record
.
pattern
)
print
(
record
.
name
)
print
(
record
.
accession
)
#Questions 3/4/5
import
gzip
from
Bio
import
SeqIO
with
gzip
.
open
(
"
orf_coding_all.fasta.gz
"
,
"
rt
"
)
as
handle
:
sequences
=
list
(
SeqIO
.
parse
(
handle
,
"
fasta
"
)
)
print
(
sum
(
len
(
r
)
for
r
in
SeqIO
.
parse
(
handle
,
"
fasta
"
)))
seq_trad
=
[]
for
i
in
range
(
len
(
sequences
)):
seq_trad
.
append
(
sequences
[
i
].
seq
.
translate
(
table
=
"
Yeast Mitochondrial
"
))
with
gzip
.
open
(
"
orf_trans_all.fasta.gz
"
,
"
rt
"
)
as
handle
:
seq_trad_true
=
list
(
SeqIO
.
parse
(
handle
,
"
fasta
"
)
)
compteur
=
0
for
i
in
range
(
len
(
seq_trad
))
:
if
str
(
seq_trad
[
i
])
!=
str
(
seq_trad_true
[
i
].
seq
):
compteur
+=
1
print
(
compteur
,
"
erreur(s) de traduction
"
)
#j'affiche dès qu'une séquence est mal
#traduite (au moins une erreur), en pratique j'ai testé au sein d'une séquence y a
#au moins 3-4 erreurs de traduction
#Question 6. Il manque le stockage et l'histogramme horizontal
regex
=
"
[AG]-x(4)-G-K-[ST]
"
.
translate
({
ord
(
k
):
v
for
k
,
v
in
{
"
-
"
:
""
,
"
(
"
:
"
{
"
,
"
)
"
:
"
}
"
,
"
x
"
:
"
.
"
}.
items
()})
creg
=
re
.
compile
(
regex
)
re
.
search
(
creg
,
"
MSQQVGNSIRRKLVIVGDGACGKTCLLIVFSK
"
)
re
.
search
(
creg
,
str
(
seq_trad_true
[
0
].
seq
))
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment