Package: v2-samplesheet-maker
V2 SampleSheet MakerGenerate an Illumina SampleSheet CSV from JSON.Supported SectionsSections currently supported:HeaderReadsBCLConvert_SettingsBCLConvert_DataInstallationInstallation from pypipip install v2-samplesheet-makerAlternatively one may use the docker containerghcr.io/umccr/v2-samplesheet-maker:latestUsageUsage:
v2-samplesheet-maker <input-json> <output-csv>Use-forinput-jsonparameter to parse json from stdin,Use-foroutput-jsonparameter to parse output samplesheet csv to stdout.ExamplesSeeexamples/for more infoInput JSONClick to expand!{"header":{"file_format_version":2,"run_name":"my-illumina-sequencing-run","run_description":"A test run","instrument_platform":"NovaSeq 6000","instrument_type":"NovaSeq"},"reads":{"read_1_cycles":151,"read_2_cycles":151,"index_1_cycles":10,"index_2_cycles":10},"bclconvert_settings":{"adapter_behavior":"trim","adapter_read_1":null,"adapter_read_2":null,"adapter_stringency":null,"barcode_mismatches_index_1":1,"barcode_mismatches_index_2":1,"minimum_trimmed_read_length":null,"minimum_adapter_overlap":2,"mask_short_reads":null,"override_cycles":"Y151;Y10;Y8N2;Y151","trim_umi":null,"create_fastq_for_index_reads":false,"no_lane_splitting":false,"fastq_compression_format":"gzip","find_adapters_with_indels":null,"independent_index_collision_check":null},"bclconvert_data":[{"sample_id":"MyFirstSample","lane":1,"index":"AAAAAAAAAA","index2":"CCCCCCCC","sample_project":"SampleProject","sample_name":null},{"sample_id":"MySecondSample","lane":1,"index":"GGGGGGGGGG","index2":"TTTTTTTT","sample_project":"SampleProject","sample_name":null}]}Output CSVClick to expand![Header]FileFormatVersion,2RunName,my-illumina-sequencing-runRunDescription,A test runInstrumentPlatform,NovaSeq 6000InstrumentType,NovaSeq[Reads]Read1Cycles,151Read2Cycles,151Index1Cycles,10Index2Cycles,10[BCLConvert_Settings]AdapterBehavior,trimBarcodeMismatchesIndex1,1BarcodeMismatchesIndex2,1MinimumAdapterOverlap,2OverrideCycles,Y151;Y10;Y8N2;Y151CreateFastqForIndexReads,FalseNoLaneSplitting,FalseFastqCompressionFormat,gzip[BCLConvert_Data]Lane,Sample_ID,index,index2,Sample_Project1,MyFirstSample,AAAAAAAAAA,CCCCCCCC,SampleProject1,MySecondSample,GGGGGGGGGG,TTTTTTTT,SampleProjectTesting your outputsThe v2-samplesheet-maker will validate that your parameters are the correct type, the correct name AND within the appropriate range.
It will NOT however determine if your settings are appropriate or compatible with a BCLConvert run, i.e it will NOT
ensure that your indexes have an appropriate hamming distance.If you wish to validate your output samplesheet with BCLConvert, you can use the following script -scripts/build-samplesheet-and-validate-with-bcl-convert.sh <input-json> [docker-image]. This will convert the input json to csv and then run the
docker container bclconvert against your samplesheet.You will need both jq and docker installed for this to work.Additional UsageParsing a SampleSheet CSV to JSONWe also have created a parser between the csv and json, with the following usage syntaxInput SampleSheet CSVClick to expand![Header]FileFormatVersion,2RunName,my-illumina-sequencing-runRunDescription,A test runInstrumentPlatform,NovaSeq 6000InstrumentType,NovaSeq[Reads]Read1Cycles,151Read2Cycles,151Index1Cycles,10Index2Cycles,10[BCLConvert_Settings]AdapterBehavior,trimBarcodeMismatchesIndex1,1BarcodeMismatchesIndex2,1MinimumAdapterOverlap,2OverrideCycles,Y151;Y10;Y8N2;Y151CreateFastqForIndexReads,FalseNoLaneSplitting,FalseFastqCompressionFormat,gzip[BCLConvert_Data]Lane,Sample_ID,index,index2,Sample_Project1,MyFirstSample,AAAAAAAAAA,CCCCCCCC,SampleProject1,MySecondSample,GGGGGGGGGG,TTTTTTTT,SampleProject# Initialise new index variableNEW_I7_INDEX="TTTTTTTTTT"SAMPLE_ID="MySecondSample"# Convert the SampleSheet to JSON# Update the index for the sample "MySecondSample" in the bclconvert_data section# Write out the new samplesheet to csvv2-samplesheet-to-jsonSampleSheet.csv-|\jq--raw-output\--argsample_id"${SAMPLE_ID}"\--argreplacement_index"${NEW_I7_INDEX}"\'.bclconvert_data=(.bclconvert_data |map(if .sample_id == $sample_id then.index = $replacement_indexelse.end))'|\v2-samplesheet-maker-SampleSheet.updated_index.csvGives us the following samplesheet as an output[Header]
FileFormatVersion,2
RunName,my-illumina-sequencing-run
RunDescription,A test run
InstrumentPlatform,NovaSeq 6000
InstrumentType,NovaSeq

[Reads]
Read1Cycles,151
Read2Cycles,151
Index1Cycles,10
Index2Cycles,10

[BCLConvert_Settings]
AdapterBehavior,trim
BarcodeMismatchesIndex1,1
BarcodeMismatchesIndex2,1
MinimumAdapterOverlap,2
OverrideCycles,Y151;Y10;Y8N2;Y151
CreateFastqForIndexReads,False
NoLaneSplitting,False
FastqCompressionFormat,gzip

[BCLConvert_Data]
Lane,Sample_ID,index,index2,Sample_Project
1,MyFirstSample,AAAAAAAAAA,CCCCCCCC,SampleProject
1,MySecondSample,TTTTTTTTTT,TTTTTTTT,SampleProjectIf we run a diff on our original and updated samplesheet, we can see that the index for "MySecondSample" has been updated.diffSampleSheet.csvSampleSheet.updated_index.csvYields27c27
< 1,MySecondSample,GGGGGGGGGG,TTTTTTTT,SampleProject
---
> 1,MySecondSample,TTTTTTTTTT,TTTTTTTT,SampleProjectManipulating a samplesheet by parsing through JSONFor this component, you will need some basic knowledge of thejqcommand line tool.In this example we are given a standard samplesheet but want to edit the adapters for one of the samples.Whilst we could do this with grep, sed or awk, it's a little hacky, instead we canParse the samplesheet to json to stdoutUse jq to update the samplesheetWrite out the updated samplesheet to csvv2-samplesheet-to-jsonContributingIs there a missing section you'd like to see?You can generate your own sections byForking this repository.Adding the section pydantic model to thesection models moduleExtending the SampleSheel pydantic model in thesamplesheet models moduleGenerating a class for your section in thesection class moduleExtending the SampleSheet class to write out your section in thesamplesheet class moduleAdd a test for your section in thetest_sections moduleGenerating a PR back to this repository! ( Please squash your commits :) )Release CyclesWe try and update this repository for every new Dragen Release (which coincides with a BCLConvert release) and tag accordingly.