创建新的虚拟环境
在同一个虚拟环境中安装多个软件可能存在版本冲突:
例如:
srst2
和SPAdes
在同一虚拟环境安装时,出现如下报错:
srst2=0.2.0
需要的python版本为:2.7.x,而当前虚拟环境assembly
中的python版本是3.9
(assembly) wangyf@Rs-3:~$ conda install -c bioconda srst2=0.2.0
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
failed
UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:
Specifications:
- srst2=0.2.0 -> python[version='2.7.*|<3|>=2.7,<2.8.0a0']
Your python: python=3.9
1、创建新的虚拟环境并直接安装srst2
使用命令行:
conda create -n srst2 -c bioconda srst2=0.2.0
创建名为srst2的虚拟环境,并在其中安装srst2软件
(assembly) wangyf@Rs-3:~$ conda create -n srst2 -c bioconda srst2=0.2.0
Proceed ([y]/n)? y
Downloading and Extracting Packages
intel-openmp-2023.1. | 17.2 MB | ############################################################################# | 100%
certifi-2020.6.20 | 155 KB | ############################################################################# | 100%
gdbm-1.18 | 194 KB | ############################################################################# | 100%
mkl_random-1.1.0 | 297 KB | ############################################################################# | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
# $ conda activate srst2
#
# To deactivate an active environment, use
#
# $ conda deactivate
2、检查软件是否安装成功
运行
srst2 -h
检查是否安装成功,出现如下界面这代表安装成功
(assembly) wangyf@Rs-3:~$ conda activate srst2
(srst2) wangyf@Rs-3:~$ srst2 -h
usage: srst2 [-h] [--version] [--input_se INPUT_SE [INPUT_SE ...]]
[--input_pe INPUT_PE [INPUT_PE ...]] [--merge_paired]
[--forward FORWARD] [--reverse REVERSE] [--read_type {q,qseq,f}]
[--mlst_db MLST_DB] [--mlst_delimiter MLST_DELIMITER]
[--mlst_definitions MLST_DEFINITIONS]
[--mlst_max_mismatch MLST_MAX_MISMATCH]
[--gene_db GENE_DB [GENE_DB ...]] [--no_gene_details]
[--gene_max_mismatch GENE_MAX_MISMATCH]
[--min_coverage MIN_COVERAGE] [--max_divergence MAX_DIVERGENCE]
[--min_depth MIN_DEPTH] [--min_edge_depth MIN_EDGE_DEPTH]
#(省略其他参数)
基本用法1——MLST
# 获取需要匹配的fasta序列数据库
getmlst.py --species 'Escherichia coli#1'
# 运行 MLST
srst2 --input_pe strainA_1.fastq.gz strainA_2.fastq.gz --output strainA_test --log --mlst_db Escherichia_coli#1.fasta --mlst_definitions profiles_csv --mlst_delimiter _
基本用法2——Resistance genes
# --gene_db 官方建议使用CARD_v3.0.8_SRST2.fasta数据库
# 运行Run gene detection
srst2 --input_pe strainA_1.fastq.gz strainA_2.fastq.gz --output strainA_test --log --gene_db CARD_v3.0.8_SRST2.fasta