python - 尝试使用 gzip 解压缩文件但错误 : "name ' d' is not defined"

标签 python jupyter-notebook gzip bioinformatics rna-seq

我对生物信息学还很陌生,我正在尝试解压缩 fastq.gz 文件以将其转换为 .bam(我稍后尝试使用 DESeq2 分析该转录组数据)。 我刚开始使用 Jupyter 笔记本解压缩文件,但无法完成 - 这是我正在使用的命令行和错误:

In [2] gzip -d /Users/mfp/RNAdata/transcriptome-mcgirr/SRR11476490/CAE4_S34_R1_001.fastq.gz

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Input In [2], in <cell line: 1>()
----> 1 gzip -d /Users/mfp/RNAdata/transcriptome-mcgirr/SRR11476490/CAE4_S34_R1_001.fastq.gz

NameError: name 'd' is not defined

知道我做错了什么吗? (老实说,它可以是一切)。

最佳答案

您应该在命令前使用 !gzip -d/Users/mfp/RNAdata/transcriptome-mcgirr/SRR11476490/CAE4_S34_R1_001.fastq.gz 以及 !gzip 是您的发行版提供的二进制可执行文件,您通常从 shell 或命令行调用它。 Jupyter 的默认行为是将命令解析为 python 语句。由于您的命令不是有效的 python 语句,因此出现错误。

当您在命令前加上 ! 前缀时,它会被传递到操作系统的 shell,这正是您最初想要的。

您可以阅读文档here .

关于python - 尝试使用 gzip 解压缩文件但错误 : "name ' d' is not defined",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72580605/

相关文章:

python - 在 Flask 中上传图片

Python - ConfigParser 抛出评论

python - pywinauto TypeError : item 2 in _argtypes_ passes a union by value, 不受支持

在 Google Cloud Platform 中使用 jupyter notebook 的 Python 模块和包

c# - gzipstream 用于套接字上的仅转发流

python - 错误: cannot import name 'SpearmanRConstantInputWarning' from 'scipy.stats'

machine-learning - 导入错误: DLL load failed: The specified procedure could not be found

python - 如何在 ipyvuetify 中从浅色主题切换到深色主题?

hadoop - 解压时如何读取压缩文件?

php - 用 PHP 解压缩 Tiled TMX 文件内容