我想知道是否有人知道如何在R中解压缩TAR文件以及如何从大量GZ文件中推断数据?此外,有谁知道如何在保持数据文件完整性的同时读取大量数据(大约100个)(在某些时候,我的计算机无法处理大量数据并开始写下涂鸦)?
作为一个新手程序员,仍在学习编程。我被分配去分析和交叉引用关于疾病特征的不同细胞结构之间发现的相似基因的数据。我设法访问TXT数据集文件以进行工作并将其格式化以被另一个名为GSEA的程序识别。
1.)我安装了一个名为“ WinZip”的软件,它帮助我将TAR文件解压缩为GZ文件。我将这些文件存储到“下载”下的新创建的文件夹中
2.)然后,我尝试使用R通过以下代码访问文件:
>untar("file.tar", list=TRUE)
And it produced approximately 170 results (it converted TAR -> GZ files)
3)当我尝试输入一个GZ文件时,它生成了上千行我无法理解的单字母数字字母和数字。
>989 ™šBx
>990 33BŸ™šC:LÍC\005€
>991 LÍB¬
>992 B«™šBꙚB™™šB¯
>993 B¡
>994 BŸ
>995 C\003
>996 BŽ™šBð™šB¦
>997 B(
>998 LÍAòffBó
>999 LÍBñ™šBó
>1000 €
> [ reached 'max' / getOption("max.print") -- omitted 64340 rows ]
Warning messages:
>1: In read.table("GSM2458563_Control_1_0.CEL.gz") :
line 1 appears to contain embedded nulls
>2: In read.table("GSM2458563_Control_1_0.CEL.gz") :
line 2 appears to contain embedded nulls
>3: In read.table("GSM2458563_Control_1_0.CEL.gz") :
line 3 appears to contain embedded nulls
>4: In read.table("GSM2458563_Control_1_0.CEL.gz") :
line 4 appears to contain embedded nulls
>5: In read.table("GSM2458563_Control_1_0.CEL.gz") :
line 5 appears to contain embedded nulls
>6: In scan(file = file, what = what, sep = sep, quote = quote, dec = dec, :
embedded nul(s) found in input
我想做的是同时访问所有这些文件,而又不会在计算机上造成信息过载并保持数据的完整性。然后,我想正确地访问类似于某种数据表的信息(理想情况下,我想知道GSEA是否可以从TAR到TXT文件进行转换以读取和识别此类数据)。
是否有人知道与window兼容的程序可以正确解压缩并读取此类文件,或者是否有任何R命令可以帮助我生成或转换此类数据文件?
背景研究
所以我一直在努力大约一个小时-这是结果。
您尝试打开的文件GSM2458563_Control_1_0
已在.gz
文件内部压缩,该.CELL
文件包含一个文件,因此无法读取。
此类文件由“国家生物技术信息中心”发布。
看到了Python 2代码来打开它们:
from Bio.Affy import CelFile
with open('GSM2458563_Control_1_0.CEL') as file:
c = CelFile.read(file)
我在biopython版本1.74上找到了有关Bio.Affy的文档。
但是当前的biopython自述文件说:
“ ... Biopython 1.76是我们支持Python 2.7和Python 3.5的最终版本。”
现在不推荐使用Python 2,更不用说上面提到的库已经发生了巨大的变化。
解
所以我找到了另一种解决方法,使用R。
我的规格:
Operation System : Windows 64
RStudio : Version 1.3.1073
R Version : R-4.0.2 for Windows
我已经预先安装了下面提到的依赖项。
使用该GEOquery.getGEO
功能从NCBI GEO获取文件。
# Presequites
# Download and install Rtools custom from http://cran.r-project.org/bin/windows/Rtools/
# Install BiocManager
if (!requireNamespace("BiocManager", quietly=TRUE))
install.packages("BiocManager")
BiocManager::install("GEOquery")
library(GEOquery)
# Download and open the data
gse <- getGEO("GSM2458563", GSEMatrix = TRUE)
show(gse)
# ****** Data Table ******
# ID_REF VALUE
# 1 7892501 1.267832
# 2 7892502 3.254963
# 3 7892503 1.640587
# 4 7892504 7.198422
# 5 7892505 2.226013
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句