溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

R語言如何根據(jù)ID列表取對應(yīng)列的數(shù)據(jù)

發(fā)布時間:2022-03-17 16:37:23 來源:億速云 閱讀:1089 作者:iii 欄目:開發(fā)技術(shù)

本篇內(nèi)容主要講解“R語言如何根據(jù)ID列表取對應(yīng)列的數(shù)據(jù)”,感興趣的朋友不妨來看看。本文介紹的方法操作簡單快捷,實用性強(qiáng)。下面就讓小編來帶大家學(xué)習(xí)“R語言如何根據(jù)ID列表取對應(yīng)列的數(shù)據(jù)”吧!

subset_column.r  根據(jù)ID列表,取對應(yīng)列的數(shù)據(jù)子集

使用方法:

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]

參數(shù)說明:

-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語言如何根據(jù)ID列表取對應(yīng)列的數(shù)據(jù)”有了更深的了解,不妨來實際操作一番吧!這里是億速云網(wǎng)站,更多相關(guān)內(nèi)容可以進(jìn)入相關(guān)頻道進(jìn)行查詢,關(guān)注我們,繼續(xù)學(xué)習(xí)!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI