diff --git a/cirDraw/restart_uwsgi.sh b/cirDraw/restart_uwsgi.sh index 8b07742..4f09cf3 100644 --- a/cirDraw/restart_uwsgi.sh +++ b/cirDraw/restart_uwsgi.sh @@ -6,4 +6,4 @@ sudo uwsgi --ini /home/circ/circDraw/cirDraw/uwsgi.ini --uid circ --enable-threa cd /home/circ/circDraw/process_watchdog/ python3 resetdb.py admin_login.json clean -#> /var/log/uwsgi/circDraw.log +> /var/log/uwsgi/circDraw.log diff --git a/cirDraw/static/tools/js/drawCirc.js b/cirDraw/static/tools/js/drawCirc.js index 728523e..0b99888 100644 --- a/cirDraw/static/tools/js/drawCirc.js +++ b/cirDraw/static/tools/js/drawCirc.js @@ -507,6 +507,7 @@ function drawCircRNA(exonComponents, circStart, circEnd) { for (i = 0, up = exons.length; i < up; i++) { var start = exons[i].start, end = exons[i].end, + disease = exons[i].disease, exStartAngle = startAngle, exEndAngle = startAngle + ((end - start) / len) * 360, type = exons[i].type, @@ -831,7 +832,8 @@ function drawArc(data) { infobox = infoBox(x, y, { name: $chr.text() + ' : ' + data.start + ' - ' + data.end, position: data.start + "-" + data.end, - source: data.source + source: data.source, + disease: data.disease, }); }).mouseout(function () { Snap.animate(5, 1, function (val) { diff --git a/cirDraw/static/tools/js/upload.js b/cirDraw/static/tools/js/upload.js index 4b81890..9526453 100644 --- a/cirDraw/static/tools/js/upload.js +++ b/cirDraw/static/tools/js/upload.js @@ -187,6 +187,8 @@ $(document).ready(function () { status = reportID[0].save_status; //console.log(reportID, status); if (status === false) { + $('.lds-roller').remove(); + $('#upload-text').remove(); $('#processtip').html('

Processing Failed! Wrong file type or server failed. Please refresh

'); $('#refresher').hover(function(){ $('#refresher').css({'cursor':'pointer', 'color': '#fed136'}); diff --git a/cirDraw/tools/handle_file.py b/cirDraw/tools/handle_file.py index cde0d9b..0bc7bfc 100644 --- a/cirDraw/tools/handle_file.py +++ b/cirDraw/tools/handle_file.py @@ -216,11 +216,20 @@ def process_file(file, assembly: str, file_type, task_id, bias=2): print('demjson decode ERROR:', e) for i in components: i['mods'] = ujson.loads(i['mods']) + with connection.cursor() as cur: + cur.execute(f'select disease from circ_disease where assembly="{assembly}" and chr_num="{chr_num}" and start>={start-bias} and start<={start+bias} and end<={end+bias} and end>={end-bias};') + disease = cur.fetchall() + print(disease) + if len(disease) == 0: + disease = 'Unknown' + else: + disease = disease[0] circ_json = {"start": int(circ[3]), "end": int(circ[4]), "source": "CIRCpedia V2", "gene": circ[0], "transcript": circ[1], + "disease": disease, "components": components} #print('This is gene of circ', circ[0]) @@ -268,12 +277,21 @@ def process_file(file, assembly: str, file_type, task_id, bias=2): for i in components: i['mods'] = ujson.loads(i['mods']) #print('alter components') + with connection.cursor() as cur: + cur.execute(f'select disease from circ_disease where assembly="{assembly}" and chr_num="{chr_num}" and start>={start-bias} and start<={start+bias} and end<={end+bias} and end>={end-bias};') + disease = cur.fetchall() + if len(disease) == 0: + disease = 'Unknown' + else: + disease = disease[0] + try: circ_on_gene[gene][1].append({"start": int(circ[1]), "end": int(circ[2]), "source": "circDraw_annotated", "gene": gene, "transcript": transcript, + "disease": disease, "components": components}) except: # get gene info @@ -288,6 +306,7 @@ def process_file(file, assembly: str, file_type, task_id, bias=2): "source": "circDraw_annotated", "gene": gene, "transcript": transcript, + "disease": disease, "components": components}]] except Exception as e: print("Add circ error:", e) diff --git a/cirDraw/tools/models.py b/cirDraw/tools/models.py index 0ca61f9..dda8843 100644 --- a/cirDraw/tools/models.py +++ b/cirDraw/tools/models.py @@ -20,6 +20,20 @@ class Meta: db_table = 'chromosome_length' managed = False +class circ_disease(models.Model): + """Store known chromosome length, fixed by existed knowledge.""" + id = models.AutoField(primary_key=True) + assembly = models.CharField(max_length=100) + chr_num = models.CharField(max_length=50) + start = models.IntegerField() + end = models.IntegerField() + name = models.CharField(max_length=255) + disease = models.CharField(max_length=255) + + class Meta: + db_table = 'circ_disease' + managed = False + # Species genome _assembly = ['hg19', 'hg38', 'rn6', 'danRer11', 'sacCer3', 'mm10'] diff --git a/process_watchdog/resetdb.py b/process_watchdog/resetdb.py index 2c3a60b..39fb91d 100644 --- a/process_watchdog/resetdb.py +++ b/process_watchdog/resetdb.py @@ -91,7 +91,10 @@ def cleandb_except(connector, exception_box, exceptions): # delete from table where exceptions won't be deleted. operator = mc.Operator(connector) for t in exception_box: - operator.clean_table(t, {'md5': ['!=', exceptions]}) + if exceptions != '': + operator.clean_table(t, {'md5': ['!=', exceptions]}) + else: + operator.clean_table(t) print('Exception drop Success in ', t) operator.terminate() @@ -142,7 +145,7 @@ def main(login_file_name, inp): elif inp == "clean": clean_box = ['tools_species_circrnas', 'tools_species_genome_exons_introns', 'tools_species_genome_genes', 'tools_species_genome_transcripts'] - example_md5 = '8bd10a77cbda74ed2513d2643a39b0bb' + example_md5 = ''#'8bd10a77cbda74ed2513d2643a39b0bb' path_box = ["../cirDraw/media/md5_data/"] empty_db(connector, clean_box) empty_dir(path_box) diff --git a/related_genome_info/process_pkg/mysqlconnect.py b/related_genome_info/process_pkg/mysqlconnect.py index 2bb1a1a..98ca556 100644 --- a/related_genome_info/process_pkg/mysqlconnect.py +++ b/related_genome_info/process_pkg/mysqlconnect.py @@ -211,7 +211,7 @@ def create_table_core(self, table_name, table_columns): # auto-clean - def autoclean(self, timenow): + #def autoclean(self, timenow):