Skip to content

Commit

Permalink
wrapper script is saving dryrun logs to workdir
Browse files Browse the repository at this point in the history
  • Loading branch information
kopardev committed Oct 26, 2021
1 parent 9234aee commit 6ceec86
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
6 changes: 5 additions & 1 deletion run_atac
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,11 @@ function dryrun() {
# Dry-run

runcheck
run "--dry-run"
if [ -f ${WORKDIR}/dryrun.log ]; then
modtime=$(stat ${WORKDIR}/dryrun.log |grep Modify|awk '{print $2,$3}'|awk -F"." '{print $1}'|sed "s/ //g"|sed "s/-//g"|sed "s/://g")
mv ${WORKDIR}/dryrun.log ${WORKDIR}/logs/dryrun.${modtime}.log
fi
run "--dry-run" | tee ${WORKDIR}/dryrun.log
}

function unlock() {
Expand Down
11 changes: 3 additions & 8 deletions workflow/scripts/ccbr_bowtie2_align_pe.bash
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,11 @@ samtools index ${samplename}.bowtie2.bam
samtools view -@ $ncpus -F 516 -u ${samplename}.bowtie2.bam $CHROMOSOMES > ${samplename}.tmp1.bam
samtools sort -@ $ncpus -n -o ${samplename}.tmp1.sorted.bam ${samplename}.tmp1.bam
mv ${samplename}.tmp1.sorted.bam ${samplename}.qsorted.bam

samtools view -@ $ncpus -h ${samplename}.tmp1.bam > ${samplename}.tmp1.sorted.sam
rm -rf ${samplename}.tmp1.bam

cat ${samplename}.tmp1.sorted.sam | \
${SCRIPTSFOLDER}/atac_assign_multimappers.py -k $multimapping --paired-end > ${samplename}.tmp2.sorted.sam
rm -rf ${samplename}.tmp1.sorted.sam

samtools view -@ $ncpus -bS -o ${samplename}.tmp3.bam ${samplename}.tmp2.sorted.sam
rm -rf ${samplename}.tmp2.sorted.sam
samtools view -@ $ncpus -h ${samplename}.qsorted.bam | \
${SCRIPTSFOLDER}/atac_assign_multimappers.py -k $multimapping --paired-end | \
samtools view -@ $ncpus -bS -o ${samplename}.tmp3.bam -

samtools sort -@ $ncpus -o ${samplename}.tmp3.sorted.bam ${samplename}.tmp3.bam
mv ${samplename}.tmp3.sorted.bam ${samplename}.tmp3.bam
Expand Down

1 comment on commit 6ceec86

@kopardev
Copy link
Member Author

Choose a reason for hiding this comment

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

Significant change to ccbr_bowtie2_align_pe.bash... now using the query sorted output to atac_assign_multimappers.py (as intended)

Please sign in to comment.