对于 linux 客户端,官方提供了 apt/Docker/Singularity/Building AUGUSTUS from source 四种安装方式,由于权限及软件问题,建议编译安装,非常不推荐 docker 安装。
首先需要安装依赖 (samtools 可使用 conda 版本):
sudo apt-get install samtools libhts-dev
1 2 3
git clone https://github.com/Gaius-Augustus/Augustus.git cd Augustus make augustus
如果只需要使用 bam2wig, 可以:
1 2 3 4
git clone https://github.com/Gaius-Augustus/Augustus.git cd Augustus/auxprogs/bam2wig make ./Augustus/bin/bam2wig
如果顺利的话,会打印出:
1 2 3 4 5 6 7 8 9
Usage: bam2wig [-r region] [-t trackname] <in.bam> ----------------------------------------------------------------- -r Allows user to specify a target region, e.g. 'chr3L:10-250' This option can only be used if an index file exists See: samtools index -t A string might be provided as track name
NOTE:File needs to be sorted by Reference ID (i.e. target name) Use 'samtools sort <in.bam>' to such effect.
num=$(wc -l < $samplefile) # for i in $(seq 2 2) for i in $(seq 1 $num) do echo$i samplename=$(sed -n "${i}p"$samplefile) # echo $samplename # cd $data_dir_process if [ ! -d $samplename ]; then echo"$samplename not completed, process in $data_dir" sample_file=${data_dir}/${samplename}.bam samtools quickcheck ${sample_file} echo"$samplename is checked" sort_file=${data_dir_process}/${samplename}.sorted.bam samtools sort${sample_file} -@8 -o ${sort_file} samtools stats ${sort_file} | grep 'is sorted' Augustus/bin/bam2wig ${sort_file} > ${results_dir}/${samplename}.wig else echo"$samplename exists!" fi done > run.log
结论
这是一份较为通用的处理方法。
错误解决
docker 版本 bam2wig 失败
主要遇到的问题是 docker 的存储访问问题,在容器起效之后,容器其实无法访问本机的存储空间。
所以docker run -i augustus augustus --version和docker run -i augustus bam2wig是可以使用的,但是docker run -i augustus bam2wig SRR******.bam会提示找不到文件。