Skip to content

Commit

Permalink
Merge pull request #260 from broadinstitute/ct-guess-instrument-model
Browse files Browse the repository at this point in the history
guess instrument model in demux; pass to output
  • Loading branch information
dpark01 authored May 1, 2021
2 parents c1d835f + 4916e8e commit e1b71c2
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 14 deletions.
6 changes: 6 additions & 0 deletions pipes/WDL/tasks/tasks_demux.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,8 @@ task illumina_demux {
illumina.py guess_barcodes --expected_assigned_fraction=0 barcodes.txt metrics.txt barcodes_outliers.txt
illumina.py flowcell_metadata --inDir $FLOWCELL_DIR flowcellMetadataFile.tsv
mkdir -p unmatched
mv Unmatched.bam unmatched/
Expand Down Expand Up @@ -352,6 +354,10 @@ task illumina_demux {
Int max_ram_gb = ceil(read_float("MEM_BYTES")/1000000000)
Int runtime_sec = ceil(read_float("UPTIME_SEC"))
Int cpu_load_15min = ceil(read_float("LOAD_15M"))
String instrument_model = read_json("~{out_base}-runinfo.json")["sequencer_model"]
String flowcell_lane_count = read_json("~{out_base}-runinfo.json")["lane_count"]
String viralngs_version = read_string("VERSION")
Map[String,Map[String,String]] meta_by_sample = read_json('meta_by_sample.json')
Expand Down
7 changes: 5 additions & 2 deletions pipes/WDL/workflows/demux_deplete.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ workflow demux_deplete {
File? biosample_map
Int min_reads_per_bam = 100

String? instrument_model
String? instrument_model_user_specified
String? sra_title

File spikein_db
Expand Down Expand Up @@ -113,8 +113,9 @@ workflow demux_deplete {
library_metadata = samplesheet_rename_ids.new_sheet,
platform = "ILLUMINA",
paired = (illumina_demux.run_info[0]['indexes'] == '2'),

out_name = "sra_metadata-~{illumina_demux.run_info[0]['run_id']}.tsv",
instrument_model = select_first([instrument_model]),
instrument_model = select_first(flatten([[instrument_model_user_specified],[illumina_demux.run_info[0]['sequencer_model']]])),
title = select_first([sra_title])
}
}
Expand Down Expand Up @@ -161,6 +162,8 @@ workflow demux_deplete {
File multiqc_report_cleaned = multiqc_cleaned.multiqc_report
File spikein_counts = spike_summary.count_summary
String instrument_model_inferred = select_first(flatten([[instrument_model_user_specified],[illumina_demux.run_info[0]['sequencer_model']]]))
String run_date = illumina_demux.run_info[0]['run_start_date']
Map[String,String] run_info = illumina_demux.run_info[0]
File run_info_json = illumina_demux.run_info_json[0]
Expand Down
3 changes: 3 additions & 0 deletions pipes/WDL/workflows/demux_metag.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ workflow demux_metag {
Array[File]? bmtaggerDbs # .tar.gz, .tgz, .tar.bz2, .tar.lz4, .fasta, or .fasta.gz
Array[File]? blastDbs # .tar.gz, .tgz, .tar.bz2, .tar.lz4, .fasta, or .fasta.gz
Array[File]? bwaDbs
String? instrument_model_user_specified

File kraken2_db_tgz
File krona_taxonomy_db_kraken2_tgz
Expand Down Expand Up @@ -111,10 +112,12 @@ workflow demux_metag {
Array[Int] read_counts_depleted = deplete.depletion_read_count_post
Array[Int] read_counts_dedup = rmdup_ubam.dedup_read_count_post
Array[Int] read_counts_prespades_subsample = spades.subsample_read_count


File demux_metrics = illumina_demux.metrics
File demux_commonBarcodes = illumina_demux.commonBarcodes
File demux_outlierBarcodes = illumina_demux.outlierBarcodes
String instrument_model_inferred = select_first(flatten([[instrument_model_user_specified],[illumina_demux.run_info['sequencer_model']]]))

File multiqc_report_raw = multiqc_raw.multiqc_report
File multiqc_report_cleaned = multiqc_cleaned.multiqc_report
Expand Down
17 changes: 11 additions & 6 deletions pipes/WDL/workflows/demux_only.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ workflow demux_only {
email: "[email protected]"
}

input {
String? instrument_model_user_specified
}

call tasks_demux.illumina_demux

call reports.MultiQC {
Expand All @@ -18,11 +22,12 @@ workflow demux_only {
}

output {
Array[File] raw_reads_unaligned_bams = illumina_demux.raw_reads_unaligned_bams
File demux_metrics = illumina_demux.metrics
File demux_commonBarcodes = illumina_demux.commonBarcodes
File demux_outlierBarcodes = illumina_demux.outlierBarcodes
File multiqc_report_raw = MultiQC.multiqc_report
String demux_viral_core_version = illumina_demux.viralngs_version
Array[File] raw_reads_unaligned_bams = illumina_demux.raw_reads_unaligned_bams
File demux_metrics = illumina_demux.metrics
File demux_commonBarcodes = illumina_demux.commonBarcodes
File demux_outlierBarcodes = illumina_demux.outlierBarcodes
File multiqc_report_raw = MultiQC.multiqc_report
String instrument_model_inferred = select_first(flatten([[instrument_model_user_specified],[illumina_demux.run_info['sequencer_model']]]))
String demux_viral_core_version = illumina_demux.viralngs_version
}
}
2 changes: 2 additions & 0 deletions pipes/WDL/workflows/demux_plus.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ workflow demux_plus {
Array[File]? bmtaggerDbs # .tar.gz, .tgz, .tar.bz2, .tar.lz4, .fasta, or .fasta.gz
Array[File]? blastDbs # .tar.gz, .tgz, .tar.bz2, .tar.lz4, .fasta, or .fasta.gz
Array[File]? bwaDbs
String? instrument_model_user_specified
}

call demux.illumina_demux as illumina_demux
Expand Down Expand Up @@ -85,6 +86,7 @@ workflow demux_plus {
File demux_metrics = illumina_demux.metrics
File demux_commonBarcodes = illumina_demux.commonBarcodes
File demux_outlierBarcodes = illumina_demux.outlierBarcodes
String instrument_model_inferred = select_first(flatten([[instrument_model_user_specified],[illumina_demux.run_info['sequencer_model']]]))

File multiqc_report_raw = multiqc_raw.multiqc_report
File multiqc_report_cleaned = multiqc_cleaned.multiqc_report
Expand Down
12 changes: 6 additions & 6 deletions pipes/WDL/workflows/sarscov2_illumina_full.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ workflow sarscov2_illumina_full {
String amplicon_bed_prefix

Array[File] biosample_attributes
String instrument_model
String? instrument_model
String sra_title

Int min_genome_bases = 24000
Expand Down Expand Up @@ -77,10 +77,10 @@ workflow sarscov2_illumina_full {
### demux, deplete, SRA submission prep, fastqc/multiqc
call demux_deplete.demux_deplete {
input:
flowcell_tgz = flowcell_tgz,
biosample_map = biosample_merge.out_tsv,
instrument_model = instrument_model,
sra_title = sra_title
flowcell_tgz = flowcell_tgz,
biosample_map = biosample_merge.out_tsv,
instrument_model_user_specified = instrument_model,
sra_title = sra_title
}
String flowcell_id = demux_deplete.run_id

Expand Down Expand Up @@ -134,7 +134,7 @@ workflow sarscov2_illumina_full {

File passing_assemblies = rename_fasta_header.renamed_fasta
String passing_assembly_ids = orig_name
Array[String] assembly_cmt = [orig_name, "Broad viral-ngs v. " + demux_deplete.demux_viral_core_version, assemble_refbased.assembly_mean_coverage, instrument_model]
Array[String] assembly_cmt = [orig_name, "Broad viral-ngs v. " + demux_deplete.demux_viral_core_version, assemble_refbased.assembly_mean_coverage, demux_deplete.instrument_model_inferred]

# lineage assignment
call sarscov2_lineages.sarscov2_lineages {
Expand Down

0 comments on commit e1b71c2

Please sign in to comment.