Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix recreate symlink issue + mac2unix/dos2unix replacement #106

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions generate_template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ rm -rf "${WORKDIR}/generatedscripts/NGS_Demultiplexing/${RAWDATANAME}/out.csv"
###### Dual barcode checker
#
sampsheet="${WORKDIR}/generatedscripts/NGS_Demultiplexing/${RAWDATANAME}/${RAWDATANAME}.csv"

mac2unix "${sampsheet}"
SAMPLESHEET_SEP=","
cp "${sampsheet}"{,.converted}
sed -i 's/\r/\n/g' "${sampsheet}.converted"
Copy link
Member

@pneerincx pneerincx Mar 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
sed -i 's/\r/\n/g' "${sampsheet}.converted"
printf '\n' >> "${sampsheet}.converted"
sed -i 's/\r/\n/g' "${sampsheet}.converted"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The updated code replaces both mac2unix as well as dos2unix resulting whatever2unix. Another typical error is a missing line end character on the last line. The suggestion above inserts a line end character before the
sed -i "/^[\s${SAMPLESHEET_SEP}]*$/d" "${sampsheet}.converted"
line which removes empty lines. So if it was not necessary to add another line end character the sed that removes empty lines will fix it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check, updated

sed -i "/^[\s${SAMPLESHEET_SEP}]*$/d" "${sampsheet}.converted"
mv "${sampsheet}.converted" "${sampsheet}"

declare -a _sampleSheetColumnNames=()
declare -A _sampleSheetColumnOffsets=()
Expand Down
5 changes: 3 additions & 2 deletions protocols/UploadSampleSheet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#string intermediateDir
#string generatedScriptsDir
#string nextSeqRunDataDir
#string logsDir

WHOAMI=$(whoami)
# shellcheck source=/home/${WHOAMI}/molgenis.cfg
Expand Down Expand Up @@ -105,10 +106,10 @@ cd "${runResultsDir}" || exit
while IFS='\n' read -r line; do resultsArray+=("$line"); done < <(find "${ngsDir}/"*.*)
for i in "${resultsArray[@]}"
do
ln -s "${i}"
ln -sf "${i}"
done

cd - || exit

echo "made symlinks from the rawdata/ngs folder to the results folder: ${runResultsDir}"
echo "finished: $(date +%FT%T%z)" >> "${workDir}/logs/${filePrefix}//run01.demultiplexing.totalRuntime"
echo "finished: $(date +%FT%T%z)" >> "${workDir}/logs/${filePrefix}//${filePrefix}.demultiplexing.totalRuntime"