Add files via upload

This commit is contained in:
HarshitGupta11 2019-06-27 14:01:50 +05:30 committed by GitHub
parent ea37c29761
commit 0b4610bffc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View file

@ -65,9 +65,13 @@ def create_synteny_matrix_mul(gene_seq,g1,g2,n):
for i in range(n): for i in range(n):
if g1[i]=="NULL_GENE": if g1[i]=="NULL_GENE":
continue continue
if gene_seq[g1[i]]=="":
return np.zeros((n,n,2)),np.zeros((n,n,2))
for j in range(n): for j in range(n):
if g2[j]=="NULL_GENE": if g2[j]=="NULL_GENE":
continue continue
if gene_seq[g2[j]]=="":
return np.zeros((n,n,2)),np.zeros((n,n,2))
norm_len=max(len(gene_seq[g1[i]]),len(gene_seq[g2[j]])) norm_len=max(len(gene_seq[g1[i]]),len(gene_seq[g2[j]]))
try: try:
result = ed.align(gene_seq[g1[i]],gene_seq[g2[j]], mode="NW", task="distance") result = ed.align(gene_seq[g1[i]],gene_seq[g2[j]], mode="NW", task="distance")

View file

@ -2,7 +2,8 @@ import pandas as pd
import progressbar import progressbar
import json import json
import numpy as np import numpy as np
import multiprocessing import time
from multiprocessing import Process
from threading import Thread from threading import Thread
from ete3 import Tree from ete3 import Tree
from read_get_gene_seq import read_gene_seq,create_dict from read_get_gene_seq import read_gene_seq,create_dict
@ -114,7 +115,6 @@ def intermediate_process(gene_seq,x,y,n,index,sl,sg,ind):
sl.append(smltemp) sl.append(smltemp)
ind.append(index) ind.append(index)
def synteny_matrix(gene_seq,hdf,lsy,n,enable_break,sg,sl,ind): def synteny_matrix(gene_seq,hdf,lsy,n,enable_break,sg,sl,ind):
#sg=[] #sg=[]
#sl=[] #sl=[]
@ -160,8 +160,9 @@ def synteny_matrix(gene_seq,hdf,lsy,n,enable_break,sg,sl,ind):
th.start() th.start()
th.join(30) th.join(30)
if th.is_alive(): if th.is_alive():
th.join() raise SystemError("Long Time")
print(row) print(row)
th.join()
except Exception as e: except Exception as e:
print(e) print(e)
if t==5 and enable_break==1: if t==5 and enable_break==1: