bash - 通过 bash 脚本运行 python 脚本会导致意外输出
问题描述
我正在尝试使用一种名为质粒查找器的软件,但遇到了一些困难。质粒查找器使用两个数据库,但是当我尝试使用 bash 脚本在多个文件上批量运行质粒查找器时,它无法使用革兰氏阳性数据库。
我尝试重新安装数据库,在 Docker 中运行脚本,而不是每次运行脚本时都执行 Docker 实例,更改数据库文件名以强制脚本使用 gram positive 数据库。
#!/bin/bash
# runs plasmidFinder on each fasta file in current directory
for FILE in `ls` ;
do
mkdir $FILE.output
sudo docker run --rm -it -v $PLASMID_DB:/database -v $(pwd):/workdir plasmidfinder -i $FILE -o $FILE.output -x
done
是的,我意识到对于 FILE in ls
; 不是好的 bash 编码实践,但我的主要优先事项是让脚本工作:)
以下是我按顺序运行质粒查找器时发生的情况。
{'plasmidfinder': {'results': {'Enterobacteriaceae': {'enterobacteriaceae': 'No '
'hit '
'found'},
'Gram Positive': {'gram_positive': 'No hit '
'found'}},
'run_info': {'date': '08.05.2019', 'time': '17:58:06'},
'user_input': {'file_format': 'fasta',
'filename(s)': ['file1.fasta'],
'method': 'blast'}}}
当我通过我提供的 bash 脚本运行质粒查找器时,会发生以下情况。
{'plasmidfinder': {'results': {'Enterobacteriaceae': {'enterobacteriaceae': 'No '
'hit '
'found'},
'run_info': {'date': '08.05.2019', 'time': '17:58:06'},
'user_input': {'file_format': 'fasta',
'filename(s)': ['file1.fasta'],
'method': 'blast'}}}
注意这里的第二个例子中没有使用 gram positive 数据库。
我的 bash 脚本有问题吗?我该如何解决这个问题?
谢谢!
解决方案
推荐阅读
- c++ - С调用带有字符串变量的静态类结构而没有c ++中的对象
- c++ - 为什么这个函数可以返回一个 C++ int 引用?
- mysql - Cloudways SQLSTATE [HY000] [1045] 'root'@'localhost' 的访问被拒绝(使用密码:YES)(SQL:SHOW FULL TABLES WHERE table_type = 'BASE TABLE')
- laravel - Laravel 6 改回旧的 5.8 异常屏幕
- node.js - 如何通过 NodeJS(即通过“npm install”)下载 Doxygen for C++?
- javascript - 在页面中呈现带有 HTML 标记的文本
- regex - 如何制作一个将一组频率与另一组频率进行比较的正则表达式模式
- python - Tensorflow - 一步一步调试 C++ 代码
- java - 如何在 Eclipse 的上下文菜单(包资源管理器)下带来子菜单或命令?
- java - 在运行时将 String 转换为正确的 avro 类型