MV 命令在 Snakemake 规则中不移动文件
MV command isnt moving files in Snakemake Rule
我是运行这条在第一个shell命令中调用的新规则tin.py。该文件写入当前目录,这很好。我想在创建它们时或之后将它们移动到一个名为 rnaseqc 的新文件夹中。但是,只有一部分是,其余的都是错误的。错误是 set -euo pipefail。我究竟做错了什么?是什么让它变得更好?
rule tin:
"""
Quality-control step to infer RNA integrity at the transcript level.
TINs (transcript integrity numbers) are calculated for all canoncial
protein-coding transcripts. TIN is analogous to a computationally derived
RIN value. From the docs: requires a sort and indexed bam file.
@Input:
Sorted, duplicate marked genomic BAM file (scatter)
@Output:
RSeQC logfiles containing transcript integrity number information
"""
input:
bam = rules.picard_dupes.output.bam,
bai = rules.picard_dupes.output.index,
control = rules.rseqc.output.Rdist
output:
out1 = 'rnaseqc/{sampleID}_marked_duplicates.tin.xls',
out2 = 'rnaseqc/{sampleID}_marked_duplicates.summary.txt'
params:
## Can I make more user friendly?
bedref = 'PATH/transcripts.protein_coding_only.bed12',
outdir = 'rnaseqc'
run:
## Can I make more user friendly?
shell('python PATH/.local/bin/tin.py -i {input.bam} -r {params.bedref}')
# moves to rnaseqc directory
shell('mv *.{txt,xls} {params.outdir}')
# tried this also and getting index out of range error
#shell('find . -maxdepth 1 -name "*txt" -or -name "*xls" -exec mv {} {params.outdir}')
我的猜测是 运行同时使用此规则的多个版本存在问题。当 sample2 的作业移动它的所有文件时,一项作业在 运行ning sample1 的中间!您可以更新您的移动命令以仅针对有问题的示例:
shell('mv {wildcards.sampleID}_marked_duplicates.* {params.outdir}')
并且通常在 运行 块中使用 shell 指令而不是 shell 命令更可取。
我是运行这条在第一个shell命令中调用的新规则tin.py。该文件写入当前目录,这很好。我想在创建它们时或之后将它们移动到一个名为 rnaseqc 的新文件夹中。但是,只有一部分是,其余的都是错误的。错误是 set -euo pipefail。我究竟做错了什么?是什么让它变得更好?
rule tin:
"""
Quality-control step to infer RNA integrity at the transcript level.
TINs (transcript integrity numbers) are calculated for all canoncial
protein-coding transcripts. TIN is analogous to a computationally derived
RIN value. From the docs: requires a sort and indexed bam file.
@Input:
Sorted, duplicate marked genomic BAM file (scatter)
@Output:
RSeQC logfiles containing transcript integrity number information
"""
input:
bam = rules.picard_dupes.output.bam,
bai = rules.picard_dupes.output.index,
control = rules.rseqc.output.Rdist
output:
out1 = 'rnaseqc/{sampleID}_marked_duplicates.tin.xls',
out2 = 'rnaseqc/{sampleID}_marked_duplicates.summary.txt'
params:
## Can I make more user friendly?
bedref = 'PATH/transcripts.protein_coding_only.bed12',
outdir = 'rnaseqc'
run:
## Can I make more user friendly?
shell('python PATH/.local/bin/tin.py -i {input.bam} -r {params.bedref}')
# moves to rnaseqc directory
shell('mv *.{txt,xls} {params.outdir}')
# tried this also and getting index out of range error
#shell('find . -maxdepth 1 -name "*txt" -or -name "*xls" -exec mv {} {params.outdir}')
我的猜测是 运行同时使用此规则的多个版本存在问题。当 sample2 的作业移动它的所有文件时,一项作业在 运行ning sample1 的中间!您可以更新您的移动命令以仅针对有问题的示例:
shell('mv {wildcards.sampleID}_marked_duplicates.* {params.outdir}')
并且通常在 运行 块中使用 shell 指令而不是 shell 命令更可取。