Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
louadi authored May 12, 2020
1 parent 388059a commit 6f47917
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 10 deletions.
9 changes: 7 additions & 2 deletions domain/Process/exonstodomain.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import pickle
import pandas as pd

from django_project import settings
from django.conf import settings
from domain.Process import process_data as pr
from sqlalchemy import text

Expand Down Expand Up @@ -196,7 +196,12 @@ def input_transcript(Ensemble_transID):

#if the transcript have known domains:
exons,domains,unique_domains=pr.transcript(Ensemble_transID)
tran_name,gene_name,Ensemble_geneID,entrezID,gene_description=pr.tranID_convert(Ensemble_transID)

output=pr.tranID_convert(Ensemble_transID)
if output==0: return 0
else: tran_name,gene_name,Ensemble_geneID,entrezID,gene_description=output



text1="The transcript "+tran_name+' have '+str(exons.shape[0])+' exons and '+str(len(unique_domains))+" unique protein domains."
# HTML code to visualize the table
Expand Down
2 changes: 1 addition & 1 deletion domain/Process/gene.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from sqlalchemy import text

from django_project import settings
from django.conf import settings
# --- Get database connection aka 'SQLAlchemie engine'
engine = settings.DATABASE_ENGINE

Expand Down
9 changes: 6 additions & 3 deletions domain/Process/process_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from sqlalchemy import text

from django_project import settings
from django.conf import settings

server = "http://rest.ensembl.org"
cwd = os.getcwd()
Expand Down Expand Up @@ -170,8 +170,11 @@ def tranID_convert(Ensemble_transID):
#df_filter = gene_info['Transcript stable ID'].isin([Ensemble_transID])
#tdata=gene_info[df_filter]



#No domain or wrong entry
if len(tdata)==0: return 0



Ensemble_geneID=tdata["Gene stable ID"].unique()[0]
tran_name=tdata["Transcript name"].unique()[0]
gene_name=tran_name.split('-')[0]
Expand Down
4 changes: 2 additions & 2 deletions domain/Process/proteininfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def get_protein_info(ID):

#Get data about the input transcript or the protein
info,trID=ID_mapper(ID)
if info==0: return 0
domains,unique,exons,text1,domainshtml,Text_nodes,text_edges,tran_name,gene_name,Ensemble_geneID,entrezID,gene_description,exons,droped1,droped2,exons_in_interface=info
#save Image of protein Structure
path='domain/static/images/'
Expand All @@ -25,7 +25,7 @@ def get_protein_info2(ID):

#Get data about the input transcript or the protein
info,trID=ID_mapper(ID)
if info==0: return 0
domains,unique,exons,text1,domainshtml,Text_nodes,text_edges,tran_name,gene_name,Ensemble_geneID,entrezID,gene_description,exons,droped1,droped2,exons_in_interface=info


Expand Down
7 changes: 5 additions & 2 deletions domain/Process/transcript.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from sqlalchemy import text

from django_project import settings
from django.conf import settings
# --- Get database connection aka 'SQLAlchemie engine'
engine = settings.DATABASE_ENGINE

Expand All @@ -21,7 +21,9 @@

def Protein_view(P_id):

domains,unique_domains,exons,text1,domainshtml,Text_nodes,text_edges,tran_name,gene_name,Ensemble_geneID,entrezID,gene_description,exons,droped1,droped2,trID,p=info.get_protein_info(P_id)
i=info.get_protein_info(P_id)
if i==0: return 0
domains,unique_domains,exons,text1,domainshtml,Text_nodes,text_edges,tran_name,gene_name,Ensemble_geneID,entrezID,gene_description,exons,droped1,droped2,trID,p=i



Expand All @@ -32,6 +34,7 @@ def Protein_view(P_id):

else :
print('no interactions')
return 1

#search for the protein domains interactions:
# before coming here need to check if the protein have known domains
Expand Down

0 comments on commit 6f47917

Please sign in to comment.