Giter Club home page Giter Club logo

snakemake-lang-vscode-plugin's Introduction

Gitpod Ready-to-Code GitHub Workflow Status (with event) Sonarcloud Status Conda Version Bioconda Pypi docker container status Stack Overflow Twitter Mastodon Follow Discord Github stars Contributor Covenant

Snakemake

The Snakemake workflow management system is a tool to create reproducible and scalable data analyses. Snakemake is highly popular, with on average more than 7 new citations per week in 2021, and almost 400k downloads. Workflows are described via a human readable, Python based language. They can be seamlessly scaled to server, cluster, grid and cloud environments without the need to modify the workflow definition. Finally, Snakemake workflows can entail a description of required software, which will be automatically deployed to any execution environment.

Homepage: https://snakemake.github.io

Copyright (c) 2012-2022 Johannes Köster [email protected] (see LICENSE)

snakemake-lang-vscode-plugin's People

Contributors

alping avatar bilke avatar calebthomas259 avatar corneliusroemer avatar ftabaro avatar github-actions[bot] avatar johanneskoester avatar lustigeperson avatar mbhall88 avatar tttpob avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

snakemake-lang-vscode-plugin's Issues

Choose Python interpreter per file based on conda directive

It would be great if this plugin could infer script-env dependencies from the rule files and set the Python interpreter for each Python script file accordingly. Otherwise, as it is now, Python interpreters do not match the chosen env in Snakemake.

Not sure if this is technically possible or in-scope of this plug-in. Just saying that such a feature would be great.

Make type checker aware of `snakemake` global in script files

Don't know how easy this is to do with an extension, but an annoyance of writing workflows in VS Code is the implicitly defined snakemake global variable. The type checker is not aware of this and will generate an "undefined variable" warning for each usage.

I'm using the following workaround for this:

from typing import TYPE_CHECKING

if TYPE_CHECKING:
    from snakemake.script import Snakemake
    snakemake: Snakemake
    snakemake = None  # type: ignore

But it would be really great if this could be automatically applied somehow.

String highlighting as comment

Strings are highlighted as comments, especially when used as commands

rule hostname:
    output: 
        "out/{id}.txt"
    threads:
        1
    resources:
        tmpdir=".tmp"
    conda:
        'base'
    shell:
        '''
        sleep 2;echo `hostname` > {output}
        echo fdf >> {resources.tmpdir}/fdf
        
        '''

The strings in the shell, output, and conda parts are all recognized as comments and highlighted in green

Snakefile not recognized

Hi,

I have found, that snakemake plugin does not recognize Snakefile as smakemake file. Everything is ok for .smk files, but most content of Snakefile is underlined with red. How can I fix it?

I am using Smakemake Language v0.1.6.

Thanks,
Paweł

Missing keywords from syntax highlighter and wrongly highlighted built-in functions

A lot of snakemake keywords are not highlighted.
Especially rule params like mentioned in issue #23, #18 and #14.
The following rule params are not highlighted:

  • shellcmd
  • name
  • norun
  • conda_env
  • container_img
  • is_containerized
  • env_modules
  • shadow_depth
  • docstring
  • notebook
  • template_engine
  • cache
  • path_modifier
  • handover
  • default_target
  • localrule

Besides this, also no PEP keywords are highlighted #22 and, to my knowledge, also the kewords:

  • envvars
  • module

It would be nice to have a script which collects all keywords.
This is maybe possible from the parser.py file.
For the rule params the ruleinfo.py scripyt would be also possible.

As explained issue #15 built-in functions like expand are not highlighted properly.
This can be fixed by integrating the snakemake rules in the MagicPython grammar.
In my fork of this repo, I could implement this by copying and modifying the whole MagicPython grammar.
Unfortunately, I did not find a way to just use the include rule key to load the MagicPython grammar and overwrite the rules that I wanted to include the sankemake rules in.

Publishing PAT has expired

PAT for publishing the extension to visual studio market has expired:

Error: Error: {"$id":"1","customProperties":{"Descriptor":null,"IdentityDisplayName":null,"Token":null,"RequestedPermissions":0,"NamespaceId":"00000000-0000-0000-0000-000000000000"},"innerException":null,"message":"Access Denied: The Personal Access Token used has expired.","typeName":"Microsoft.VisualStudio.Services.Security.AccessCheckException, Microsoft.VisualStudio.Services.WebApi","typeKey":"AccessCheckException","errorCode":0,"eventId":3000}

Highlight syntax in shell blocks as bash

Currently shell blocks are treated as strings. Would be nice if they could have syntax highlighting for shell scripts instead. Bash is probably the most common.

rule:
	shell:
       """
       what="world"
       echo "Hello ${what}"
       """

rule:
    run: shell("echo Hello world")

Build targets in sidebar

It would be nice to have a panel in the sidebar that lists all the targets in the Snakefile so you can quickly run a target, perhaps including a [Force run] button, and an option to quickly jump to the definition.

A plain text mockup:

  • all [> [!> [\
  • download_data [> [!> [\
  • preprocess_data [> [!> [\

using the following definitions for the symbold:

  • [> Run selected rule, call snakemake {rule}
  • [!> Force run selected rule, call `snakemake --force {rule}
  • [\ Edit rule definition, open file and go to line

Some things that need to be considered:

  • visualise modular rules
  • handle multiple open folders in the current workspace
  • select profile to use (per open folder)
  • how and when to update the list of rules as building the list can be slow
  • visualise running rules, can we allow starting multiple rules in parallel?

Finally, I don't have any experience building VS Code plugins, but I figure it should be possible.

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.