Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add snakemake wrapper #40

Open
KristinaGagalova opened this issue Feb 18, 2022 · 5 comments
Open

Add snakemake wrapper #40

KristinaGagalova opened this issue Feb 18, 2022 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@KristinaGagalova
Copy link

Hi Lauren,

Given the growing community of snakemake and also its broad application I suggest adding longstitch to a wrapper so it's easier to run it in a snakefile. So far it's a bit awkward.

Some more details here: https://snakemake.readthedocs.io/en/latest/snakefiles/modularization.html?highlight=wrapper

Cheers
Kristina

@KristinaGagalova KristinaGagalova added the enhancement New feature or request label Feb 18, 2022
@lcoombe
Copy link
Member

lcoombe commented Feb 18, 2022

Hi Kristina,

Sure, I'm happy to look into that! Just so I know (I'm less familiar with snakefiles), could you explain what's awkward right now about calling the longstitch makefile itself within a rule in a snakefile?

Thanks!
Lauren

@lcoombe lcoombe self-assigned this Feb 18, 2022
@KristinaGagalova
Copy link
Author

Its mostly the fact of running longstitch from the current directory (create symlinks and move the output to another directory). I am processing multiple samples with snakemake and I am trying to keep all the sample files under separate dir.

@lcoombe
Copy link
Member

lcoombe commented Feb 18, 2022

Just documenting our Slack conversation here!

For running LongStitch in a given directory, -C dir option of makefiles is useful. I'm going to look into adding another rule to the LongStitch make_links or similar that can take in the paths to the input files, and create soft-links in the working directory (or directory specified by -C)

@KristinaGagalova
Copy link
Author

KristinaGagalova commented Feb 23, 2022

This finally worked out

rules my_rule:
....
shell:
    """
    mkdir -p out_dir/{wildcards.sample} && \
    longstitch make_links -C {params.cur_dir}/out_dir/{wildcards.sample} reads_path={params.cur_dir}/{input.fastq} 
    draft_path={params.cur_dir}/{input.assembly} && \
    longstitch run -C {params.cur_dir}/out_dir/{wildcards.sample} out_prefix={wildcards.sample} draft={wildcards.sample} reads 
    {wildcards.sample}
    """
  • Anything after -C needs to be always full path
  • longstitch make_links requires full path for reads_path and draft_path
  • longstitch run doesn't require a full path for reads and draft

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your interest in LongStitch!

@github-actions github-actions bot added the Stale label Mar 26, 2022
@lcoombe lcoombe removed the Stale label Mar 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants