R语言如何根据ID列表取对应列的数据

发布时间:2022-03-17 16:37:23 作者:iii
来源:亿速云 阅读:1067

本篇内容主要讲解“R语言如何根据ID列表取对应列的数据”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“R语言如何根据ID列表取对应列的数据”吧!

subset_column.r  根据ID列表,取对应列的数据子集

使用方法:

usage: /share/nas1/huangls/test/TCGA_GEO_immu/scripts/subset_column.r
       [-h] -i input -m idlist [-c colname] [-o outdir] [-p prefix]
get data by column ID
optional arguments:
  -h, --help            show this help message and exit
  -i input, --input input
                        input matrix data [required]
  -m idlist, --idlist idlist
                        input column ID list ,default first column [required]
  -c colname, --colname colname
                        match column name in idlist [required]
  -o outdir, --outdir outdir
                        output file directory [default cwd]
  -p prefix, --prefix prefix
                        output file name prefix [default demo]

参数说明:

-i 输入要处理的表格,第一列会都成行名


TCGA-D7-A74A-01A-11R-A32D-31TCGA-BR-7704-01A-11R-2055-13TCGA-VQ-A91N-01A-11R-A414-31TCGA-CD-A4MH-01A-11R-A251-31
TSPAN619.7122915.1681258.95336274112.4479129
TNMD0.128679000.417115888
DPM1166.1934229.3096160.0258308223.6269896
SCYL38.7212583.7157718.446819778.307169238
C1orf1126.9352842.18126316.467929837.387781561
FGR2.25123418.92023.1458435857.801411858
CFH3.53555214.0303212.5308006410.27682391
FUCA2103.1044119.298128.6210801138.7011133
GCLC30.4774425.1222730.2496398825.52302692

-m 指定ID列表,-c colname 指定哪一列作为ID列表的列表;

barcodepatientshortLetterCodedefinitionstage
TCGA-B7-A5TK-01A-12R-A36D-31TCGA-B7-A5TKTPPrimary solid TumorStage IIIA
TCGA-BR-7959-01A-11R-2343-13TCGA-BR-7959TPPrimary solid TumorStage IIIA
TCGA-IN-8462-01A-11R-2343-13TCGA-IN-8462TPPrimary solid TumorStage IIB
TCGA-BR-A4CR-01A-11R-A24K-31TCGA-BR-A4CRTPPrimary solid TumorStage IIIC
TCGA-CG-4443-01A-01R-1157-13TCGA-CG-4443TPPrimary solid TumorStage IA
TCGA-KB-A93J-01A-11R-A39E-31TCGA-KB-A93JTPPrimary solid TumorStage II
TCGA-IN-A6RO-01A-12R-A33Y-31TCGA-IN-A6ROTPPrimary solid TumorStage IA
TCGA-HU-A4H3-01A-21R-A251-31TCGA-HU-A4H3TPPrimary solid TumorStage IIIC
TCGA-RD-A8MV-01A-11R-A36D-31TCGA-RD-A8MVTPPrimary solid TumorStage IIIB

使用命令举例:

Rscript  subset_column.r -i ../01.TCGA_download/TCGA-STAD_gene_expression_TPM.tsv -m metadata.tsv  -p TCGA-STAD_gene_expression_TPM

到此,相信大家对“R语言如何根据ID列表取对应列的数据”有了更深的了解,不妨来实际操作一番吧!这里是亿速云网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!

推荐阅读:
  1. R语言取子集
  2. XCode各版本与Mac OS各版本对应列表

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

r语言

上一篇:perl中如何输出指定ID对应的双端fastq文件

下一篇:R语言如何在行上取数据子集

相关阅读

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

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