Skip to content
Snippets Groups Projects
Commit e0b7960c authored by Amaury LEROY's avatar Amaury LEROY
Browse files

10/03

parent b0f40c87
No related branches found
No related tags found
No related merge requests found
......@@ -4,31 +4,37 @@ Created on Tue Jan 22 15:39:51 2019
@author: Amaury Leroy
"""
######################## PROJET JEAN-MARC STEYAERT ############################
import numpy as np
import re
import os
from Bio.ExPASy import Prosite
#help(Prosite)
print("1. Détection de signatures sur un génome complet")
print("1.1 Identification du motif")
import urllib.request
urllib.request.urlretrieve("ftp://ftp.expasy.org/databases/prosite/prosite.dat", "prosite.dat")
handle = open("prosite.dat")
records = Prosite.parse(handle)
#for record in records:
for record in (r for r in records if "P-loop" in r.description):
print(record.accession)
print(record.pattern)
print("Le code d'accès Prosite du motif est: ", record.accession)
print("Son motif structural est: ",record.pattern)
handle.close()
#Questions 3/4/5
print("1.2 Lecture du format")
import subprocess
import Bio.SeqIO
def download_orf_code():
urllib.request.urlretrieve("http://downloads.yeastgenome.org/sequence/S288C_reference/orf_dna/orf_coding_all.fasta.gz", "orf.fasta.gz")
subprocess.call(["gunzip", "-k", "orf.fasta.gz"])
return "orf.fasta.gz"
print("La taille du fichier fasta est: ",os.stat("orf.fasta").st_size," bytes")
return "orf.fasta"
def read_fasta(filename):
file = open(filename, "r")
......@@ -37,7 +43,6 @@ def read_fasta(filename):
file.close()
filename = download_orf_code()
filename = "orf.fasta"
read_fasta(filename)
......@@ -176,7 +181,7 @@ for i in ploop_indices:
if no_site:
unrestricted.append((rec.id, no_site))
import os
#os.mkdir("cartes_restrictions")
for sequence in sequences:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment