Git Product home page Git Product logo

Comments (12)

iromeo avatar iromeo commented on May 29, 2024 2

@lpla we decided not to hardcode snakemake specific method names in the plugin. Instead we collect them from snakamake package and theoretically will automatically support new versions of snakemake if authors add/remove some methods, global variables, etc. That is why it is required to setup python interpreter with snakemake package in ide settings.

from snakecharm.

lpla avatar lpla commented on May 29, 2024 1

I don't see this fixed in latest release 0.4.35.2018.3. I am still having this Undefined reference error with temp, output, config, expand, shell, wildcards and maybe more reserved words.

My Snakefile is here: https://github.com/bitextor/bitextor/blob/master/snakemake/Snakefile

EDIT: sorry, I was wrong. After installing all Python dependences the errors have gone. Thanks for your efforts!

from snakecharm.

iromeo avatar iromeo commented on May 29, 2024

Subtasks:

  • Resolve 'expand' call to snakemake.io #32

E.g.:

rules

rule bam_to_bdg:
    input:
        bam="bams/{sample}.bam",
        cs=rules.download_chrom_sizes.output
    output: temp("bws/{sample}.bdg")
    shell: 'bedtools genomecov -ibam {input.bam} -bg -g {input.cs} > {output}'

directory

rule download_fa:
    output: directory("fa")
    shell: 'rsync -avzP --exclude="*.txt" rsync://hgdownload.cse.ucsc.edu/goldenPath/{config[genome]}/chromosomes/ {output} && '
           'gunzip -f {output}/*.fa.gz'

temp

rule bdg_to_clip:
    output: temp("bws/{sample}.clip")

shell, expand, config

targets = expand("fa/{acc}_{idx}.txt", acc=config["samples"], idx=[1,2])
rule collect_acc:
    output: expand("acc/{sample}.acc", sample=config["samples"])
    run:
        shell('mkdir -p acc')

from snakecharm.

iromeo avatar iromeo commented on May 29, 2024

also:

touch

rule mytask:
    output: touch("mytask.done")
    shell: "mycommand ..."

dynamic

rule all:
    input: dynamic("{clusterid}.cluster.plot.pdf")

unpack

def myfunc(wildcards):
    return { 'foo': '{wildcards.token}.txt'.format(wildcards=wildcards)

rule:
    input: unpack(myfunc)
    output: "someoutput.{token}.txt"
    shell: "..."

from snakecharm.

iromeo avatar iromeo commented on May 29, 2024

E.g.

  • shell is given from from snakemake.shell import shell
  • expand, protected, .. from snakemake.io

from snakecharm.

dievsky avatar dievsky commented on May 29, 2024

Also protected:

rule x:
    output: protected("a.txt")

from snakecharm.

iromeo avatar iromeo commented on May 29, 2024

ancient
https://snakemake.readthedocs.io/en/stable/snakefiles/rules.html#ignoring-timestamps

rule NAME:
    input:
        ancient("path/to/inputfile")
    output:
        "path/to/outputfile"
    shell:
        "somecommand {input} {output}"

from snakecharm.

flying-sheep avatar flying-sheep commented on May 29, 2024

Also input/output:

rule NAME:
    input:
        "path/to/inputfile"
    output:
        "path/to/outputfile"
    run:
        some_func(input[0], output[0])

input is resolved as the builtin input() function, output not at all.

/edit: idk how it works, but you could basically invisibly prepend the following to each rule body:

input: snakemake.io.InputFiles
output: snakemake.io.OutputFiles

from snakecharm.

iromeo avatar iromeo commented on May 29, 2024

@flying-sheep also params, threads, wildcards objects

from snakecharm.

flying-sheep avatar flying-sheep commented on May 29, 2024

True. wildcards is a snakemake.io.Wildcards, threads is an int I supposed, and params?

from snakecharm.

iromeo avatar iromeo commented on May 29, 2024

@flying-sheep I think for wildcards, params we need to hardcode resolve/autocompletion to rule wildcard strings or params section named args. The true runtime type here isn't very significant.

from snakecharm.

iromeo avatar iromeo commented on May 29, 2024

Done
image

from snakecharm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.