【发布时间】:2018-04-03 11:49:53
【问题描述】:
我有一个如下所示的 bash 脚本。首先,它将 sorted.bam 文件作为输入并使用“stringtie”工具将每个样本 gtf 作为输出。然后每个样本 gtf 的路径将被输入到 mergelist.txt 中。然后对它们使用“stringtie merge”得到“stringtie_merged.gtf”。
我总共有 40 个 sorted.bam 文件。
for sample in /path/*.sorted.bam
do
dir="/pathto/hisat2_output"
dir2="/pathto/folder"
base=`basename $sample '.sorted.bam'`
"stringtie -p 8 -G gencode.v27.primary_assembly.annotation_nochr.gtf -o ${dir2}/stringtie_output/${base}/${base}_GRCh38.gtf -l ${dir2}/stringtie_output/${base}/${base} ${dir}/${base}.sorted.bam; ls ${dir2}/stringtie_output/*/*_GRCh38.gtf > mergelist.txt; stringtie --merge -p 8 -G gencode.v27.primary_assembly.annotation_nochr.gtf -o ${dir2}/stringtie_output/stringtie_merged.gtf mergelist.txt"
done
我用; 分隔命令在对所有 sorted.bam 文件运行脚本并完成作业后,我看到 mergelist.txt 仅包含 33 个示例 gtf 的路径。这意味着合并 list.txt 中缺少其他 7 个示例 gtfs 的路径。
用;分隔命令是正确的还是有其他方法?
脚本应该首先使用一个命令,输出的路径需要在文本文件中给出,然后使用另一个命令。
【问题讨论】:
-
有什么问题?这会失败吗?
-
是的。我在合并列表中仅看到 33 个样本的路径。txt 没有找到其他 7 个样本的路径。此外,我看到在前 4 个样本上完成 stringtie 后,我看到了 mergelist.txt 和 stringtiemerged.gtf 文件。我需要的是它应该首先在所有样本上应用 stringtie。完成后,它应该将所有输出的路径放入文本文件中,然后对其应用 stringtie 合并。
-
不要引用整个
stringtie行
标签: linux bash shell bioinformatics