nextflow-io / nextflow-io/nf-schema

Feature request: `samplesheetToMaps` function

Open
#186 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

feature request
Dominant language
Groovy
Stars
57
Forks
31
Avg merge
3d 17h
Merged PRs (30d)
1

Description

Sometimes, it would be useful to parse a samplesheet and return a key-val pair instead of a list of tuples as is returned by samplesheetToList. We could add a samplesheetToMaps function which returns a list of key-val pairs.

name,language,greeting
adam,english,hello
geraldine,french,bonjour
samplesheetToList('greetings.csv')
[
    [ 'adam', 'english', 'hello' ],
    [ 'geraldine', 'french', 'bonjour' ]
]
samplesheetToMap('greetings.csv')
[
    [ name: 'adam', language: 'english', greeting: 'hello' ],
    [ name: 'geraldine', language: 'french', greeting: 'bonjour']
]

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the existing samplesheetToList function and reading how it parses the CSV examples shown in the issue. Add the requested map-returning counterpart, resolve the samplesheetToMap versus samplesheetToMaps naming, and verify that each row uses the header names as keys.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy
Domain
data
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.