Skip to content

Commit

Permalink
Updated samplesheet to include 'address' column
Browse files Browse the repository at this point in the history
  • Loading branch information
kylacochrane committed May 6, 2024
1 parent f249833 commit 1e554dd
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 27 deletions.
9 changes: 5 additions & 4 deletions assets/samplesheet.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
sample,fastq_1,fastq_2
SAMPLE1,https://raw.githubusercontent.com/nf-core/test-datasets/viralrecon/illumina/amplicon/sample1_R1.fastq.gz,https://raw.githubusercontent.com/nf-core/test-datasets/viralrecon/illumina/amplicon/sample1_R2.fastq.gz
SAMPLE2,https://raw.githubusercontent.com/nf-core/test-datasets/viralrecon/illumina/amplicon/sample2_R1.fastq.gz,https://raw.githubusercontent.com/nf-core/test-datasets/viralrecon/illumina/amplicon/sample2_R2.fastq.gz
SAMPLE3,https://raw.githubusercontent.com/nf-core/test-datasets/viralrecon/illumina/amplicon/sample1_R1.fastq.gz,
sample,mlst_alleles,address
sampleQ,https://raw.githubusercontent.com/phac-nml/gasnomenclature/dev/tests/data/reports/sampleQ.mlst.json,
sample1,https://raw.githubusercontent.com/phac-nml/gasnomenclature/dev/tests/data/reports/sample1.mlst.json,1.1.1
sample2,https://raw.githubusercontent.com/phac-nml/gasnomenclature/dev/tests/data/reports/sample2.mlst.json,1.1.1
sample3,https://raw.githubusercontent.com/phac-nml/gasnomenclature/dev/tests/data/reports/sample3.mlst.json,1.1.2
15 changes: 8 additions & 7 deletions assets/schema_input.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,20 @@
"unique": true,
"errorMessage": "Sample name must be provided and cannot contain spaces"
},
"profile_type": {
"meta": ["profile_type"],
"description": "Determines has already been clustered (True) or if it is new, and requiring nomenclature assignment (False)",
"errorMessage": "Please specify if the mlst profile has already been clustered (True) or if it is new and requires nomenclature assignment (False)",
"type": "boolean"
},
"mlst_alleles": {
"type": "string",
"format": "file-path",
"pattern": "^\\S+\\.mlst\\.json(\\.gz)?$",
"errorMessage": "MLST JSON file from locidex report, cannot contain spaces and must have the extension: '.mlst.json' or '.mlst.json.gz'"
},
"address": {
"type": "string",
"pattern": "^\\d+(\\.\\d+)*$",
"meta": ["address"],
"description": "The loci-based typing identifier (address) of the sample",
"error_message": "Invalid loci-based typing identifier. Please ensure that the address follows the correct format, consisting of one or more digits separated by periods. Example of a valid identifier: '1.1.1'. Please review and correct the entry"
}
},
"required": ["sample", "profile_type", "mlst_alleles"]
"required": ["sample", "mlst_alleles"]
}
}
2 changes: 1 addition & 1 deletion conf/test.config
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ params {
max_time = '1.h'

// Input data
input = 'https://raw.githubusercontent.com/phac-nml/gasnomenclature/dev/tests/data/samplesheets/samplesheet1.csv'
input = "${projectDir}/tests/data/samplesheets/samplesheet1.csv"
ref_clusters = 'https://raw.githubusercontent.com/phac-nml/gasnomenclature/dev/tests/data/clusters/expected_clusters.txt'
}

Expand Down
10 changes: 5 additions & 5 deletions tests/data/samplesheets/samplesheet1.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sample,profile_type,mlst_alleles
sampleQ,false,https://raw.githubusercontent.com/phac-nml/gasnomenclature/dev/tests/data/reports/sampleQ.mlst.json
sample1,true,https://raw.githubusercontent.com/phac-nml/gasnomenclature/dev/tests/data/reports/sample1.mlst.json
sample2,true,https://raw.githubusercontent.com/phac-nml/gasnomenclature/dev/tests/data/reports/sample2.mlst.json
sample3,true,https://raw.githubusercontent.com/phac-nml/gasnomenclature/dev/tests/data/reports/sample3.mlst.json
sample,mlst_alleles,address
sampleQ,https://raw.githubusercontent.com/phac-nml/gasnomenclature/dev/tests/data/reports/sampleQ.mlst.json,
sample1,https://raw.githubusercontent.com/phac-nml/gasnomenclature/dev/tests/data/reports/sample1.mlst.json,1.1.1
sample2,https://raw.githubusercontent.com/phac-nml/gasnomenclature/dev/tests/data/reports/sample2.mlst.json,1.1.1
sample3,https://raw.githubusercontent.com/phac-nml/gasnomenclature/dev/tests/data/reports/sample3.mlst.json,1.1.2
16 changes: 6 additions & 10 deletions workflows/gas_nomenclature.nf
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ include { paramsSummaryLog; paramsSummaryMap; fromSamplesheet } from 'plugin/nf
// SUBWORKFLOW: Consisting of a mix of local and nf-core/modules
//

include { GENERATE_SAMPLE_JSON } from '../modules/local/generatesamplejson/main'
include { SIMPLIFY_IRIDA_JSON } from '../modules/local/simplifyiridajson/main'
include { IRIDA_NEXT_OUTPUT } from '../modules/local/iridanextoutput/main'
include { GENERATE_SUMMARY } from '../modules/local/generatesummary/main'
include { LOCIDEX_MERGE as LOCIDEX_MERGE_REF } from "../modules/local/locidex/merge/main"
include { LOCIDEX_MERGE as LOCIDEX_MERGE_QUERY } from "../modules/local/locidex/merge/main"
include { PROFILE_DISTS } from "../modules/local/profile_dists/main"
include { GAS_CALL } from "../modules/local/gas/call/main"

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -37,10 +37,6 @@ include { GENERATE_SUMMARY } from '../modules/local/generatesummary/main'
// MODULE: Installed directly from nf-core/modules
//
include { CUSTOM_DUMPSOFTWAREVERSIONS } from '../modules/nf-core/custom/dumpsoftwareversions/main'
include { LOCIDEX_MERGE as LOCIDEX_MERGE_REF } from "../modules/local/locidex/merge/main"
include { LOCIDEX_MERGE as LOCIDEX_MERGE_QUERY } from "../modules/local/locidex/merge/main"
include { GAS_CALL } from "../modules/local/gas/call/main"
include { PROFILE_DISTS } from "../modules/local/profile_dists/main"

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -73,8 +69,8 @@ workflow GAS_NOMENCLATURE {
// NB: `input` corresponds to `params.input` and associated sample sheet schema
input = Channel.fromSamplesheet("input");
profiles = input.branch{
ref: it[0].profile_type
query: !it[0].profile_type
ref: it[0].address
query: !it[0].address
errors: true // To discuss, add in check on file for erroneous values, may not be needed as nf-validation is working
}

Expand Down

0 comments on commit 1e554dd

Please sign in to comment.