私は、展開関数を使用するときに正規表現を使用するのに苦労しています。何らかの理由で、ワイルドカードは、実行された正規表現ではなくプレーンテキストとして常にインポートされます。正規表現が事前にワイルドカードとして導入されているのか、拡張機能に関連して導入されているのかに違いはありません(all_decompressとall_decompress2を参照)。エラーが常にある:Snakemake:expand()でregexを使用する
Missing input files for rule DECOMPRESS:
Resources/raw/run1_lane1_read[1,2]_index\d+-\d+=[1-9], [11-32].fastq.gz
-
#!/usr/bin/env python3
import re
###### WILDCARDS #####
## General descriptive parameters
read = "[1,2]"
index_prefix = r"\d{3}-\d{3}"
index = r"[1-9], [11-32]"
##### RULES #####
### CONJUNCTION RULES ("all") ###
# PREANALYSIS #
rule all_decompress:
input:
expand("Resources/decompressed/read{read}_index{index_prefix}={index}.fastq", read=read, index_prefix=index_prefix, index=index)
rule all_decompress2:
input:
expand("Resources/decompressed/read{read}_index{index_prefix}={index}.fastq", read=[1,2], index_prefix=r"\d{3}-\d{3}", index=r"[1-9], [11-32]")
### TASK RULES ###
# PREANALYSIS #
# Decompress .gz zipped raw files
rule DECOMPRESS:
input:
"Resources/raw/run1_lane1_read{read}_index{index_prefix}={index}.fastq.gz"
output:
"Resources/decompressed/read{read}_index{index_prefix}={index}.fastq"
shell:
"gzip -d -c {input} > {output}"
便利なことがいくつかあります: 'wildcard_constraints'(https://snakemake.readthedocs.io/en/stable/snakefiles/rules.html#wildcards)と' glob_wildcards'(https://snakemake.readthedocs.io /en/stable/project_info/faq.html#glob-wildcards) – bli
私は慎重に見ていないかもしれませんが、それを使用せずにあなたが 'reをインポートする 'と私には思われます。 – bli