Snakemake: Regel wird nicht aufgegriffenPython

Python-Programme
Anonymous
 Snakemake: Regel wird nicht aufgegriffen

Post by Anonymous »

Ich habe versucht, ein Snakemake -Skript zu erstellen, um 3 Aufgaben zu automatisieren. Die erste bearbeitet eine .SEG -Datei, um die richtige Eingabe für die nächste Regel zu sein. Die zweite Regel berechnet eine Analyse für Transkriptionsfaktoren für jeden BAM und gibt als Ausgabe einen Ordner mit Beispielnamen und in einem weiteren Subordner mit dem Namen 'an. TranscriptionFactoren '. > Datei 1
| __ Datei 2
| __ Datei ... < /p>
Und schließlich würde die letzte Regel als Eingabemaßnahmen empfangen. ./Scoring_pipeline.sh ) und wird als Ausgabe einen Ordner mit dem Namen AccessIBioTHIAityOutput, einen Subordner mit Bildern und vielen TXT -Dateien angeben. | TranscriptionFactors
| GTRD_CHIP_ONLY_1000SITES
| < /strong> Datei 1
| Datei 2
| __ Datei ...
| AccessibilityOutput
| < /strong> {} Accessibility1KSITSAdjusted.txt
| < /em> _ {} Accessity1ksites.txt
| < /em> _ Datei ...
| Waveletout
| < /strong> Bild 1
| __ Bild 2
| __ Bild ...
| __ log.txt < /p>

Code: Select all

import os

configfile: "config.yaml"

SAMPLES = [d for d in os.listdir(config["input_folder"]) if os.path.isdir(os.path.join(config["input_folder"], d))]

#print(SAMPLES)
rule all:
input:
expand(config["output_folder"] + "/{sampleID}", sampleID=SAMPLES)
rule format_to_cn_seg_files:
input:
seg=config["seg_folder"] + "/{sampleID}.seg"
output:
filtered_seg="filtered_segs/{sampleID}_filtered.seg"
shell:
"""
mkdir -p filtered_segs
head -n 10 {input.seg}  # Preview first 10 lines
awk '{{print $2 "\\t" $3 "\\t" $4 "\\t" $NF}}' {input.seg} > {output.filtered_seg}
awk '!($NF ~ /^NA$/)' {output.filtered_seg} > {output.filtered_seg}.tmp && mv {output.filtered_seg}.tmp {output.filtered_seg}
sed -i '1d' {output.filtered_seg}
sed -i '1i chr\\tstart\\tend\\tLog2-ratio' {output.filtered_seg}
"""

rule run_tf_analyses_from_bam:
input:
bam=config["input_folder"] + "/{sampleID}/{sampleID}.srtd.markdup.bam",
bai=config["input_folder"] + "/{sampleID}/{sampleID}.srtd.markdup.bam.bai",
seg="filtered_segs/{sampleID}_filtered.seg"
output:
directory(config["output_folder"] + "/{sampleID}")
shell:
"""
mkdir -p {output}
python {config[path_to_scripts]}/run_tf_analyses_from_bam_ori.py \\
-b {input.bam} \\
-o {output} \\
-norm-file {input.seg} -hg38 -a tf_gtrd_1000sites
"""

rule calculate_accessibility:
input:
tf_results=config["output_folder"] + "/{sampleID}"  # Directorio con resultados anteriores
output:
directory(config["output_folder"] + "/{sampleID}")
message: "Executing calculate_accessibility with {input}."
shell:
"""
./scoring_pipeline.sh {input.tf_results} {wildcards.sampleID}
"""
< /code>
Das [url=viewtopic.php?t=11587]Problem[/url] ist, dass, wenn ich mit Snakemake einen Trocknungslauf trog versuche, nur Regel format_to_cn_seg_files und run_tf_analyses_from_bam
Dies ist die Ausgabe im Terminal: snakemake -s snakemake_all_process.smk -erkannt.  n-Debug-dag 

Code: Select all

Building DAG of jobs...
candidate job all
wildcards:
candidate job calculate_accessibility
wildcards: sampleID=04B003764_R
candidate job run_tf_analyses_from_bam
wildcards: sampleID=04B003764_R
candidate job format_to_cn_seg_files
wildcards: sampleID=04B003764_R
selected job format_to_cn_seg_files
wildcards: sampleID=04B003764_R
selected job run_tf_analyses_from_bam
wildcards: sampleID=04B003764_R
candidate job calculate_accessibility
wildcards: sampleID=VH_14B_019722_R
candidate job run_tf_analyses_from_bam
wildcards: sampleID=VH_14B_019722_R
candidate job format_to_cn_seg_files
wildcards: sampleID=VH_14B_019722_R
selected job format_to_cn_seg_files
wildcards: sampleID=VH_14B_019722_R
selected job run_tf_analyses_from_bam
wildcards: sampleID=VH_14B_019722_R
selected job all
wildcards:

Job stats:
job                         count
------------------------  -------
all                             1
format_to_cn_seg_files          2
run_tf_analyses_from_bam        2
total                           5

Reasons:
(check individual jobs above for details)
input files updated by another job:
all, run_tf_analyses_from_bam
output files have to be generated:
run_tf_analyses_from_bam
set of input files has changed since last execution:
format_to_cn_seg_files
Some jobs were triggered by provenance information, see 'reason' section in the rule displays above.
If you prefer that only modification time is used to determine whether a job shall be executed, use the command line option '--rerun-triggers mtime' (also see --help).
If you are sure that a change for a certain output file (say, ) won't change the result (e.g. because you just changed the formatting of a script or environment definition), you can also wipe its metadata to skip such a trigger via 'snakemake --cleanup-metadata '.
Rules with provenance triggered jobs: format_to_cn_seg_files

This was a dry-run (flag -n). The order of jobs does not reflect the order of execution.
Ich versuche, die Regel zu bearbeiten, aber es gibt auch Fehler- oder Ordnerabhängigkeit ... (Ich habe die Ausgabe nicht ..)

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post