<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Luca Cozzuto</title>
    <description>The latest articles on Forem by Luca Cozzuto (@lucacozzuto).</description>
    <link>https://forem.com/lucacozzuto</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2558437%2Fc588949d-a262-435e-9004-3e3e5393a61f.jpeg</url>
      <title>Forem: Luca Cozzuto</title>
      <link>https://forem.com/lucacozzuto</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/lucacozzuto"/>
    <language>en</language>
    <item>
      <title>Adding nf-core modules to your Nextflow pipeline</title>
      <dc:creator>Luca Cozzuto</dc:creator>
      <pubDate>Tue, 13 May 2025 12:45:52 +0000</pubDate>
      <link>https://forem.com/lucacozzuto/adding-nf-core-modules-to-your-nextflow-pipeline-574c</link>
      <guid>https://forem.com/lucacozzuto/adding-nf-core-modules-to-your-nextflow-pipeline-574c</guid>
      <description>&lt;p&gt;NF-Core is not only a collection of state-of-the-art pipelines. They also offer plenty of modules that can be easily included in your workflows. This is a very quick guide on how to do it. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install nf-core tools and pre-commit&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;pip install nf-core &lt;br&gt;
pip install pre-commit&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Initialize pre-commit by writing a .pre-commit-config.yaml file.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v4.5.0
    hooks:
      - id: trailing-whitespace
      - id: end-of-file-fixer
      - id: check-yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then do a pre-commit install&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pre-commit install 

pre-commit installed at .git/hooks/pre-commit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and pre-commit run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pre-commit run --all-files

trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...............................................................Passed
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Add to your nextflow config a &lt;strong&gt;manifest&lt;/strong&gt; section together with &lt;strong&gt;env&lt;/strong&gt; and &lt;strong&gt;profiles&lt;/strong&gt;.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;manifest {
    name = 'GATK_WGS_preprocessing'
    author = 'Luca Cozzuto'
    description = 'A description of your pipeline'
    version = 2.0
}

env {
  R_PROFILE_USER = "/.Rprofile"
  R_ENVIRON_USER = "/.Renviron"
  PYTHONNOUSERSITE = 1
}

profiles {
    myprofile {
       includeConfig 'conf/myprofile.config'
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Search for a module
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nf-core modules list remote
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Install a module
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nf-core modules install fastqc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Indicate that you are installing within a pipeline&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nf-core modules install fastqc


                                          ,--./,-.
          ___     __   __   __   ___     /,-._.--~\ 
    |\ | |__  __ /  ` /  \ |__) |__         }  {
    | \| |       \__, \__/ |  \ |___     \`-._,-`-,
                                          `._,._,'

    nf-core/tools version 3.2.0 - https://nf-co.re


WARNING  'repository_type' not defined in .nf-core.yml                                                                                                       
? Is this repository a pipeline or a modules repository? Pipeline
INFO     To avoid this prompt in the future, add the 'repository_type' key to your .nf-core.yml file.                                                        
? Would you like me to add this config now? [y/n] (y): y
INFO     Config added to '.nf-core.yml'                                                                                                                      
INFO     The 'modules.json' file is not up to date. Recreating the 'modules.json' file.                                                                      
? Can't find a ./modules directory. Would you like me to create one? [y/n] (y): y
INFO     Creating ./modules directory in '.'                                                                                                                 
INFO     Installing 'fastqc'                                                                                                                                 
INFO     Use the following statement to include this module:                                                                                                 

 include { FASTQC } from '../modules/nf-core/fastqc/main'   
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Let's read the docs of the module. Go to &lt;a href="https://nf-co.re/modules/fastqc/" rel="noopener noreferrer"&gt;https://nf-co.re/modules/fastqc/&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The input is groovy map with both meta information and files. So I made it in this way:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;include { FASTQC } from "${projectDir}/modules/nf-core/fastqc"

if (params.single == "NO") {
    Channel
     .fromFilePairs( params.reads, checkIfExists: true )  // size: 2 is used by default                                           
     .map {[ [id: it[0], single_end:false],  it[1] ] }
     .set { reads }              
} else {
    Channel
     .fromFilePairs( params.reads, size: 1, checkIfExists: true)
     .map {[ [id: it[0], single_end:true],  it[1] ] }
     .set { reads }  
}

workflow {
    FASTQC(reads)   
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;In the main.nf code of fastqc, the label indicated is &lt;code&gt;process_medium&lt;/code&gt;, so let's define it in our nextflow config file (myprofile.config):
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;process {
    withLabel: process_medium {
        cpus = 2
        memory='12G'
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Let's now add the tool version and connect it to multiqc
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nf-core modules install multiqc 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and add it to the include&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;include { MULTIQC       } from "${projectDir}/subworkflows/nf-core/fastqc"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As we can see the output of fastqc module consists of 3 channels: html, zip and versions. The first two are groovy maps with meta information and files while the latter is just a file. We can plug the html and version to multiqc in this way:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;workflow {    
    fqc = FASTQC(reads)
    ch_versions = fqc.versions
    multiqc_data = fqc.zip.map{ meta, zip -&amp;gt; return zip } )
    MULTIQC(multiqc_data.collect(), [], [], [], [], [])
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The last input of MULTIQC can be left as an empty map, so they are skipped.&lt;/p&gt;

&lt;p&gt;Now we miss the version file for being uploaded to &lt;strong&gt;multiqc&lt;/strong&gt;. We need to install &lt;strong&gt;utils_nfcore_pipeline&lt;/strong&gt; for using the function &lt;strong&gt;softwareVersionsToYAML&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nf-core subworkflows install utils_nfcore_pipeline
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;let's include it&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; include { softwareVersionsToYAML } from '${projectDir}/subworkflows/nf-core/utils_nfcore_pipeline/'                                                                 

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and then&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
workflow {    
    fqc = FASTQC(reads)
    ch_versions = fqc.versions
    multiqc_data = fqc.zip.map{ meta, zip -&amp;gt; return zip } )

    // STORE VERSIONS OF TOOLS
    softwareVersionsToYAML(ch_versions)
        .collectFile(
            storeDir: "${params.output}/pipeline_info",
            name: 'nf_core_'  + 'pipeline_software_' +  'mqc_'  + 'versions.yml',
            sort: true,
            newLine: true
         ).set { ch_collated_versions }

    multiqc_data = multiqc_data.mix(ch_collated_versions)

    MULTIQC(multiqc_data.collect(), [], [], [], [], [])
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>How to use GitHub to be verified on Bluesky</title>
      <dc:creator>Luca Cozzuto</dc:creator>
      <pubDate>Wed, 11 Dec 2024 16:07:44 +0000</pubDate>
      <link>https://forem.com/lucacozzuto/how-to-use-github-to-be-verified-on-bluesky-k3p</link>
      <guid>https://forem.com/lucacozzuto/how-to-use-github-to-be-verified-on-bluesky-k3p</guid>
      <description>&lt;h2&gt;
  
  
  How to use GitHub to be verified on Bluesky
&lt;/h2&gt;

&lt;p&gt;Like many scientists, I joined &lt;a href="https://bsky.app/" rel="noopener noreferrer"&gt;Buesky&lt;/a&gt; since X (former Twitter) is becoming a horrible place. Here you don’t need to pay the platform to be verified, you can use just your website as a handle (&lt;a href="https://bsky.social/about/blog/4-28-2023-domain-handle-tutorial" rel="noopener noreferrer"&gt;see here&lt;/a&gt;). But what if you don’t own a domain? If you are a developer and use &lt;a href="https://github.com/" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; you can still use your personal GitHub page as a handle.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwlytlf3caeqfrfog839l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwlytlf3caeqfrfog839l.png" width="652" height="342"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;How to do this? First of all, you need to set up your own GitHub page by creating a repository with the following structure:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://github.com/USERNAME/USERNAME.github.io
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;I added some information about me in the &lt;a href="https://github.com/lucacozzuto/lucacozzuto.github.io" rel="noopener noreferrer"&gt;README.md&lt;/a&gt; page but you can make a whole website. Then you need to activate the GitHub page by going to “&lt;strong&gt;settings&lt;/strong&gt;” -&amp;gt; “&lt;strong&gt;Pages&lt;/strong&gt;”. Your page will be deployed and available at this address.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://USERNAME.github.io/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Here is &lt;a href="https://lucacozzuto.github.io/" rel="noopener noreferrer"&gt;mine&lt;/a&gt; as an example.&lt;/p&gt;

&lt;p&gt;Now we need to link this website to your Bluesky account. Go to &lt;a href="https://bsky.app/settings" rel="noopener noreferrer"&gt;https://bsky.app/settings&lt;/a&gt; and go to “&lt;strong&gt;Account&lt;/strong&gt;” -&amp;gt; “&lt;strong&gt;Handle&lt;/strong&gt;”. Click on “&lt;strong&gt;I have my own domain&lt;/strong&gt;” -&amp;gt; “&lt;strong&gt;No DNS Panel”&lt;/strong&gt;. In “&lt;strong&gt;Enter the domain you want to use&lt;/strong&gt;” add the handle you want (USERNAME.github.io). At this point, Bluesky generates a string of code in the field named “&lt;strong&gt;That contains the following&lt;/strong&gt;:”. You need to create a file named as indicated in the field “&lt;strong&gt;Upload a text file to:&lt;/strong&gt;” containing just this string of text.&lt;/p&gt;

&lt;p&gt;The file needed to be uploaded to the website in the direction indicated:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://USERNAME.github.io/.well-known/atproto-did
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;You can do this directly on the GitHub website. You also need to have this directory visible on the website, so you have to add a file named “_config.yml” to your repository with this content:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;include: [".well-known"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Finally, you can push on “include: [“.well-known”]” on Bluesky and enjoy your new “verified” handle.&lt;/p&gt;

</description>
      <category>bluesky</category>
      <category>github</category>
      <category>verified</category>
    </item>
  </channel>
</rss>
