Skip to content

Commit

Permalink
add check for sample rows in samplesheet modifying
Browse files Browse the repository at this point in the history
  • Loading branch information
jethror1 committed Nov 7, 2023
1 parent 7123e82 commit 2c0725c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,13 @@ _modify_samplesheet() {
sample_list=$(sed -e "s/\r//g" <<< "$sample_rows" | cut -d, -f $pair_id_col | sort | uniq)
fi

if [[ -z "$sample_rows" ]]; then
# final sense check that we didn't end up with no rows to write
echo "No sample rows left after include / exclude specified, check sample names / patterns "
echo "provided are valid against sample names listed in the samplesheet"
dx-jobutil-report-error "Error limiting samplesheet to specified sample names"
fi

# write out new samplesheet with specified rows
echo "$samplesheet_header" >> runfolder/modified_SampleSheet.csv
echo "$sample_rows" >> runfolder/modified_SampleSheet.csv
Expand Down

0 comments on commit 2c0725c

Please sign in to comment.