0

Please, can anybody explain what the **wildcards in the code below does. Also, I have come across both "*wildcards" and "**wildcards", how are they different?.

In this case, does **wildcards mean wildcards.sample?

def STAR_input(wildcards):
    if config["PE_or_SE"] == "SE":
        fq1="analysis/trimmed_data/{sample}_R1_trimmed.fq.gz".format(**wildcards)
        return fq1
    elif config["PE_or_SE"] == "PE":
        fq1 = "analysis/trimmed_data/{sample}_R1_val_1.fq.gz".format(**wildcards)
        fq2 = "analysis/trimmed_data/{sample}_R2_val_2.fq.gz".format(**wildcards)
        return [fq1,fq2]
olahs
  • 31
  • 3
  • This is a common python syntax for unpacking lists (*) and dictionaries (**), often used to call functions with many arguments. See, for example: https://towardsdatascience.com/unpacking-operators-in-python-306ae44cd480 – Marmaduke Nov 04 '21 at 16:58

0 Answers0