温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

R语言的hclust_analysis.r如何使用

发布时间:2022-03-19 17:53:25 来源:亿速云 阅读:276 作者:iii 栏目:开发技术

本篇内容介绍了“R语言的hclust_analysis.r如何使用”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!

hclust_analysis.r 转录组数据层次聚类分析

使用说明:

usage: hclust_analysis.r [-h] -i filepath [-d distance] [-m method] [-T top]
                         [-S] [-M max.nc] [-k bestk] [-s size] [-a alpha] [-e]
                         [-L] [-X label] [-Y label] [-t label] [-o path]
                         [-H number] [-W number]
Hierarchical Clustering and
plot:https://clincancerres.aacrjournals.org/content/25/16/5002
optional arguments:
  -h, --help            show this help message and exit
  -i filepath, --input filepath
                        input the dataset martix [required]
  -d distance, --distance distance
                        the distance measure to be used to compute the
                        dissimilarity matrix. This must be one of:
                        "euclidean", "maximum", "manhattan", "canberra",
                        "binary", "minkowski" . By default,
                        distance="euclidean".
  -m method, --method method
                        the cluster analysis method to be used. This should be
                        one of: "ward.D", "ward.D2", "single", "complete",
                        "average", "mcquitty", "median", "centroid". by
                        default method=ward.D
  -T top, --top top     select top gene to analysis [default NULL]
  -S, --scale           scale data sd=1 mean=0 [default FALSE]
  -M max.nc, --max.nc max.nc
                        maximal number of clusters for nbclust, between 2 and
                        (number of objects - 1), greater or equal to min.nc.
                        By default [optional, default: 15]
  -k bestk, --bestk bestk
                        set bestk or nbclust choose bestk [optional, default:
                        NULL]

  -X label, --x.lab label
                        the label for x axis [optional, default: sample ]
  -Y label, --y.lab label
                        the label for y axis [optional, default: Distance ]
  -t label, --title label
                        the label for main title [optional, default: Cluster
                        Dendrogram]
  -o path, --outdir path
                        output file directory [default cwd]
  -H number, --height number
                        the height of pic inches [default 5]
  -W number, --width number
                        the width of pic inches [default 10]

使用方法:

应该运行两次

#第一次运行不指定K,通过nbclust 结果选择合适的K (亚型)
Rscript $scriptdir/hclust_analysis.r -i immu/ssgsea.res.tsv  -o hclust  -M 20 --distance "euclidean"  
#再次运行指定最佳K,输出聚类树和分组表格
Rscript $scriptdir/hclust_analysis.r -i immu/ssgsea.res.tsv  -o hclust   --distance "euclidean" -k 2

参数说明:

-i  输入基因表达矩阵文件,或者免疫侵润矩阵文件

cell_typeTCGA-B7-A5TK-01A-12R-A36D-31TCGA-BR-7959-01A-11R-2343-13TCGA-IN-8462-01A-11R-2343-13TCGA-BR-A4CR-01A-11R-A24K-31TCGA-CG-4443-01A-01R-1157-13
aDC0.6121310.4527210.4340650.3526350.268974
B cells0.4233230.408870.4266120.4138570.289268
Blood vessels0.6810230.7754390.6894330.5776670.745019
CD8 T cells0.6756150.6500730.6291210.5660480.577315
Cytotoxic cells0.6210560.4252170.4116170.31280.191034
DC0.6198390.4850560.4891010.2669050.350132
Eosinophils0.5027850.5149390.4695410.4880510.456521
iDC0.531620.4984370.5309310.3906990.420172
Lymph vessels0.7108430.7213230.6583910.5005740.400411
Macrophages0.6082710.5984820.5522770.4685310.438481
Mast cells0.4807920.5259270.478710.246770.124795
Neutrophils0.4476720.4580980.3935410.31050.344511
NK CD56bright cells0.4626330.4186170.5460940.572620.460983
NK CD56dim cells0.3414740.1371470.031158-0.04299-0.0389
NK cells0.5581230.5129290.5070880.4795420.446198
Normal mucosa0.7794440.8202810.8067710.6913840.65646
pDC0.6767720.6474150.6211860.4825640.552156
SW480 cancer cells0.5341510.6002360.6185090.4121960.60535
T cells0.6270560.4254220.3996120.3261160.188205
T helper cells0.6691030.6454070.628070.6502160.628577
Tcm0.5624080.5599510.5272720.5160680.553444
Tem0.5189520.5559420.4105770.4400070.449251
TFH0.4851240.4777490.4450610.4655520.446549
Tgd0.1901990.1101390.0616480.0040260.023796
Th2 cells0.5639280.4917360.4555230.4263510.378701
Th27 cells0.4172750.1537130.2187270.2150260.257282
Th3 cells0.5361420.4786870.447160.5395340.416747
TReg0.6820360.4847610.5169630.308840.312123

“R语言的hclust_analysis.r如何使用”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注亿速云网站,小编将为大家输出更多高质量的实用文章!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI