Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Commit

Permalink
Merge 5c152f3 into 9c14679
Browse files Browse the repository at this point in the history
  • Loading branch information
karlnyr committed Mar 23, 2021
2 parents 9c14679 + 5c152f3 commit 1c3d487
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 28 deletions.
25 changes: 3 additions & 22 deletions demux/cli/basemask.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def basemask():
@click.option(
"-a",
"--application",
type=click.Choice(["miseq", "nipt", "nova", "wes", "wgs"]),
type=click.Choice(["miseq", "nipt", "wes", "wgs"]),
help="sequencing type",
)
def create(rundir, lane, application):
Expand Down Expand Up @@ -59,7 +59,7 @@ def create_basemask(sheet):
basemask_index1 = "I" + str(len(index1)) + index1_n

# index2 basemask
if read2 == 0:
if indexread2 == 0:
click.echo(f"Y151,{basemask_index1},Y151")
else:
index2_n = "n" * (indexread2 - len(index2))
Expand All @@ -69,24 +69,8 @@ def create_basemask(sheet):
basemask_index2 = index2_n
click.echo(f"Y{read1},{basemask_index1},{basemask_index2},Y{read2}")

def create_novaseq_basemask():
""" create the bcl2fastq basemask for novaseq flowcells"""

run_parameters_file = "RunParameters.xml"
run_params_tree = parse_run_parameters(run_parameters_file)

indexread1 = int(run_params_tree.findtext("IndexRead1NumberOfCycles"))
indexread2 = int(run_params_tree.findtext("IndexRead2NumberOfCycles"))
read1 = int(run_params_tree.findtext("Read1NumberOfCycles"))
read2 = int(run_params_tree.findtext("Read2NumberOfCycles"))

novaseq_basemask = f"Y{read1},I{indexread1},I{indexread2},Y{read2}"

click.echo(f"{novaseq_basemask}")

def get_application_sheet(application):
""" parse the samplesheet in the runs directory, based on the type of application """
sheet = None
samplesheet = Path(rundir).joinpath("SampleSheet.csv")
sheet_map = {
"nipt": NIPTSamplesheet,
Expand All @@ -100,9 +84,6 @@ def get_application_sheet(application):

def create_application_basemask(application):
""" determine the basemask """
if application == "nova":
create_novaseq_basemask()
else:
create_basemask(get_application_sheet(application))
create_basemask(get_application_sheet(application))

create_application_basemask(application)
8 changes: 4 additions & 4 deletions scripts/novaseq/demux-novaseq.bash
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ log "Starting NovaSeq demultiplexing"
# Send a mail that demultiplexing has started
cat ${PROJECTLOG} | mail -s "Starting demultiplexing of novaseq flowcell ${FC} on $(hostname)" $EMAIL

BASEMASK=$(demux basemask create --application nova ${IN_DIR})
UNALIGNED_DIR=Unaligned-${BASEMASK//,}

UNALIGNED_DIR='Unaligned'

# DEMUX !
JOB_TITLE=Demux_${RUN}
log "sbatch --wait -A ${SLURM_ACCOUNT} -J ${JOB_TITLE} -o ${PROJECTLOG} ${SCRIPT_DIR}/demux-novaseq.sh ${IN_DIR} ${OUT_DIR} ${BASEMASK} ${UNALIGNED_DIR}"
RES=$(sbatch --wait -A ${SLURM_ACCOUNT} -J ${JOB_TITLE} -o ${PROJECTLOG} ${SCRIPT_DIR}/demux-novaseq.sh ${IN_DIR} ${OUT_DIR} ${BASEMASK} ${UNALIGNED_DIR})
log "sbatch --wait -A ${SLURM_ACCOUNT} -J ${JOB_TITLE} -o ${PROJECTLOG} ${SCRIPT_DIR}/demux-novaseq.sh ${IN_DIR} ${OUT_DIR} ${UNALIGNED_DIR}"
RES=$(sbatch --wait -A ${SLURM_ACCOUNT} -J ${JOB_TITLE} -o ${PROJECTLOG} ${SCRIPT_DIR}/demux-novaseq.sh ${IN_DIR} ${OUT_DIR} ${UNALIGNED_DIR})

log "bcl2fastq finished!"

Expand Down
4 changes: 2 additions & 2 deletions scripts/novaseq/demux-novaseq.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ mkdir -p /home/proj/production/flowcells/novaseq/"$SLURM_JOB_ID"
################

log "start demultiplexing ${RUN_DIR}"
log "singularity exec --bind /home/proj/production/demultiplexed-runs,/home/proj/production/flowcells/novaseq,/home/proj/production/flowcells/novaseq/"$SLURM_JOB_ID":/run/user/$(id -u) /home/proj/production/demux-on-hasta/novaseq/container/bcl2fastq_v2-20-0.sif bcl2fastq --loading-threads 3 --processing-threads 15 --writing-threads 3 --runfolder-dir ${RUN_DIR} --output-dir ${DEMUX_DIR}/${UNALIGNED_DIR} --use-bases-mask ${BASEMASK} --sample-sheet ${RUN_DIR}/SampleSheet.csv --barcode-mismatches 1"
singularity exec --bind /home/proj/production/demultiplexed-runs,/home/proj/production/flowcells/novaseq,/home/proj/production/flowcells/novaseq/"$SLURM_JOB_ID":/run/user/$(id -u) /home/proj/production/demux-on-hasta/novaseq/container/bcl2fastq_v2-20-0.sif bcl2fastq --loading-threads 3 --processing-threads 15 --writing-threads 3 --runfolder-dir ${RUN_DIR} --output-dir ${DEMUX_DIR}/${UNALIGNED_DIR} --use-bases-mask ${BASEMASK} --sample-sheet ${RUN_DIR}/SampleSheet.csv --barcode-mismatches 1
log "singularity exec --bind /home/proj/production/demultiplexed-runs,/home/proj/production/flowcells/novaseq,/home/proj/production/flowcells/novaseq/"$SLURM_JOB_ID":/run/user/$(id -u) /home/proj/production/demux-on-hasta/novaseq/container/bcl2fastq_v2-20-0.sif bcl2fastq --loading-threads 3 --processing-threads 15 --writing-threads 3 --runfolder-dir ${RUN_DIR} --output-dir ${DEMUX_DIR}/${UNALIGNED_DIR} --sample-sheet ${RUN_DIR}/SampleSheet.csv --barcode-mismatches 1"
singularity exec --bind /home/proj/production/demultiplexed-runs,/home/proj/production/flowcells/novaseq,/home/proj/production/flowcells/novaseq/"$SLURM_JOB_ID":/run/user/$(id -u) /home/proj/production/demux-on-hasta/novaseq/container/bcl2fastq_v2-20-0.sif bcl2fastq --loading-threads 3 --processing-threads 15 --writing-threads 3 --runfolder-dir ${RUN_DIR} --output-dir ${DEMUX_DIR}/${UNALIGNED_DIR} --sample-sheet ${RUN_DIR}/SampleSheet.csv --barcode-mismatches 1

0 comments on commit 1c3d487

Please sign in to comment.