File Info

Filename
.command.sh
Full Path
s3://natera-rnd-pltf-dev-nextflow-scratch-01/work/43/5e595258e1ca9f443f698a3ff6572c/.command.sh
Size
1.0 KB
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= read -r sample_id; 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},s3://natera-rnd-pltf-dev-s3-gitlab-results/rnafusion/build2803284/baseline-run/63723377/bclconvert/fastqs/${sample_id}/${sample_id}_R1.fastq.gz,s3://natera-rnd-pltf-dev-s3-gitlab-results/rnafusion/build2803284/baseline-run/63723377/bclconvert/fastqs/${sample_id}/${sample_id}_R2.fastq.gz,reverse" >> samplesheet.csv
done < sample_ids.txt

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