当前位置: 首页 > article >正文

GPU加速生信分析-宏基因组MAG去污染

Deepurify利用多模态深度语言模型来过滤污染的基因组,从而提高了宏基因组组装基因组(MAGs)的质量,并且可以利用GPU加速。

宏基因组组装的基因组 (MAG) 为使用宏基因组测序数据探索微生物暗物质提供了有价值的见解。然而,人们越来越担心 MAG 中的污染可能会严重影响下游分析的结果。目前的 MAG 纯化工具主要依赖于标记基因,并没有充分利用基因组序列的上下文信息。为了克服这一限制,作者引入了用于 MAG 净化的 Deepurify。Deepurify 使用多模态深度语言模型和对比学习来匹配微生物基因组序列与其分类谱系。它将 MAG 中的重叠群分配给 MAG 分隔的树,并应用树遍历算法将 MAG 划分为子 MAG,目的是最大限度地提高高质量和中等质量子 MAG 的数量。在这里,我们表明 Deepurify 在模拟数据、CAMI 数据集和具有不同复杂性的真实数据集上优于 MDMclearer 和 MAGpurify。Deepurify 在土壤中增加了 20.0%的高质量 MAG,在海洋中增加了 45.1%,在植物中增加了 45.5%,在淡水中增加了 33.8%,在人类粪便宏基因组测序数据集中增加了 28.5%。

安装:

1. 第一步(为 Deepurify 创建 Conda 环境)

使用以下命令创建 deepurify 的 conda 环境:

conda env create -n deepurify -f deepurify-conda-env.yml

所有的依赖都可以通过conda使用安装部分中的命令安装

如果您想使用 GPU,请从 http://pytorch.org/ 下载 PyTorch v2.1.0 -cu121(或更高版本)(强烈建议使用 GPU)。

conda activate deepurify
conda install pytorch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 pytorch-cuda=12.1 -c pytorch -c nvidia
2. 第二步(安装 Deepurify 代码)

准备好环境后,Deepurify 的代码就可以简单地通过 pip 安装了。

conda activate deepurify
pip install Deepurify==2.3.10

此安装将运行大约 10 分钟。

下载模型权重等文件进行运行

从此**链接下载用于运行 Deepurify 的模型权重和其他文件 (Deepurify-DB.zip**)。

1. 设置环境变量
  • 解压缩下载的文件 (Deepurify-DB.zip) 并设置一个名为 “DeepurifyInfoFiles” 的环境变量,方法是将以下行添加到 .bashrc 文件的最后一行(文件路径:~/.bashrc):

export DeepurifyInfoFiles=/path/of/this/Deepurify-DB/

例如:'export DeepurifyInfoFiles=/home/csbhzou/software/Deepurify-DB/'。

  • 保存 .bashrc 文件,然后执行:

source .bashrc
2. 在 CLI 中使用 '--db_folder_path' 标志
  • 如果您不想设置环境变量,您可以在 CLI 中将 '--db_folder_path' 标志设置为'Deepurify-DB' 文件夹的路径。

使用“清理”模式运行 Deepurify

1. 您可以通过以下命令以 'clean' 模式运行 Deepurify:

清洁模式

清洁模式

deepurify clean  -i ./input_folder/ -o ./output_folder/ --bin_suffix fasta --gpu_num 1 --each_gpu_threads 1 --db_folder_path /path/of/this/Deepurify-DB/

usage: deepurify clean [-h] -i INPUT_PATH -o OUTPUT_PATH --bin_suffix BIN_SUFFIX [--gpu_num GPU_NUM] [--batch_size_per_gpu BATCH_SIZE_PER_GPU] [--each_gpu_threads EACH_GPU_THREADS][--overlapping_ratio OVERLAPPING_RATIO] [--cut_seq_length CUT_SEQ_LENGTH] [--mag_length_threshold MAG_LENGTH_THRESHOLD] [--num_process NUM_PROCESS][--topk_or_greedy_search {topk,greedy}] [--topK_num TOPK_NUM] [--temp_output_folder TEMP_OUTPUT_FOLDER] [--db_folder_path DB_FOLDER_PATH][--model_weight_path MODEL_WEIGHT_PATH] [--taxo_vocab_path TAXO_VOCAB_PATH] [--taxo_tree_path TAXO_TREE_PATH]optional arguments:-h, --help            show this help message and exit-i INPUT_PATH, --input_path INPUT_PATHThe folder of input MAGs.-o OUTPUT_PATH, --output_path OUTPUT_PATHThe folder used to output cleaned MAGs.--bin_suffix BIN_SUFFIXThe bin suffix of MAG files.--gpu_num GPU_NUM     The number of GPUs to be used can be specified. Defaults to 1. If you set it to 0, the code will utilize the CPU. However, please note that using the CPU canresult in significantly slower processing speed. It is recommended to provide at least one GPU (>= GTX-1060-6GB) for accelerating the speed.--batch_size_per_gpu BATCH_SIZE_PER_GPUThe batch size per GPU determines the number of sequences that will be loaded onto each GPU. This parameter is only applicable if the --gpu_num option is set to avalue greater than 0. The default value is 4, meaning that one sequence will be loaded per GPU batch. The batch size for the CPU is 4.--each_gpu_threads EACH_GPU_THREADSThe number of threads per GPU (or CPU) determines the parallelism level during the contigs' inference stage. If the value of --gpu_num is greater than 0, each GPU willhave a set number of threads to do inference. Similarly, if --gpu_num is set to 0 and the code will run on the CPU, the specified number of threads will be used. Bydefault, the number of threads per GPU or CPU is set to 1. The --batch_size_per_gpu value will be divided by the number of threads to determine the batch size perthread.--overlapping_ratio OVERLAPPING_RATIOThe --overlapping_ratio is a parameter used when the length of a contig exceeds the specified --cut_seq_length. By default, the overlapping ratio is set to 0.5.This means that when a contig is longer than the --cut_seq_length, it will be split into overlapping subsequences with 0.5 overlaps between consecutivesubsequences.--cut_seq_length CUT_SEQ_LENGTHThe --cut_seq_length parameter determines the length at which a contig will be cut if its length exceeds this value. The default setting is 8192, which is also themaximum length allowed during training. If a contig's length surpasses this threshold, it will be divided into smaller subsequences with lengths equal to or lessthan the cut_seq_length.--mag_length_threshold MAG_LENGTH_THRESHOLDThe threshold for the total length of a MAG's contigs is used to filter generated MAGs after applying single-copy genes (SCGs). The default threshold is set to200,000, which represents the total length of the contigs in base pairs (bp). MAGs with a total contig length equal to or greater than this threshold will beconsidered for further analysis or inclusion, while MAGs with a total contig length below the threshold may be filtered out.--num_process NUM_PROCESSThe maximum number of threads will be used. All CPUs will be used if it is None. Defaults to None--topk_or_greedy_search {topk,greedy}Topk searching or greedy searching to label a contig. Defaults to "topk".--topK_num TOPK_NUM   During the top-k searching approach, the default behavior is to search for the top-k nodes that exhibit the highest cosine similarity with the contig's encodedvector. By default, the value of k is set to 3, meaning that the three most similar nodes in terms of cosine similarity will be considered for labeling the contig.Please note that this parameter does not have any effect when using the greedy search approach (topK_num=1). Defaults to 3.--temp_output_folder TEMP_OUTPUT_FOLDERThe temporary files generated during the process can be stored in a specified folder path. By default, if no path is provided (i.e., set to None), the temporaryfiles will be stored in the parent folder of the '--input_path' location. However, you have the option to specify a different folder path to store these temporaryfiles if needed.--db_folder_path DB_FOLDER_PATHThe path of the database folder. Defaults to None. It is expected that the environmental variable 'DeepurifyInfoFiles' has been setto point to the appropriate folder if no path is provided (i.e., set to None). Please ensure the 'DeepurifyInfoFiles' environmental variable is correctly configured if the path is not explicitlyprovided.--model_weight_path MODEL_WEIGHT_PATHThe path of model weight. (In database folder) Defaults to None.--taxo_vocab_path TAXO_VOCAB_PATHThe path of taxon vocabulary. (In database folder) Defaults to None.--taxo_tree_path TAXO_TREE_PATHThe path of taxonomic tree. (In database folder) Defaults to None.

2. You can run Deepurify with 'clean' mode through the cleanMAGs function in Python.

from Deepurify.clean_func import cleanMAGsif __name__ == "__main__":input_folder = "./input_folder/"bin_suffix = "fasta"output_folder = "./output_folder/"cleanMAGs(output_bin_folder_path=output_folder,batch_size_per_gpu=4,each_gpu_threads=1,input_bins_folder=input_folder,bin_suffix=bin_suffix,gpu_work_ratio=[0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125], # enable 8 GPUs with equal work ratios.db_files_path="./Deepurify-DB/")

用 'iter-clean' 模式运行 Deepurify

1. 可以通过以下命令以 'iter-clean' 模式运行 Deepurify:

re-bin mode

re-bin mode

deepurify iter-clean  -c ./contigs.fasta -o ./output_folder/ -s ./sorted.bam --gpu_num 1 --each_gpu_threads 1 --db_folder_path /path/of/this/Deepurify-DB/

usage: deepurify iter-clean [-h] -c CONTIGS PATH -s SORTED_BAM_PATH -o OUTPUT_PATH [--binning_mode BINNING_MODE] [--gpu_num GPU_NUM] [--batch_size_per_gpu BATCH_SIZE_PER_GPU][--each_gpu_threads EACH_GPU_THREADS] [--overlapping_ratio OVERLAPPING_RATIO] [--cut_seq_length CUT_SEQ_LENGTH] [--mag_length_threshold MAG_LENGTH_THRESHOLD][--num_process NUM_PROCESS] [--topk_or_greedy_search {topk,greedy}] [--topK_num TOPK_NUM] [--temp_output_folder TEMP_OUTPUT_FOLDER][--db_folder_path DB_FOLDER_PATH] [--model_weight_path MODEL_WEIGHT_PATH] [--taxo_vocab_path TAXO_VOCAB_PATH] [--taxo_tree_path TAXO_TREE_PATH]optional arguments:-h, --help            show this help message and exit-c CONTIGS PATH, --contigs_path CONTIGS PATHThe contigs fasta path.-s SORTED_BAM_PATH, --sorted_bam_path SORTED_BAM_PATHThe sorted bam path.-o OUTPUT_PATH, --output_path OUTPUT_PATHThe folder used to output cleaned MAGs.--binning_mode BINNING_MODEIf this parameter is None, then the semibin2, concoct, and metabat2 will all run. Defaults to None. The other modes are: 'semibin2', 'concoct', and 'metabat2'.--gpu_num GPU_NUM     The number of GPUs to be used can be specified. Defaults to 1. If you set it to 0, the code will utilize the CPU. However, please note that using the CPU canresult in significantly slower processing speed. It is recommended to provide at least one GPU (>= GTX-1060-6GB) for accelerating the speed.--batch_size_per_gpu BATCH_SIZE_PER_GPUThe batch size per GPU determines the number of sequences that will be loaded onto each GPU. This parameter is only applicable if the --gpu_num option is set to avalue greater than 0. The default value is 4, meaning that one sequence will be loaded per GPU batch. The batch size for the CPU is 4.--each_gpu_threads EACH_GPU_THREADSThe number of threads per GPU (or CPU) determines the parallelism level during the contigs' inference stage. If the value of --gpu_num is greater than 0, each GPU willhave a set number of threads to do inference. Similarly, if --gpu_num is set to 0 and the code will run on the CPU, the specified number of threads will be used. Bydefault, the number of threads per GPU or CPU is set to 1. The --batch_size_per_gpu value will be divided by the number of threads to determine the batch size perthread.--overlapping_ratio OVERLAPPING_RATIOThe --overlapping_ratio is a parameter used when the length of a contig exceeds the specified --cut_seq_length. By default, the overlapping ratio is set to 0.5.This means that when a contig is longer than the --cut_seq_length, it will be split into overlapping subsequences with 0.5 overlaps between consecutivesubsequences.--cut_seq_length CUT_SEQ_LENGTHThe --cut_seq_length parameter determines the length at which a contig will be cut if its length exceeds this value. The default setting is 8192, which is also themaximum length allowed during training. If a contig's length surpasses this threshold, it will be divided into smaller subsequences with lengths equal to or lessthan the cut_seq_length.--mag_length_threshold MAG_LENGTH_THRESHOLDThe threshold for the total length of a MAG's contigs is used to filter generated MAGs after applying single-copy genes (SCGs). The default threshold is set to200,000, which represents the total length of the contigs in base pairs (bp). MAGs with a total contig length equal to or greater than this threshold will beconsidered for further analysis or inclusion, while MAGs with a total contig length below the threshold may be filtered out.--num_process NUM_PROCESSThe maximum number of threads will be used. All CPUs will be used if it is None. Defaults to None--topk_or_greedy_search {topk,greedy}Topk searching or greedy searching to label a contig. Defaults to "topk".--topK_num TOPK_NUM   During the top-k searching approach, the default behavior is to search for the top-k nodes that exhibit the highest cosine similarity with the contig's encodedvector. By default, the value of k is set to 3, meaning that the three most similar nodes in terms of cosine similarity will be considered for labeling the contig.Please note that this parameter does not have any effect when using the greedy search approach (topK_num=1). Defaults to 3.--temp_output_folder TEMP_OUTPUT_FOLDERThe temporary files generated during the process can be stored in a specified folder path. By default, if no path is provided (i.e., set to None), the temporaryfiles will be stored in the parent folder of the '--input_path' location. However, you have the option to specify a different folder path to store these temporaryfiles if needed.--db_folder_path DB_FOLDER_PATHThe path of the database folder. Defaults to None. It is expected that the environmental variable 'DeepurifyInfoFiles' has been setto point to the appropriate folder if no path is provided (i.e., set to None). Please ensure the 'DeepurifyInfoFiles' environmental variable is correctly configured if the path is not explicitlyprovided.--model_weight_path MODEL_WEIGHT_PATHThe path of model weight. (In database folder) Defaults to None.--taxo_vocab_path TAXO_VOCAB_PATHThe path of taxon vocabulary. (In database folder) Defaults to None.--taxo_tree_path TAXO_TREE_PATHThe path of taxonomic tree. (In database folder) Defaults to None.

2. 可以通过 Python 中的 cleanMAGs 函数以 'iter-clean' 模式运行 Deepurify

from Deepurify.clean_func import cleanMAGsif __name__ == "__main__":contig_fasta_path = "./contigs.fasta"bam_file_path = "./sorted.bam"output_folder = "./output_folder/"cleanMAGs(output_bin_folder_path=output_folder,batch_size_per_gpu=4,each_gpu_threads=1,contig_fasta_path=contig_fasta_path,sorted_bam_file=bam_file_path,gpu_work_ratio=[0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.25], # enable 7 GPUs with different work ratios.db_files_path="./Deepurify-DB/")

有关更多详细信息,请参阅此函数的文档。

输出目录中的文件

  • 纯化的 MAG。
  • MetaInfo.tsv 文件包含以下列:
  1. MAG 名称(第一列)

  2. MAG 的完整性(第二列)

  3. MAG 污染(第三柱)

  4. MAG 质量(第四列)

运行 Deepurify 的最低系统要求

  • 系统: Linux

  • CPU:无限制。

  • 内存:>= 32 GB

  • GPU:GPU 内存必须等于或大于 6GB。(5273MB)

该系统可以运行 “Running Deepurify” 部分中的 deepurify 命令。

参考文献

  1. DOI:10.1038/s42256-024-00908-5

  2. https://github.com/ericcombiolab/Deepurify

  3. https://www.comp.hkbu.edu.hk/~ericluzhang/recipes/southern-cornbread/

相关文章:

GPU加速生信分析-宏基因组MAG去污染

Deepurify利用多模态深度语言模型来过滤污染的基因组,从而提高了宏基因组组装基因组(MAGs)的质量,并且可以利用GPU加速。 宏基因组组装的基因组 (MAG) 为使用宏基因组测序数据探索微生物暗物质提供了有价值…...

数据结构(蓝桥杯常考点)

数据结构 前言:这个是针对于蓝桥杯竞赛常考的数据结构内容,基础算法比如高精度这些会在下期给大家总结 数据结构 竞赛中,时间复杂度不能超过10的7次方(1秒)到10的8次方(2秒) 空间限制&#x…...

从0到1入门Linux

一、常用命令 ls 列出目录内容 cd切换目录mkdir创建新目录rm删除文件或目录cp复制文件或目录mv移动或重命名文件和目录cat查看文件内容grep在文件中查找指定字符串ps查看当前进程状态top查看内存kill终止进程df -h查看磁盘空间存储情况iotop -o直接查看比较高的磁盘读写程序up…...

灰色地带规避:知识产权校验API的商标库模糊匹配算法

在反向海淘或其他电商业务场景中,为了规避知识产权方面的灰色地带,开发知识产权校验 API 并运用商标库模糊匹配算法是很有必要的。以下将详细介绍商标库模糊匹配算法的设计与实现: 算法设计思路 商标库模糊匹配算法的核心目标是在给定一个待匹…...

React:类组件(中)

dangerouslySetInnerHTML React写进{}内的东西,不允许被当作代码块解析,是为了防止xss攻击和代码注入 XSS(跨站脚本攻击,Cross-Site Scripting) 是一种常见的安全漏洞,攻击者通过注入恶意脚本到网页中&…...

第六次CCF-CSP认证(含C++源码)

第六次CCF-CSP认证 数位之和(easy)思路及AC代码遇到的问题 开心消消乐(easy)思路及AC代码 画图(mid)思路及AC代码 数位之和(easy) 题目链接 思路及AC代码 既然题目要求我们输出各位…...

SpringBoot 如何调用 WebService 接口

前言 调用WebService接口的方式有很多&#xff0c;今天记录一下&#xff0c;使用 Spring Web Services 调用 SOAP WebService接口 一.导入依赖 <!-- Spring Boot Web依赖 --><dependency><groupId>org.springframework.boot</groupId><artifactId…...

算法 之 树形dp 树的中心、重心

文章目录 重心实践题目小红的陡峭值 在树的算法中&#xff0c;求解树的中心和重心是一类十分重要的算法 求解树的重心 树的重心的定义&#xff1a;重心是树中的一个节点&#xff0c;如果将这个点删除后&#xff0c;剩余各个连通块中点数的最大值最小&#xff0c;那么这个节点…...

Docker 配置镜像源

》》Daemon {"registry-mirrors": ["https://docker.1ms.run","https://docker.xuanyuan.me"] }》》》然后在重新 docker systemctl restart docker...

Linux 离线部署Ollama和DeepSeek-r1模型

都在复制粘贴联网状态下linux部署deepseek&#xff0c;离线状态下需要下载Ollama和DeepSeek模型&#xff0c;然后将下载包上传到linux中。 1、下载Ollama https://github.com/ollama/ollama/releases 注意&#xff1a;如果CentOS7建议安装V0.5.11版本&#xff0c;V0.5.13需要…...

SQLAlchemy系列教程:如何执行原生SQL

Python中的数据库交互提供了高级API。但是&#xff0c;有时您可能需要执行原始SQL以提高效率或利用数据库特定的特性。本指南介绍在SQLAlchemy框架内执行原始SQL。 在SQLAlchemy中执行原生SQL SQLAlchemy虽然以其对象-关系映射&#xff08;ORM&#xff09;功能而闻名&#xff…...

RuleOS:区块链开发的“新引擎”,点燃Web3创新之火

RuleOS&#xff1a;区块链开发的“新引擎”&#xff0c;点燃Web3创新之火 在区块链技术的浪潮中&#xff0c;RuleOS宛如一台强劲的“新引擎”&#xff0c;为个人和企业开发去中心化应用&#xff08;DApp&#xff09;注入了前所未有的动力。它以独特的设计理念和强大的功能特性&…...

【编译器】VSCODE烧录ESP32-C3——xiaozhi智能聊天机器人固件

【编译器】VSCODE烧录ESP32-C3——xiaozhi智能聊天机器人固件 文章目录 [TOC](文章目录) 前言一、方法一&#xff1a;使用固件烧录工具1. 安装CH340驱动2. 打开FLASH_DOWNLOAD文件3. 选择芯片类型和烧录方式4. 选择烧录文件5. 参数配置 二、方法二&#xff1a;VSCODE导入工程1.…...

设计模式文章汇总-Golang语言实现

Golang学习笔记_27——单例模式 Golang学习笔记_28——工厂方法模式 Golang学习笔记_29——抽象工厂模式 Golang学习笔记_30——建造者模式 Golang学习笔记_31——原型模式 Golang学习笔记_32——适配器模式 Golang学习笔记_33——桥接模式 Golang学习笔记_34——组合模式 Gola…...

显式 GC 的使用:留与去,如何选择?

目录 一、什么是显式 GC&#xff1f; &#xff08;一&#xff09; 垃圾回收的基本原理 &#xff08;二&#xff09;显式 GC 方法和行为 1. System.gc() 方法 2. 显式 GC 的行为 &#xff08;三&#xff09;显式 GC 的使用场景与风险 1. JVM 如何处理显式 GC 2. 显式 GC…...

SpringMVC概述以及入门案例

目录 SpringMVC概述 为什么需要Spring MVC&#xff1f; SpringMVC入门 工作流程分析 SpringMVC概述 SpringMVC技术与Servlet技术功能等同&#xff0c;均属于Web层开发技术。SpringMVC是一种基于java实现MVC模型的轻量级Web框架。 为什么需要Spring MVC&#xff1f; 在传统J…...

5. 前后端实现文件上传与解析

1. 说明 在实际开发中&#xff0c;比较常见的一个功能是需要在前端页面中选择系统中的某个文件上传到服务器中进行解析&#xff0c;解析后的文件内容可以用来在服务器中当作参数&#xff0c;或者传递给其它组件使用&#xff0c;或者需要存储到数据库中。所以本文就提供一种方式…...

⭐LeetCode周赛 3468. 可行数组的数目——暴力与数学⭐

⭐LeetCode周赛 3468. 可行数组的数目——暴力与数学⭐ 示例 1&#xff1a; 输入&#xff1a;original [1,2,3,4], bounds [[1,2],[2,3],[3,4],[4,5]] 输出&#xff1a;2 解释&#xff1a; 可能的数组为&#xff1a; [1, 2, 3, 4] [2, 3, 4, 5] 示例 2&#xff1a; 输入&…...

javaEE初阶————多线程进阶(2)

今天来继续带大家学习多线程进阶部分啦&#xff0c;今天是最后一期啦&#xff0c;下期带大家做一些多线程的题&#xff0c;我们就可以开始下一个环节啦&#xff1b; 1&#xff0c;JUC&#xff08;java.util.concurrent&#xff09;的常见类 1&#xff09;Callable 接口 我们之…...

Java 虚拟机优化指南:CMS垃圾回收器参数调优与性能监控工具详解

Java 虚拟机优化指南&#xff1a;CMS垃圾回收器参数调优与性能监控工具详解 引言 在高并发、大流量的企业级Java应用中&#xff0c;JVM参数的调优对系统性能至关重要。合理的JVM配置不仅能提高应用响应速度&#xff0c;还能减少垃圾回收造成的停顿时间&#xff0c;提升用户体…...

maven无法解析插件 org.apache.maven.plugins:maven-jar-plugin:3.4.1

解决流程 1.修改maven仓库库地址 2.删除本地的maven仓库 maven插件一直加载有问题: 无法解析插件 org.apache.maven.plugins:maven-jar-plugin:3.4.1 开始以为maven版本有问题&#xff0c;重装了maven&#xff0c;重装了idea工具。结果问题还是没解决。研究之后发现&#xf…...

Android Studio右上角Gradle 的Task展示不全

Android Studio 版本如下&#xff1a;Android Studio lguana|2023.21, 发现Gradle 的Tasks阉割严重&#xff0c;如下图&#xff0c;只显示一个other 解决方法如下&#xff1a;**Setting>Experimental>勾选Configure all gradle tasks during Gradle Sync(this can make…...

UDP协议 TCP协议(格式 超时重传 滑动窗口 拥塞控制...)

UDP协议 格式 UDP协议头部格式由8个字节组成&#xff0c;由4个2字节大小的字段组成。 源端口&#xff08;Source Port&#xff0c;16 位&#xff09;&#xff1a; 发送端的端口号&#xff0c;标识数据从哪个端口发出。如果不需要&#xff0c;则可以填 0。 目标端口&#xff0…...

爱普生温补晶振 TG5032CFN高精度稳定时钟的典范

在科技日新月异的当下&#xff0c;众多领域对时钟信号的稳定性与精准度提出了极为严苛的要求。爱普生温补晶振TG5032CFN是一款高稳定性温度补偿晶体振荡器&#xff08;TCXO&#xff09;。该器件通过内置温度补偿电路&#xff0c;有效抑制环境温度变化对频率稳定性的影响&#x…...

今日头条文章爬虫教程

今日头条文章爬虫教程 随着互联网的发展&#xff0c;新闻资讯类平台如今日头条积累了海量的数据。对于数据分析师、研究人员等群体来说&#xff0c;获取这些数据进行分析和研究具有重要的价值。本文将介绍如何使用Python编写爬虫&#xff0c;爬取今日头条的文章数据。 一、准…...

【网络安全工程】任务11:路由器配置与静态路由配置

目录 一、概念 二、路由器配置 三、配置静态路由CSDN 原创主页&#xff1a;不羁https://blog.csdn.net/2303_76492156?typeblog 一、概念 1、路由器的作用&#xff1a;通过路由表进行数据的转发。 2、交换机的作用&#xff1a;通过学习和识别 MAC 地址&#xff0c;依据 M…...

Compose 实践与探索二 —— 状态订阅与自动更新1

1、自定义 Composable 为什么所有组件都要加 Composable 注解才可以使用&#xff1f; 这是因为 Compose 需要通过 Compose 的编译器插件&#xff08;Compose Compiler Plugin&#xff09;在组件函数中增加一些参数&#xff0c;这些参数在调用时有用。通过编译器增加这些参数&…...

linux下文件读写操作

Linux下&#xff0c;文件I/O是操作系统与文件系统之间进行数据传输的关键部分。文件I/O操作允许程序读取和写入文件&#xff0c;管理文件的打开、关闭、创建和删除等操作。 1. 文件描述符 在Linux中&#xff0c;每个打开的文件都由一个文件描述符来表示。文件描述符是一个非负…...

嵌入式学习第二十四天--网络 服务器

服务器模型 tcp服务器: socket bind listen accept recv/send close 1.支持多客户端访问 //单循环服务器 socket bind listen while(1) { accept while(1) { recv/send } } close 2.支持多客户端同时访问 (并发能力) 并发服务器 socket bind …...

Uniapp组件 Textarea 字数统计和限制

Uniapp Textarea 字数统计和限制 在 Uniapp 中&#xff0c;可以通过监听 textarea 的 input 事件来实现字数统计功能。以下是一个简单的示例&#xff0c;展示如何在 textarea 的右下角显示输入的字符数。 示例代码 首先&#xff0c;在模板中定义一个 textarea 元素&#xff…...