Skip to content

Add bandage#150

Merged
ODiogoSilva merged 1 commit intoassemblerflow:devfrom
sjackman:bandage
Oct 14, 2018
Merged

Add bandage#150
ODiogoSilva merged 1 commit intoassemblerflow:devfrom
sjackman:bandage

Conversation

@sjackman
Copy link
Contributor

No description provided.

@codecov-io
Copy link

codecov-io commented Oct 14, 2018

Codecov Report

Merging #150 into dev will increase coverage by 0.07%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #150      +/-   ##
==========================================
+ Coverage   39.05%   39.12%   +0.07%     
==========================================
  Files          59       59              
  Lines        5654     5661       +7     
==========================================
+ Hits         2208     2215       +7     
  Misses       3446     3446
Impacted Files Coverage Δ
flowcraft/generator/engine.py 91.33% <ø> (ø) ⬆️
...wcraft/generator/components/assembly_processing.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 30f5a45...f84f160. Read the comment docs.

@sjackman
Copy link
Contributor Author

This component works as is, but Bandage loads the FASTA file, whereas I would like to load the GFA file output by SPAdes. Any tips on how I can load the GFA file instead of the FASTA file?

@ODiogoSilva
Copy link
Collaborator

Yes @sjackman , this is a recurrent situation for us and something that you can solve using secondary links. The basic idea is that you can connect two components with any number of secondary channels that pass additional information besides the main channels. I'll walk you through briefly:

  1. On the spades nextflow template, where you define the output channel for the gfa file, assign it to a channel:
file "*.gfa" optional true into assemblyGfa_{{ pid }}
  1. On the spades python class, add the information that you have a secondary channel source, using the self.link_start attribute, and provide the name of the channel:
# Notice that we exclude _{{ pid }} here
self.link_start.extend(["assemblyGfa"])
  1. On the bandage python class, add the information that you wish to receive a secondary channel with that name, using the link_end attribute:
self.link_end.append({
    "link": "assemblyGfa",
    "alias": "assemblyGfa"
})
  1. Finally on the bandage nextflow template, you can receive the assemblyGfa channel in the input declaration:
        input:
        set sample_id, file(assembly_gfa) from {{input_channel}}
        file (assembly_gfa) from assemblyGfa_{{ pid }}

And you should have access to the Gfa file as well. With this system you can easily pass data between components, even if those components are not contiguous. For instance, if you created a pipeline like:

spades pilon bandage

the bandage component would still receive the GFA from spades!

@sjackman
Copy link
Contributor Author

Awesome. Thank you very much for the detailed instructions, Diogo. I'd like to first merge this PR, if you would, without support for GFA. I'll submit a new PR next week to add support for GFA.

@sjackman
Copy link
Contributor Author

Our Hackseq hackathon is wrapping up in one hour! Thank you all for being so responsive this weekend! It's been great getting these PRs merged while we hacked. I hadn't expected that.

Copy link
Collaborator

@ODiogoSilva ODiogoSilva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another fine addition good to go 👍 Great job at the hackathon, I'm glad we could integrate your efforts quickly into flowcraft. These only one minor coment.

file reference from Channel.fromPath(params.reference{{param_id}})

output:
file "*"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you be more specific here on the regex pattern? This will also include dot file (.command.*) from nextflow in the publishDir.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed it to "*.png *.svg".

@ODiogoSilva ODiogoSilva merged commit e984aee into assemblerflow:dev Oct 14, 2018
@sjackman sjackman deleted the bandage branch October 14, 2018 23:59
@sjackman
Copy link
Contributor Author

Thanks for merging, Diogo!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants