2026/1/12 19:12:25
网站建设
项目流程
自己做的音乐网站侵权问题,成都企业网站建设及公司ppt,广西梧州发现1例阳性人员,滨城网站开发✅ 博主简介#xff1a;擅长数据搜集与处理、建模仿真、程序设计、仿真代码、论文写作与指导#xff0c;毕业论文、期刊论文经验交流。✅成品或者定制#xff0c;扫描文章底部微信二维码。(1) 以群体协同算法为核心的中药复方靶点网络模块划分方法中药复方是中医药治疗疾病的…✅博主简介擅长数据搜集与处理、建模仿真、程序设计、仿真代码、论文写作与指导毕业论文、期刊论文经验交流。✅成品或者定制扫描文章底部微信二维码。(1) 以群体协同算法为核心的中药复方靶点网络模块划分方法中药复方是中医药治疗疾病的主要形式其多成分、多靶点、多通路的作用特点决定了复方的整体效应难以用简单的线性叠加来解释。传统的中药复方研究多依赖于临床经验和动物实验缺乏系统的理论指导和定量分析工具。随着网络药理学的兴起将中药复方的成分、靶点和疾病之间的关系构建为复杂网络通过网络分析方法挖掘复方的作用机制成为研究热点。然而现有的网络分析方法多关注单个节点或节点对之间的关系忽视了中药复方作用的群体效应特征即多个成分协同作用于多个靶点群从而发挥整体疗效的特点。群体协同算法的提出正是为了解决这一问题。与传统的社区发现算法不同群体协同算法以最大化群体间的协同作用为目标寻找网络中具有紧密功能关联的节点群组。在中药复方靶点网络中这些群组代表了共同参与某一生物功能或通路的成分靶点集合。群体协同模块度是衡量模块划分质量的核心指标它不仅考虑模块内部的连接紧密程度还考虑模块与疾病靶点群之间的关联强度。高群体协同模块度意味着识别出的成分群与疾病靶点群之间存在密切的调控关系这些成分群可能是复方发挥疗效的核心功能单元。算法的具体实现采用了类似Louvain优化的两阶段迭代策略。第一阶段是局部优化阶段遍历网络中的每个节点尝试将其移动到相邻模块中计算移动前后群体协同模块度的变化如果模块度增加则执行移动操作。这一过程反复进行直到没有节点移动能够增加模块度为止。第二阶段是网络聚合阶段将第一阶段识别出的各个模块压缩为超节点构建新的简化网络然后在简化网络上重复第一阶段的操作。两个阶段交替进行直到模块结构稳定。这种层次化的优化策略既保证了算法的计算效率又能够发现不同尺度上的模块结构。为了验证群体协同算法的性能优势在多个不同类型的网络上进行了对比实验。首先选取两个公开的高质量蛋白质相互作用网络作为测试基准这些网络已有经过生物学验证的功能模块注释可以作为评价模块划分准确性的金标准。其次在中药复方左金片的成分靶点网络上进行测试该复方组成简单、作用机制研究较为清楚便于验证算法结果的生物学合理性。最后在痰瘀同治方抗心肌缺血再灌注损伤的靶点网络上进行应用研究。与经典的GN算法、基于贪婪策略的CNM算法、基于标签传播的LPA算法以及基于局部扩展的LFM算法进行比较群体协同算法在所有测试网络上均获得了最高的模块度值表明该算法能够识别出结构更加紧密的功能模块为后续的复方优化奠定了坚实基础。(2) 基于君臣佐使配伍理论的网络加权方法与核心节点筛选策略君臣佐使是中医方剂学的核心配伍理论描述了复方中各味药物的主次地位和功能分工。君药针对主病或主证发挥主要治疗作用是复方的核心药物臣药辅助君药加强治疗作用或针对兼证发挥作用佐药协助君臣药治疗兼证、制约君臣药的毒性或烈性、或作为反佐以防止药物拒药使药引导诸药直达病所或调和诸药。这一理论蕴含了复方中药物重要性差异的思想将其引入网络分析可以更好地反映复方的组织结构特征。基于君臣佐使理论的网络加权方法为复方靶点网络中的边赋予不同的权重值权重大小反映该连接的重要程度。具体而言根据复方中各药物的君臣佐使属性为其对应的成分节点和靶点节点之间的连接边赋予相应权重。君药来源的成分与靶点之间的连接权重最高臣药次之佐药再次使药最低。权重值的具体数值需要综合考虑临床经验和网络分析结果。研究中设计了多种权重分配方案进行对比测试最终确定君臣佐使的权重比为20:10:6:4时网络模块划分的质量最优该方案既体现了君药的核心地位又保持了各层级药物之间的合理差距。加权网络与非加权网络的模块划分结果存在显著差异验证了君臣佐使思想对复方结构的实质影响。在非加权网络中所有连接边被同等对待模块划分主要依据拓扑结构特征可能无法准确反映药物的功能主次关系。引入君臣佐使权重后君药来源的成分与靶点形成的连接在模块划分中占据更重要的地位更容易被归入同一核心模块而使药来源的成分则可能被分配到边缘模块或作为模块间的桥接节点。这种划分结果更符合中医药理论对复方组织结构的认识表明加权方法能够有效整合传统医学知识和现代网络分析技术。核心节点的筛选是从模块划分结果中提取优化方的关键步骤。传统的节点重要性评价指标如度中心性和接近中心性主要基于网络拓扑结构未考虑边的权重信息。为此提出了加权接近中心性指标该指标在计算节点到其他节点的路径长度时将边的权重纳入考量权重大的边对应较短的路径长度。这样处理使得与君药成分连接紧密的靶点获得较高的中心性评分更可能被选为核心节点。综合加权接近中心性、度中心性和传统接近中心性三个指标采用排名聚合方法筛选出综合评分最高的核心节点集合。根据核心节点回溯其对应的药物成分进而确定核心药物组合形成优化方案。(3) 痰瘀同治方优化及基因富集与动物实验验证痰瘀同治方是治疗心肌缺血再灌注损伤的有效复方由十三味中药组成临床疗效确切但组方较为复杂。应用群体协同算法对该方进行优化目标是在保持疗效的前提下精简组方提高临床应用的便利性。首先构建痰瘀同治方抗心肌缺血再灌注损伤的成分靶点疾病三层网络成分层包含复方中各药物的化学成分靶点层包含这些成分的作用靶点蛋白疾病层包含心肌缺血再灌注损伤的相关基因。根据中医专家意见确定各药物的君臣佐使属性按照确定的权重比例对网络进行加权处理。在加权网络上运行群体协同算法进行模块划分最终识别出十三个群体协同模块总模块度达到零点五五三七表明模块划分质量较高。对各模块的成分构成和靶点分布进行分析识别出与疾病靶点群关联最紧密的核心模块。基于加权接近中心性指标结合度中心性和接近中心性从核心模块中筛选关键节点回溯确定核心药物组合。根据筛选结果拟定两个优化方案优化方一包含六味药物优化方二包含七味药物均保留了原方中的君药和主要臣药精简了部分佐使药物。基因富集分析从分子机制层面验证优化方案的合理性。将原方、优化方一和优化方二的靶点分别进行基因本体功能富集分析和通路富集分析。基因本体富集结果显示三个方案富集到的生物过程、分子功能和细胞组分高度重叠重叠率均超过百分之九十四排名前三十的富集条目基本一致包括氧化应激响应、炎症反应调节、细胞凋亡调控等与心肌保护密切相关的生物功能。通路富集分析结果同样显示高度一致性三个方案富集到的信号通路重叠率超过百分之九十八主要涉及心肌细胞凋亡通路、炎症信号通路、氧化应激通路等。这些结果表明优化方案与原方在分子作用机制层面具有高度相似性支持优化方案的有效性。import numpy as np import networkx as nx from collections import defaultdict import random class CollaborativeModularityOptimizer: def __init__(self, graph, disease_targets, weightsNone): self.graph graph self.disease_targets set(disease_targets) self.weights weights if weights else {e: 1.0 for e in graph.edges()} self.node_to_community {node: i for i, node in enumerate(graph.nodes())} self.communities {i: {node} for i, node in enumerate(graph.nodes())} def calculate_collaborative_modularity(self): m sum(self.weights.values()) Q 0.0 for comm_id, comm_nodes in self.communities.items(): if len(comm_nodes) 0: continue internal_weight 0.0 disease_connection 0.0 for u in comm_nodes: for v in self.graph.neighbors(u): if v in comm_nodes: internal_weight self.weights.get((u, v), self.weights.get((v, u), 1.0)) if v in self.disease_targets: disease_connection self.weights.get((u, v), self.weights.get((v, u), 1.0)) node_degrees sum(self.graph.degree(n, weightweight) for n in comm_nodes) Q (internal_weight / (2 * m)) - (node_degrees / (2 * m)) ** 2 Q 0.1 * disease_connection / m return Q def move_node(self, node, target_community): source_community self.node_to_community[node] if source_community target_community: return 0.0 old_Q self.calculate_collaborative_modularity() self.communities[source_community].remove(node) self.communities[target_community].add(node) self.node_to_community[node] target_community new_Q self.calculate_collaborative_modularity() delta_Q new_Q - old_Q if delta_Q 0: self.communities[target_community].remove(node) self.communities[source_community].add(node) self.node_to_community[node] source_community return 0.0 return delta_Q def local_optimization(self): improved True while improved: improved False nodes list(self.graph.nodes()) random.shuffle(nodes) for node in nodes: neighbor_communities set() for neighbor in self.graph.neighbors(node): neighbor_communities.add(self.node_to_community[neighbor]) best_delta 0.0 best_community self.node_to_community[node] for comm in neighbor_communities: delta self.move_node(node, comm) if delta best_delta: best_delta delta best_community comm improved True def aggregate_network(self): new_graph nx.Graph() comm_ids [c for c, nodes in self.communities.items() if len(nodes) 0] for comm_id in comm_ids: new_graph.add_node(comm_id) for u, v in self.graph.edges(): comm_u self.node_to_community[u] comm_v self.node_to_community[v] w self.weights.get((u, v), self.weights.get((v, u), 1.0)) if new_graph.has_edge(comm_u, comm_v): new_graph[comm_u][comm_v][weight] w else: new_graph.add_edge(comm_u, comm_v, weightw) return new_graph def run_louvain_style(self, max_iterations100): for iteration in range(max_iterations): old_modularity self.calculate_collaborative_modularity() self.local_optimization() new_modularity self.calculate_collaborative_modularity() if abs(new_modularity - old_modularity) 1e-6: break return self.get_partition() def get_partition(self): partition {} for node, comm_id in self.node_to_community.items(): if comm_id not in partition: partition[comm_id] [] partition[comm_id].append(node) return {k: v for k, v in partition.items() if len(v) 0} def assign_junchen_weights(drug_roles, compound_target_edges): role_weights {jun: 20, chen: 10, zuo: 6, shi: 4} edge_weights {} for compound, target in compound_target_edges: drug compound.split(_)[0] role drug_roles.get(drug, shi) edge_weights[(compound, target)] role_weights[role] return edge_weights def calculate_weighted_closeness_centrality(graph, weights): centrality {} nodes list(graph.nodes()) for node in nodes: total_distance 0.0 reachable 0 for other in nodes: if node ! other: try: path nx.shortest_path(graph, node, other) path_weight sum(1.0 / weights.get((path[i], path[i1]), weights.get((path[i1], path[i]), 1.0)) for i in range(len(path)-1)) total_distance path_weight reachable 1 except nx.NetworkXNoPath: continue if reachable 0 and total_distance 0: centrality[node] reachable / total_distance else: centrality[node] 0.0 return centrality def identify_core_nodes(graph, weights, partition, top_k20): wcc calculate_weighted_closeness_centrality(graph, weights) dc dict(graph.degree()) cc nx.closeness_centrality(graph) scores {} for node in graph.nodes(): scores[node] (wcc.get(node, 0) dc.get(node, 0) / max(dc.values()) cc.get(node, 0)) / 3 sorted_nodes sorted(scores.items(), keylambda x: x[1], reverseTrue) return [node for node, score in sorted_nodes[:top_k]] def optimize_formula(compounds, targets, disease_targets, drug_roles, compound_drug_map): G nx.Graph() G.add_nodes_from(compounds) G.add_nodes_from(targets) edges [(c, t) for c in compounds for t in targets if random.random() 0.7] G.add_edges_from(edges) weights assign_junchen_weights(drug_roles, edges) optimizer CollaborativeModularityOptimizer(G, disease_targets, weights) partition optimizer.run_louvain_style() modularity optimizer.calculate_collaborative_modularity() core_nodes identify_core_nodes(G, weights, partition) core_drugs set() for node in core_nodes: if node in compound_drug_map: core_drugs.add(compound_drug_map[node]) return list(core_drugs), partition, modularity if __name__ __main__: drugs [HuangQi, DanShen, ChuanXiong, GanCao, DangGui, TaoRen] drug_roles {HuangQi: jun, DanShen: chen, ChuanXiong: chen, GanCao: shi, DangGui: zuo, TaoRen: zuo} compounds [f{drug}_comp{i} for drug in drugs for i in range(5)] targets [fTarget_{i} for i in range(50)] disease_targets targets[:20] compound_drug_map {c: c.split(_)[0] for c in compounds} optimized_drugs, partition, Q optimize_formula( compounds, targets, disease_targets, drug_roles, compound_drug_map) print(fModularity: {Q:.4f}) print(fNumber of modules: {len(partition)}) print(fOptimized formula drugs: {optimized_drugs})成品代码50-200定制300起可以直接沟通