James A. Fellows Yates
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    --- title: nf-core/funcscan tutorial tags: nf-core,documenation,funcscan,pipeline --- # nf-core/funcscan tutorial In this tutorial, we will guide you through how to set up a run for nf-core/funcscan almost from scratch! It will show you how to install nextflow, how to turn on and off different screening categories, and particular tools within each category. We will simulate having performed _de novo_ assembly of two metagenomes, and wish to screen for antimicrobial resistance genes (ARG) and antimicrobial peptides (AMP). ## Prerequisites For this tutorial you will need basic command line experience. You will also need at a minimum the following software installed: - A Unix operating system (Linux, OSX etc.) - [conda](https://docs.conda.io/en/latest/miniconda.html) (or [mamba](https://github.com/conda-forge/miniforge#mambaforge)) - With channels correctly configured ```bash conda config --add channels defaults conda config --add channels bioconda conda config --add channels conda-forge ``` Please see the documentation of the respective tools as necessary. ## Software and Databases First we will make a directory that we will run our test in, and change into it. ```bash mkdir funcscan-run cd funcscan-run/ ``` As nf-core/funcscan uses Nextflow to run the pipeline, we will install Nextflow using conda in a separate software environment called `nf-core` ```bash mamba create -n nf-core -c bioconda nextflow nf-core ``` > ℹ️ Replace `mamba` with `conda` if you did not install `mamba`. Once this environment is installed, we can activate it ```bash conda activate nf-core ``` You can check this has successfully installed Nextflow by running ```bash nextflow -version ``` This should print the version of Nextflow, and then deactivate the environment with ```bash conda deactivate ``` ## Make samplesheet Next we will download some example metagenome assemblies, and prepare our input samplesheet. First we will make a directory called `samples/`, and download two FASTA files into it. ```bash mkdir samples/ cd samples/ ## The resulting FASTA files will total ~11MB curl https://www.ebi.ac.uk/metagenomics/api/v1/analyses/MGYA00575326/file/ERZ1664520_FASTA.fasta.gz -o sample1.fasta.gz curl https://www.ebi.ac.uk/metagenomics/api/v1/analyses/MGYA00575327/file/ERZ1664518_FASTA.fasta.gz -o sample2.fasta.gz cd ../ ``` Now we can use some simple bash commands to programmatically create the make a input CSV samplesheet. ```bash ## Get the full paths for each file ls -1 samples/* > paths.txt ## Construct a sample name based on the filename sed 's#samples/##g;s#.fasta.gz##g' paths.txt > samplenames.txt ## Create the samplesheet, adding a header and then adding the samplenames and paths echo 'sample,fasta' > samplesheet.csv paste -d "," samplenames.txt paths.txt >> samplesheet.csv ``` The contents of the resulting `samplesheet.csv` should look like: ``` sample,fasta sample1,samples/sample1.fasta.gz sample2,samples/sample2.fasta.gz ``` > ⚠️ The `sed` command may not work on OSX, due to differences in `sed` builds between Linux (here) and OSX! Check the before running! ## Pipeline execution preparation Now we can run funcscan! As in some cases pipelines can take a long time, a good practise is to utilise `screen` sessions, that allow you to run your pipeline in the background, and give you your terminal back to do other things while waiting. To create a screen session we can run ```bash screen -R funcscan-run ``` Next we load our software environment containing Nextflow ```bash conda activate nf-core ``` And then download the pipeline code ```bash nextflow pull nf-core/funcscan ``` ## Pipeline exectuion Now we can construct our pipeline run command! > ⚠️ Important: do not execute the command until the tutorial says! First we specify the pipeline name and the version we want to run. ```bash nextflow run nf-core/funcscan -r 1.0.0 \ ``` Then we specify which software environment system to use. In this case we will use `conda` sa we have already got this on our machine for the purposes of this tutorial. ```bash nextflow run nf-core/funcscan -r 1.0.0 \ -profile conda \ ``` Next we need to specify our input samplesheet we constructed and where we want to specify our results directory to go. ```bash nextflow run nf-core/funcscan -r 1.0.0 \ -profile conda \ --input 'samplesheet.csv' \ --outdir './results' \ ``` To specify which categories of biomolcules you wish to screen for, we turn on the respective workflows. In this case, we _dont_ want to screen for biosynthetic gene clusters (BGCs), but we _do_ want to turn on screening for ARGs and AMPs. We do this by specifying the following `--run_*_screening` flags. ```bash nextflow run nf-core/funcscan -r 1.0.0 \ -profile conda \ --input 'samplesheet.csv' \ --outdir './results' \ --run_amp_screening \ --run_arg_screening \ ``` Once we have done this, we can customise a little which tools we want to run for each screening category. For example, we want to skip the [HMMsearch](http://hmmer.org/) modules and [AMPlify](https://github.com/bcgsc/AMPlify) for AMPs, [deepARG](https://bitbucket.org/gusphdproj/deeparg-ss/src/master/deeparg/) and [RGI](https://github.com/arpcard/rgi) for ARGs. We do this with `--*_skip_<tool>` flags. Otherwise all other tools in the two screening categories will be used. ```bash nextflow run nf-core/funcscan -r 1.0.0 \ -profile conda \ --input 'samplesheet.csv' \ --outdir './results' \ --run_amp_screening \ --run_arg_screening \ --amp_skip_hmmsearch \ --amp_skip_amplify \ --arg_skip_deeparg \ --arg_skip_rgi ``` Now hit enter to run the command 🚀! You should now get progress bars indicating what steps of the pipeline are being executed. The pipeline will install the software via conda, download any required databasee, and run the contigs listed in the samplesheet against each tool! If the pipeline is taking a long time (it will take about 37 minutes on a laptop), you can detach from your screen session by pressing `ctrl + a` on your keyboard and the `d` to `detach`. This should return you to your prompt. This should take you back to your normal terminal. To re-attach to the screen session, you can type ```bash screen -r funcscan-run ``` to see the pipeline progress information. However hopefully, if completed, you should now see a `Pipeline completed successfully!` message. ## Results <!-- TODO: ~/Downloads/funcscan-run - dir is 1.6G --> ## Clean Up Once you've explored the results and wish to finish the tutorial you can deactivate the conda environment with: ```bash conda deactivate ``` You can then exit the screen session by typing: ```bash exit ``` And delete the directory we ran the pipeline > ⚠️ If you wish to retain any downloaded databases to re-use them in future pipeline runs, make sure to move these to another location _before_ running the next command! ```bash rm -r /<path>/<to>/funcscan-run/ ``` > ℹ️ Optional: if you wish to also wish to delete the conda environmens we made, run `conda env list` and identify the two environments (`amrfinderplus` and `nf-core`) and delete the listed directories. And you should be done! ``` [[id: sample1, anon: prokka] [/path/to/one.fa, /path/to/two.fa, /path/to/a_dir/, /path/to/a_dir2/]] ```

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully