当前位置:首页>python>Python-基于图神经网络的单细胞空间转录组学的应用与创新

Python-基于图神经网络的单细胞空间转录组学的应用与创新

  • 2026-02-09 10:31:32
Python-基于图神经网络的单细胞空间转录组学的应用与创新

Python-基于图神经网络的单细胞空间转录组学的应用与创新

#!/usr/bin/env python3# -*- coding: utf-8 -*-"""单细胞RNA测序完整分析流程 - 科学严谨完整版 v4.1解决所有审稿人质疑点的完整可运行版本作者: itwangyang版本: 4.1 Scientific Complete日期: 2025年2月"""import osimport sysimport jsonimport subprocessimport warningsimport argparsefrom typing import DictListTupleOptionalUnionfrom collections import defaultdict, Counterfrom datetime import datetimeimport numpy as npimport pandas as pdimport scanpy as scimport anndata as adimport requestsimport matplotlibimport matplotlib.pyplot as pltimport seaborn as snsfrom matplotlib import rcParamsimport scipyfrom scipy import statsfrom scipy.sparse import issparsewarnings.filterwarnings("ignore")# ==============================================================================# 全局常量# ==============================================================================VERSION = "4.1 Scientific Complete"MIN_CELLS_FOR_CELLTYPE = 20RANDOM_SEED = 42# 固定随机种子np.random.seed(RANDOM_SEED)# QC阈值(基于文献,但会自适应调整)DEFAULT_QC_THRESHOLDS = {    'min_genes'300,    'min_umis'500,    'max_mt'20.0,    'doublet_rate'0.06}# ==============================================================================# 依赖管理# ==============================================================================class DependencyManager:    """依赖管理器 - 修复sklearn导入问题"""    REQUIRED_PACKAGES = {        'numpy''numpy',        'pandas''pandas'        'scipy''scipy',        'matplotlib''matplotlib',        'seaborn''seaborn',        'scanpy''scanpy',        'anndata''anndata',        'scvi''scvi-tools',        'scrublet''scrublet',        'statsmodels''statsmodels',        'gseapy''gseapy',        'requests''requests',        'openpyxl''openpyxl',        'igraph''igraph',        'leidenalg''leidenalg',        'adjustText''adjustText',        'sklearn''scikit-learn',  # 修复:导入名是sklearn    }    CONDA_ONLY = {'igraph''python-igraph''leidenalg''leidenalg'}    @staticmethod    def check_package(name):        try:            __import__(name)            return True        except ImportError:            return False    @staticmethod    def get_version(name):        try:            mod = __import__(name)            return getattr(mod, '__version__''unknown')        except:            return 'unknown'    @staticmethod    def install_with_pip(name, pip_name=None):        if pip_name is None:            pip_name = name        try:            subprocess.check_call([                sys.executable, '-m''pip''install', pip_name,                '--break-system-packages''--quiet'            ])            return True        except:            try:                subprocess.check_call([                    sys.executable, '-m''pip''install', pip_name, '--quiet'                ])                return True            except:                return False    @classmethod    def ensure_dependencies(cls):        print("\n[依赖检查] 检查必需的Python包...")        missing = []        for import_name, pip_name in cls.REQUIRED_PACKAGES.items():            if not cls.check_package(import_name):                missing.append((import_name, pip_name))        if not missing:            print("✓ 所有依赖已安装")            return True        print(f"\n[依赖安装] 发现 {len(missing)} 个缺失的包")        return len(missing) == 0    @classmethod    def get_environment_info(cls) -> Dict:        """记录环境信息"""        versions = {}        for pkg in ['scanpy''anndata''scvi''numpy''pandas'                   'scipy''matplotlib''sklearn']:            if cls.check_package(pkg):                versions[pkg] = cls.get_version(pkg)        return {            'python_version': sys.version.split()[0],            'packages': versions,            'timestamp': datetime.now().isoformat(),            'random_seed': RANDOM_SEED        }# 初始化if __name__ == "__main__":    DependencyManager.ensure_dependencies()# 导入包try:    import scvi    scvi.settings.seed = RANDOM_SEED    SCVI_AVAILABLE = Trueexcept:    SCVI_AVAILABLE = Falsetry:    import scrublet as scr    SCRUBLET_AVAILABLE = Trueexcept:    SCRUBLET_AVAILABLE = Falsetry:    from adjustText import adjust_text    ADJUSTTEXT_AVAILABLE = Trueexcept:    ADJUSTTEXT_AVAILABLE = Falsetry:    import statsmodels.api as sm    from statsmodels.stats.multitest import multipletests    STATSMODELS_AVAILABLE = Trueexcept:    STATSMODELS_AVAILABLE = Falsetry:    import gseapy as gp    GSEAPY_AVAILABLE = Trueexcept:    GSEAPY_AVAILABLE = Falsetry:    from sklearn.metrics import adjusted_rand_score, silhouette_score, normalized_mutual_info_score    from sklearn.utils import resample    SKLEARN_AVAILABLE = Trueexcept:    SKLEARN_AVAILABLE = False# ==============================================================================# 检查点管理# ==============================================================================class CheckpointManager:    def __init__(self, outdir: str):        self.outdir = outdir        self.checkpoint_file = os.path.join(outdir, ".checkpoint.json")        self.checkpoints = self.load_checkpoints()    def load_checkpoints(self) -> Dict:        if os.path.exists(self.checkpoint_file):            try:                with open(self.checkpoint_file, 'r'as f:                    return json.load(f)            except:                return {}        return {}    def save_checkpoint(self, step: str, data: Dict = None):        self.checkpoints[step] = {            'completed'True,            'timestamp': pd.Timestamp.now().isoformat(),            'data': data or {}        }        os.makedirs(self.outdir, exist_ok=True)        with open(self.checkpoint_file, 'w'as f:            json.dump(self.checkpoints, f, indent=2)        print(f"[✓] Checkpoint: {step}")    def is_completed(self, step: str) -> bool:        return step in self.checkpoints and self.checkpoints[step].get('completed'False)# ==============================================================================# 可视化配置# ==============================================================================def setup_publication_style():    rcParams['font.family'] = 'serif'    rcParams['font.serif'] = ['Times New Roman']    rcParams['font.weight'] = 'bold'    rcParams['axes.labelweight'] = 'bold'    rcParams['axes.titleweight'] = 'bold'    rcParams['font.size'] = 12    rcParams['axes.labelsize'] = 14    rcParams['axes.titlesize'] = 16    rcParams['figure.dpi'] = 300    rcParams['savefig.dpi'] = 300    rcParams['savefig.bbox'] = 'tight'MACARON_COLORS = [    '#FFB6C1''#B4E7CE''#FFE4B5''#E6E6FA''#FFD9B3',    '#C7CEEA''#B5EAD7''#FFDAC1''#C7B8E8''#B3E5FC',    '#FFE5CC''#D5AAFF''#A8E6CF''#FFD3B6''#DCEDC1',]setup_publication_style()# ==============================================================================# 核心分析函数(从v3.0继承并增强)# ==============================================================================def download_cellmarker(output_dir: str = "./") -> str:    url = "http://www.bio-bigdata.center/CellMarker_download_files/file/Cell_marker_Human.xlsx"    output_path = os.path.join(output_dir, "Cell_marker_Human.xlsx")    if os.path.exists(output_path):        return output_path    print(f"[Download] CellMarker...")    response = requests.get(url, timeout=120)    response.raise_for_status()    with open(output_path, 'wb'as f:        f.write(response.content)    return output_pathdef parse_cellmarker_database(cellmarker_path: str, tissue_type: str = None,                              min_markers: int = 2) -> Dict[strList[str]]:    df = pd.read_excel(cellmarker_path)    if tissue_type:        df = df[df['tissue_type'].str.contains(tissue_type, case=False, na=False)]    df = df[df['cancer_type'] == 'Normal']    marker_dict = {}    for _, row in df.iterrows():        cell_name = str(row['cell_name']).strip()        symbol = str(row['Symbol']).strip()        if pd.isna(cell_name) or pd.isna(symbol):            continue        import re        cell_type = re.sub(r'\s+''_', cell_name)        cell_type = re.sub(r'[^\w\-]''', cell_type)        if cell_type in marker_dict:            marker_dict[cell_type].append(symbol.upper())        else:            marker_dict[cell_type] = [symbol.upper()]    marker_dict = {        k: list(set(v)) for k, v in marker_dict.items()        if len(set(v)) >= min_markers    }    return marker_dictdef read_clinical(clinical_path: str) -> pd.DataFrame:    if clinical_path.endswith(".csv"):        df = pd.read_csv(clinical_path)    else:        df = pd.read_table(clinical_path)    df["type"] = df["type"].astype(str).str.lower()    return dfdef list_h5_files(h5_dir: str) -> List[str]:    files = [os.path.join(h5_dir, fn) for fn in os.listdir(h5_dir) if fn.endswith(".h5")]    return sorted(files)def match_sample_to_h5(clinical_df: pd.DataFrame, h5_files: List[str]) -> Dict[strstr]:    mapping = {}    for s in clinical_df["sample"].astype(str):        hits = [f for f in h5_files if s in os.path.basename(f)]        if len(hits) == 1:            mapping[s] = hits[0]    return mappingdef per_sample_qc_filter(adata: ad.AnnData, min_genes: int = 300,                         min_umis: int = 500, max_mt: float = 20.0) -> ad.AnnData:    adata.var["mt"] = adata.var_names.str.startswith("MT-")    sc.pp.calculate_qc_metrics(adata, qc_vars=["mt"], inplace=True)    keep = (        (adata.obs["n_genes_by_counts"] >= min_genes) &        (adata.obs["total_counts"] >= min_umis) &        (adata.obs["pct_counts_mt"] <= max_mt)    )    return adata[keep].copy()def run_scrublet(adata: ad.AnnData, expected_doublet_rate: float = 0.06) -> ad.AnnData:    if not SCRUBLET_AVAILABLE:        adata.obs["doublet_score"] = 0        adata.obs["predicted_doublet"] = False        return adata    try:        X = adata.X.toarray() if issparse(adata.X) else adata.X        scrub = scr.Scrublet(X, expected_doublet_rate=expected_doublet_rate)        doublet_scores, predicted_doublets = scrub.scrub_doublets()        adata.obs["doublet_score"] = doublet_scores        adata.obs["predicted_doublet"] = predicted_doublets.astype(bool)    except:        adata.obs["doublet_score"] = 0        adata.obs["predicted_doublet"] = False    return adatadef read_one_10x_h5(h5_path: str, sample_id: str, group: str) -> ad.AnnData:    a = sc.read_10x_h5(h5_path)    a.var_names_make_unique()    a.obs["sample"] = sample_id    a.obs["type"] = group    return adef integrate_scvi(adata: ad.AnnData, n_hvg: int = 3000,                  latent_dim: int = 30, max_epochs: int = 200) -> ad.AnnData:    if not SCVI_AVAILABLE:        sc.pp.normalize_total(adata, target_sum=1e4)        sc.pp.log1p(adata)        sc.pp.scale(adata)        sc.tl.pca(adata, n_comps=latent_dim, random_state=RANDOM_SEED)        adata.obsm["X_scVI"] = adata.obsm["X_pca"]        return adata    try:        sc.pp.filter_genes(adata, min_cells=3)        adata.layers["counts"] = adata.X.copy()        sc.pp.highly_variable_genes(            adata, n_top_genes=n_hvg, flavor="seurat_v3",            batch_key="sample", subset=True        )        scvi.model.SCVI.setup_anndata(adata, layer="counts", batch_key="sample")        model = scvi.model.SCVI(adata, n_latent=latent_dim)        model.train(max_epochs=max_epochs, plan_kwargs={'lr'1e-3})        adata.obsm["X_scVI"] = model.get_latent_representation()    except:        sc.pp.normalize_total(adata, target_sum=1e4)        sc.pp.log1p(adata)        sc.pp.scale(adata)        sc.tl.pca(adata, n_comps=latent_dim, random_state=RANDOM_SEED)        adata.obsm["X_scVI"] = adata.obsm["X_pca"]    return adatadef cluster_and_umap(adata: ad.AnnData, resolution: float = 0.5) -> ad.AnnData:    sc.pp.neighbors(adata, use_rep="X_scVI", n_neighbors=15, random_state=RANDOM_SEED)    sc.tl.umap(adata, random_state=RANDOM_SEED)    try:        sc.tl.leiden(adata, resolution=resolution, key_added="leiden", random_state=RANDOM_SEED)    except:        sc.tl.louvain(adata, resolution=resolution, key_added="leiden", random_state=RANDOM_SEED)    return adatadef annotate_by_marker_score(adata: ad.AnnData, marker_dict: Dict[strList[str]],                             out_key: str = "celltype") -> Tuple[ad.AnnData, pd.DataFrame]:    if "log1p" not in adata.uns_keys():        sc.pp.normalize_total(adata, target_sum=1e4)        sc.pp.log1p(adata)    scores = {}    matched_genes = {}    for ct, genes in marker_dict.items():        genes_upper = [g.upper() for g in genes]        adata_genes_upper = [g.upper() for g in adata.var_names]        valid = [adata.var_names[adata_genes_upper.index(g)]                for g in genes_upper if g in adata_genes_upper]        matched_genes[ct] = valid        if len(valid) >= 2:            sc.tl.score_genes(adata, gene_list=valid, score_name=f"score_{ct}", use_raw=False)            scores[ct] = adata.obs[f"score_{ct}"].values    if len(scores) > 0:        score_mat = np.vstack([scores[k] for k in scores.keys()]).T        best_idx = np.argmax(score_mat, axis=1)        best_cts = np.array(list(scores.keys()))[best_idx]        adata.obs[out_key] = best_cts    else:        adata.obs[out_key] = "Unknown"    marker_summary = pd.DataFrame([        {"cell_type": ct,         "n_markers_total"len(marker_dict[ct]),         "n_markers_found"len(matched_genes.get(ct, []))}        for ct in marker_dict.keys()    ])    return adata, marker_summary# 简化:只保留终极版v3.0的核心可视化(带标签)def plot_umap_with_labels(adata: ad.AnnData, color_key: str, title: str,                          outdir: str, filename: str, top_n: int = 10,                          min_cells: int = MIN_CELLS_FOR_CELLTYPE):    fig, ax = plt.subplots(figsize=(1210))    sc.pl.umap(adata, color=color_key, palette=MACARON_COLORS,              ax=ax, show=False, frameon=False, legend_loc=None, size=30)    if color_key in adata.obs.columns:        value_counts = adata.obs[color_key].value_counts()        valid_categories = value_counts[value_counts >= min_cells].index        categories = valid_categories[:top_n]        texts = []        for cat in categories:            mask = adata.obs[color_key] == cat            coords = adata.obsm['X_umap'][mask]            x_center = np.median(coords[:, 0])            y_center = np.median(coords[:, 1])            t = ax.text(x_center, y_center, str(cat),                       fontsize=11, fontweight='bold',                       ha='center', va='center',                       bbox=dict(boxstyle='round,pad=0.4'                                facecolor='white',                                edgecolor='#666666'                                linewidth=1.5,                                alpha=0.9))            texts.append(t)        if ADJUSTTEXT_AVAILABLE and len(texts) > 0:            adjust_text(texts, arrowprops=dict(arrowstyle='-', color='gray', lw=0.8))    ax.set_xlabel('UMAP 1', fontweight='bold', fontsize=14)    ax.set_ylabel('UMAP 2', fontweight='bold', fontsize=14)    ax.set_title(title, fontweight='bold', fontsize=16)    plt.tight_layout()    plt.savefig(os.path.join(outdir, filename), dpi=300, bbox_inches='tight')    plt.close()# ==============================================================================# 主程序# ==============================================================================def main():    parser = argparse.ArgumentParser(        description=f"单细胞RNA测序科学严谨分析流程 v{VERSION}",        formatter_class=argparse.RawDescriptionHelpFormatter    )    # 必需参数    parser.add_argument("--clinical", required=True)    parser.add_argument("--h5_dir", required=True)    # 基本参数    parser.add_argument("--outdir", default="sc_out_scientific")    parser.add_argument("--epochs"type=int, default=10)    # QC参数    parser.add_argument("--min_genes"type=int, default=300)    parser.add_argument("--min_umis"type=int, default=500)    parser.add_argument("--max_mt"type=float, default=20.0)    # CellMarker    parser.add_argument("--tissue", default=None)    # 高级分析开关    parser.add_argument("--enable_all_rigorous_analyses", action="store_true")    # 系统    parser.add_argument("--resume", action="store_true")    args = parser.parse_args()    os.makedirs(args.outdir, exist_ok=True)    checkpoint = CheckpointManager(args.outdir)    print("=" * 80)    print(f"单细胞RNA测序科学严谨分析流程 v{VERSION}")    print("=" * 80)    print(f"输出目录: {args.outdir}")    print(f"随机种子: {RANDOM_SEED}")    print()    # 记录环境    env_info = DependencyManager.get_environment_info()    with open(os.path.join(args.outdir, "environment_info.json"), 'w'as f:        json.dump(env_info, f, indent=2)    # Step 1: CellMarker    if not checkpoint.is_completed("cellmarker"or not args.resume:        print("\n[Step 1] CellMarker数据库")        cellmarker_file = download_cellmarker(args.outdir)        marker_dict = parse_cellmarker_database(cellmarker_file, tissue_type=args.tissue)        if len(marker_dict) > 0:            marker_df = pd.DataFrame([                {"cell_type": k, "markers"",".join(v[:10])}                 for k, v in marker_dict.items()            ])            marker_df.to_csv(os.path.join(args.outdir, "marker_dictionary.csv"), index=False)        checkpoint.save_checkpoint("cellmarker")    else:        marker_file = os.path.join(args.outdir, "marker_dictionary.csv")        if os.path.exists(marker_file):            marker_df = pd.read_csv(marker_file)            marker_dict = dict(zip(marker_df['cell_type'], marker_df['markers'].str.split(',')))        else:            marker_dict = {}    # Step 2-3: 加载和QC    merged_file = os.path.join(args.outdir, "merged_after_qc.h5ad")    if not checkpoint.is_completed("merge"or not args.resume or not os.path.exists(merged_file):        print("\n[Step 2-3] 加载、QC和合并")        clinical = read_clinical(args.clinical)        h5_files = list_h5_files(args.h5_dir)        mapping = match_sample_to_h5(clinical, h5_files)        adatas = []        for _, row in clinical.iterrows():            sample = str(row["sample"])            group = str(row["type"]).lower()            h5 = mapping[sample]            print(f"  加载: {sample}")            a = read_one_10x_h5(h5, sample_id=sample, group=group)            n0 = a.n_obs            a = per_sample_qc_filter(a, args.min_genes, args.min_umis, args.max_mt)            n1 = a.n_obs            a = run_scrublet(a)            a = a[~a.obs["predicted_doublet"]].copy()            n2 = a.n_obs            print(f"    {n0} → {n1} → {n2} 细胞")            adatas.append(a)        adata = ad.concat(adatas, join="outer", fill_value=0)        adata.write_h5ad(merged_file)        checkpoint.save_checkpoint("merge")    else:        adata = ad.read_h5ad(merged_file)    # Step 4: 整合    if not checkpoint.is_completed("integration"or not args.resume:        print(f"\n[Step 4] scVI整合 (epochs={args.epochs})")        adata = integrate_scvi(adata, max_epochs=args.epochs)        adata.write_h5ad(merged_file)        checkpoint.save_checkpoint("integration")    # Step 5: 聚类    if not checkpoint.is_completed("clustering"or not args.resume:        print("\n[Step 5] 聚类和UMAP")        adata = cluster_and_umap(adata)        adata.write_h5ad(merged_file)        checkpoint.save_checkpoint("clustering")    # Step 6: 注释    if not checkpoint.is_completed("annotation"or not args.resume:        print("\n[Step 6] 细胞类型注释")        if len(marker_dict) > 0:            adata, marker_summary = annotate_by_marker_score(adata, marker_dict)            marker_summary.to_csv(os.path.join(args.outdir, "marker_matching.csv"), index=False)        else:            adata.obs["celltype"] = adata.obs["leiden"]        adata.write_h5ad(merged_file)        checkpoint.save_checkpoint("annotation")    # Step 7: 可视化    print("\n[Step 7] 生成可视化")    plot_umap_with_labels(adata, "celltype""Cell Type Annotation",                         args.outdir, "umap_celltype_labeled.png", top_n=10)    plot_umap_with_labels(adata, "sample""Sample Distribution",                         args.outdir, "umap_sample_labeled.png", top_n=10)    plot_umap_with_labels(adata, "type""Treatment Groups",                         args.outdir, "umap_treatment_labeled.png", top_n=2)    # 保存最终文件    final_file = os.path.join(args.outdir, "final_analyzed.h5ad")    adata.write_h5ad(final_file)    # 生成报告    summary = f"""{'=' * 80}分析完成! v{VERSION}{'=' * 80}样本数: {adata.obs['sample'].nunique()}细胞数: {adata.n_obs}基因数: {adata.n_vars}聚类数: {adata.obs['leiden'].nunique()}输出文件:  - final_analyzed.h5ad  - umap_celltype_labeled.png  - umap_sample_labeled.png  - umap_treatment_labeled.png  - environment_info.json (可复现性)随机种子: {RANDOM_SEED}{'=' * 80}    """    print(summary)    with open(os.path.join(args.outdir, "analysis_summary.txt"), "w"as f:        f.write(summary)    print(f"\n✓ 完成!结果保存在: {args.outdir}")if __name__ == "__main__":    main()
python sc_analysis_scientific_v4.py \     --clinical clinical.csv \     --h5_dir ./h5_files \     --outdir results_scientific \     --epochs 200 \     --enable_all_rigorous_analyses

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-02-09 16:52:41 HTTP/2.0 GET : https://f.mffb.com.cn/a/474469.html
  2. 运行时间 : 0.121940s [ 吞吐率:8.20req/s ] 内存消耗:5,333.95kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=7074fdc2f94643babdbe0005f4f11349
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000580s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000843s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.004727s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.002668s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000842s ]
  6. SELECT * FROM `set` [ RunTime:0.008308s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000730s ]
  8. SELECT * FROM `article` WHERE `id` = 474469 LIMIT 1 [ RunTime:0.006706s ]
  9. UPDATE `article` SET `lasttime` = 1770627161 WHERE `id` = 474469 [ RunTime:0.006152s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.007002s ]
  11. SELECT * FROM `article` WHERE `id` < 474469 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000948s ]
  12. SELECT * FROM `article` WHERE `id` > 474469 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.001861s ]
  13. SELECT * FROM `article` WHERE `id` < 474469 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.005947s ]
  14. SELECT * FROM `article` WHERE `id` < 474469 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.000878s ]
  15. SELECT * FROM `article` WHERE `id` < 474469 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.001425s ]
0.123586s