john 2 gadi atpakaļ
vecāks
revīzija
89b1ddb434

+ 43 - 0
ClientPlatform/src/pages/result/result.vue

@@ -30,6 +30,18 @@
               alt=""
           /></el-col>
         </el-row>
+        <el-row>
+          <el-col :span="24" class="txt_box">
+            <div>title: SC_GRS 超过0.5的数据下标</div>
+            <br />
+            <div>
+              <p v-if="detail.SC_GRS_list.length">
+                {{ detail.SC_GRS_list.toString().replace(/,/g, ",") }}
+              </p>
+              <span v-else>暂无预测数据</span>
+            </div>
+          </el-col>
+        </el-row>
 
         <el-row>
           <el-col :span="12"
@@ -42,6 +54,18 @@
               alt=""
           /></el-col>
         </el-row>
+        <el-row>
+          <el-col :span="24" class="txt_box">
+            <div>title: OR_GRS 超过0.5的数据下标</div>
+            <br />
+            <div>
+              <p v-if="detail.OR_GRS_list.length">
+                {{ detail.OR_GRS_list.toString().replace(/,/g, ",") }}
+              </p>
+              <span v-else>暂无预测数据</span>
+            </div>
+          </el-col>
+        </el-row>
 
         <el-row>
           <el-col :span="12"
@@ -54,6 +78,18 @@
               alt=""
           /></el-col>
         </el-row>
+        <el-row>
+          <el-col :span="24" class="txt_box">
+            <div>title: DL_GRS 超过0.5的数据下标</div>
+            <br />
+            <div>
+              <p v-if="detail.DL_GRS_list.length">
+                {{ detail.DL_GRS_list.toString().replace(/,/g, ",") }}
+              </p>
+              <span v-else>暂无预测数据</span>
+            </div>
+          </el-col>
+        </el-row>
 
         <el-row>
           <el-col :span="12"
@@ -167,6 +203,13 @@ export default {
     padding-top: 15px;
     padding-bottom: 15px;
 
+    .txt_box {
+      padding: 40px;
+      p {
+        white-space: pre-wrap;
+      }
+    }
+
     .title {
       border-left: 6px solid rgb(246, 144, 61);
       border-top-color: rgb(246, 144, 61);

+ 306 - 0
admin_site/celery.log

@@ -739,3 +739,309 @@ Rdata/94/
 1111
 8888888
 2222
+download/COAD.Rdata
+-----
+download/STAD.Rdata
+-----
+94
+Rdata/94/
+797979
+8383838383
+1111
+8888888
+2222
+113113113113113
+3333
+130130130130 SC_GRS   gene_list.npy 2
+6666666666 
+797979797979 
+8080808080 
+130130130130 Rdata/94/gene_list.npy
+134134134134134134134
+137137137137137
+4444
+download/COAD.Rdata
+-----
+download/STAD.Rdata
+-----
+94
+Rdata/94/
+797979
+8383838383
+1111
+8888888
+2222
+113113113113113
+3333
+130130130130 SC_GRS   gene_list.npy 2
+6666666666 
+797979797979 
+8080808080 
+130130130130 Rdata/94/gene_list.npy
+134134134134134134134
+137137137137137
+4444
+download/COAD.Rdata
+-----
+download/STAD.Rdata
+-----
+94
+Rdata/94/
+797979
+8383838383
+1111
+8888888
+2222
+113113113113113
+3333
+130130130130 SC_GRS   gene_list.npy 2
+6666666666 
+797979797979 
+8080808080 
+130130130130 Rdata/94/gene_list.npy
+134134134134134134134
+137137137137137
+4444
+download/COAD.Rdata
+-----
+download/STAD.Rdata
+-----
+94
+Rdata/94/
+797979
+8383838383
+1111
+8888888
+2222
+113113113113113
+3333
+130130130130 SC_GRS   gene_list.npy 2
+6666666666 
+797979797979 
+8080808080 
+130130130130 Rdata/94/gene_list.npy
+134134134134134134134
+137137137137137
+4444
+download/COAD.Rdata
+-----
+download/STAD.Rdata
+-----
+94
+Rdata/94/
+797979
+8383838383
+1111
+8888888
+2222
+113113113113113
+3333
+130130130130 SC_GRS   gene_list.npy 2
+6666666666 
+797979797979 
+8080808080 
+130130130130 Rdata/94/gene_list.npy
+134134134134134134134
+137137137137137
+4444
+download/COAD.Rdata
+-----
+download/STAD.Rdata
+-----
+94
+Rdata/94/
+797979
+8383838383
+1111
+8888888
+2222
+113113113113113
+3333
+130130130130 SC_GRS   gene_list.npy 2
+6666666666 
+797979797979 
+8080808080 
+130130130130 Rdata/94/gene_list.npy
+134134134134134134134
+137137137137137
+4444
+download/COAD.Rdata
+-----
+download/STAD.Rdata
+-----
+94
+Rdata/94/
+797979
+8383838383
+1111
+8888888
+2222
+113113113113113
+3333
+130130130130 SC_GRS   gene_list.npy 2
+6666666666 
+797979797979 
+8080808080 
+130130130130 Rdata/94/gene_list.npy
+134134134134134134134
+137137137137137
+4444
+download/COAD.Rdata
+-----
+download/STAD.Rdata
+-----
+94
+Rdata/94/
+797979
+8383838383
+1111
+8888888
+2222
+113113113113113
+3333
+130130130130 SC_GRS   gene_list.npy 2
+6666666666 
+797979797979 
+8080808080 
+130130130130 Rdata/94/gene_list.npy
+134134134134134134134
+137137137137137
+4444
+download/COAD.Rdata
+-----
+download/STAD.Rdata
+-----
+94
+Rdata/94/
+797979
+8383838383
+1111
+8888888
+2222
+113113113113113
+3333
+130130130130 SC_GRS   gene_list.npy 2
+6666666666 
+797979797979 
+8080808080 
+130130130130 Rdata/94/gene_list.npy
+134134134134134134134
+137137137137137
+4444
+130130130130 DL_GRS   gene_list.npy 2
+6666666666 
+797979797979 
+8080808080 
+130130130130 OR_GRS   gene_list.npy 2
+6666666666 
+797979797979 
+8080808080 
+download/COAD.Rdata
+-----
+download/STAD.Rdata
+-----
+94
+Rdata/94/
+797979
+8383838383
+1111
+8888888
+2222
+113113113113113
+3333
+130130130130 SC_GRS   gene_list.npy 2
+6666666666 
+797979797979 
+8080808080 
+130130130130 Rdata/94/gene_list.npy
+134134134134134134134
+137137137137137
+4444
+130130130130 DL_GRS   gene_list.npy 2
+6666666666 
+797979797979 
+8080808080 
+130130130130 OR_GRS   gene_list.npy 2
+6666666666 
+797979797979 
+8080808080 
+download/COAD.Rdata
+-----
+download/STAD.Rdata
+-----
+94
+Rdata/94/
+797979
+8383838383
+1111
+8888888
+2222
+download/COAD.Rdata
+-----
+download/STAD.Rdata
+-----
+94
+Rdata/94/
+797979
+8383838383
+1111
+8888888
+2222
+download/COAD.Rdata
+-----
+download/STAD.Rdata
+-----
+94
+Rdata/94/
+797979
+8383838383
+1111
+8888888
+2222
+113113113113113
+3333
+130130130130 SC_GRS   gene_list.npy 2
+6666666666 
+797979797979 
+8080808080 
+130130130130 Rdata/94/gene_list.npy
+134134134134134134134
+137137137137137
+4444
+130130130130 DL_GRS   gene_list.npy 2
+6666666666 
+797979797979 
+8080808080 
+130130130130 OR_GRS   gene_list.npy 2
+6666666666 
+797979797979 
+8080808080 
+download/COAD.Rdata
+-----
+download/STAD.Rdata
+-----
+94
+Rdata/94/
+797979
+8383838383
+1111
+8888888
+2222
+113113113113113
+3333
+130130130130 SC_GRS   gene_list.npy 2
+6666666666 
+797979797979 
+8080808080 
+130130130130 Rdata/94/gene_list.npy
+134134134134134134134
+137137137137137
+4444
+130130130130 DL_GRS   gene_list.npy 2
+6666666666 
+797979797979 
+8080808080 
+130130130130 OR_GRS   gene_list.npy 2
+6666666666 
+797979797979 
+8080808080 

BIN
admin_site/mysite.sqlite


+ 47 - 10
admin_site/order/tasks.py

@@ -137,15 +137,37 @@ def get_AUC(order_id):
         # 保存图形为 PNG 文件
         plt.savefig(base_path + name + '.png')
 
-    time.sleep(1)
-    save_Variant_Type()
-    time.sleep(1)
-    save_Variant_Type2('t_ref_count', max_value=1000)
-    time.sleep(1)
-    save_Variant_Type2('t_alt_count', max_value=1000)
-    time.sleep(1)
-    save_Variant_Type2('t_depth', max_value=1000)
-    time.sleep(1)
+    def save_end_data(self_prob_pre, name, pro_name): # 输出大于0.5的数据
+        second_column = self_prob_pre[:, 1]
+        # 找到大于0.5的数据的下标
+        indices = np.where(second_column >= 0.5)[0]
+        # print(144, pro_name, indices)
+
+        with open(f'{base_path}{name}.txt', 'w') as f:
+            for item in indices:
+                f.write("%s\n" % item)
+        #
+        # # 绘制折线图
+        # # plt.plot(second_column)
+        # plt.plot(indices, second_column[indices], 'ro')
+        # # 设置 x 轴和 y 轴标签
+        # plt.title(f"{pro_name} Probability prediction greater than 0.5")
+        # plt.xlabel("Index")
+        # plt.ylabel("Value")
+        # # 保存图像
+        # plt.savefig(f"{base_path}{name}概率预测.png", format="png")
+        # # 清除图像
+        # plt.clf()
+
+    # time.sleep(1)
+    # save_Variant_Type()
+    # time.sleep(1)
+    # save_Variant_Type2('t_ref_count', max_value=1000)
+    # time.sleep(1)
+    # save_Variant_Type2('t_alt_count', max_value=1000)
+    # time.sleep(1)
+    # save_Variant_Type2('t_depth', max_value=1000)
+    # time.sleep(1)
     # 绘制图像
     # plt.imshow(data['t_depth'])
     # 保存为图片文件
@@ -204,6 +226,19 @@ def get_AUC(order_id):
     plt.imshow(prob_pre)
     # 保存为图片文件
     plt.savefig(base_path + "SC_GRS_prob_pre.png", format='png')
+    # second_column = prob_pre[1, :]
+    # # 找到大于0.5的数据的下标
+    # indices = np.where(second_column > 0.5)
+    # # 绘制折线图
+    # plt.plot(second_column)
+    # plt.plot(indices, second_column[indices], 'ro')
+    # # 设置 x 轴和 y 轴标签
+    # plt.title('SC GRS Probability prediction greater than 0.5')
+    # plt.xlabel('Index')
+    # plt.ylabel('Value')
+    # # 显示图形
+    # plt.savefig(base_path + "GRS概率预测.png", format='png')
+    save_end_data(prob_pre, 'SC_GRS', 'SC GRS')
 
     # -------------------------------------DL_GRS方法-----------------------------------------
     # 模型训练
@@ -231,7 +266,7 @@ def get_AUC(order_id):
     plt.imshow(prob_pre)
     # 保存为图片文件
     plt.savefig(base_path + "DL_GRS_prob_pre.png", format='png')
-
+    save_end_data(prob_pre, 'DL_GRS', 'DL GRS')
     # -------------------------------------OR_GRS方法-----------------------------------------
     # or值计算
     tempdata = data_final[data_final['D'] == 0]
@@ -265,10 +300,12 @@ def get_AUC(order_id):
     X_test = (data_final[gene_list] * omega_or).sum(axis=1).values.reshape(-1, 1)
     y_pre = clf.predict(X_test)  # 分类结果预测
     prob_pre = clf.predict_proba(X_test)  # 结果概率预测
+
     # 绘制图像
     plt.imshow(prob_pre)
     # 保存为图片文件
     plt.savefig(base_path + "OR_GRS_prob_pre.png", format='png')
+    save_end_data(prob_pre, 'OR_GRS', 'OR GRS')
     # logger.info(154, prob_pre)
     # 更新order状态
     try:

+ 11 - 0
admin_site/order/views.py

@@ -31,6 +31,14 @@ def info(request):
         order = Order_models.objects.get(id=body['id'])
     except Order_models.DoesNotExist:
         return JsonResponse(setError("Order not found"))
+    def get_txt_data(name):
+        base_path = 'Rdata/' + str(order.id) + '/'
+        txt_data = []
+        # 从文本文件中读取列表
+        with open(f'{base_path}{name}.txt', 'r') as f:
+            txt_data = [int(line.strip()) for line in f]
+            # print(txt_data)  # 输出 [1, 2, 3, 4]
+        return txt_data
 
         # 将订单信息转换为字典形式
     order_dict = {
@@ -46,10 +54,13 @@ def info(request):
         "create_time": order.create_time,
         "update_time": order.update_time,
         "DL_GRS": "http://localhost:8000/order/img/"+ str(order.id) +"/DL_GRS.png",
+        "DL_GRS_list": get_txt_data('DL_GRS'),
         "DL_GRS_prob_pre": "http://localhost:8000/order/img/"+ str(order.id) +"/DL_GRS_prob_pre.png",
         "OR_GRS": "http://localhost:8000/order/img/"+ str(order.id) +"/OR_GRS.png",
+        "OR_GRS_list": get_txt_data('OR_GRS'),
         "OR_GRS_prob_pre": "http://localhost:8000/order/img/"+ str(order.id) +"/OR_GRS_prob_pre.png",
         "SC_GRS": "http://localhost:8000/order/img/"+ str(order.id) +"/SC_GRS.png",
+        "SC_GRS_list": get_txt_data('SC_GRS'),
         "SC_GRS_prob_pre": "http://localhost:8000/order/img/"+ str(order.id) +"/SC_GRS_prob_pre.png",
         "t_alt_count": "http://localhost:8000/order/img/"+ str(order.id) +"/t_alt_count.png",
         "t_depth": "http://localhost:8000/order/img/"+ str(order.id) +"/t_depth.png",