File Info

Filename
.command.sh
Full Path
s3://natera-rnd-pltf-dev-nextflow-scratch-01/work/4d/b79fdf38eeb1c3ff251a294f2ff07f/.command.sh
Size
807 bytes
Attempt
#!/bin/bash -euo pipefail
# Load sample_type_map into associative array (skip header)
declare -A type_map
while IFS=, read -r sid stype; do
    type_map["$sid"]="$stype"
done < <(tail -n +2 sample_type_map.csv)

echo "sample,sample_type,fastq_1,fastq_2,strandedness" > samplesheet.csv
while IFS=$'\t' read -r sample_id r1 r2; do
    [ -z "$sample_id" ] && continue
    st="${type_map[$sample_id]:-}"
    if [ -z "$st" ]; then
        echo "ERROR: no sample_type found for '$sample_id' in sample_type_map.csv" >&2
        exit 1
    fi
    echo "${sample_id},${st},${r1},${r2},reverse" >> samplesheet.csv
done < fastq_paths.tsv

cat <<-END_VERSIONS > versions.yml
"NFCORE_RNAFUSION:DEMUX_FROM_RUNDIR:DEMULTIPLEX:SAMPLESHEET_FROM_MERGED":
    bash: $(bash --version | head -1 | awk '{print $4}')
END_VERSIONS