Skip to content

Commit

Permalink
Merge branch 'spaces' into 'dev'
Browse files Browse the repository at this point in the history
Spaces

See merge request research/pomoxis!134
  • Loading branch information
cjw85 committed May 10, 2021
2 parents 9fa234d + b51c793 commit db8a1c9
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 17 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [v0.3.7] - 2020-05-10
### Changed
- Speed improvements to several benchmarking and analysis scripts
### Fixed
- Quoted all variables in `mini_align` to handle spaces in inputs.


## [v0.3.6] - 2020-02-17
### Changed
- `stats_from_bam` no longer throws exception when no alignments have been proceseed.
Expand Down
2 changes: 1 addition & 1 deletion pomoxis/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '0.3.6'
__version__ = '0.3.7'

import argparse
import os
Expand Down
32 changes: 16 additions & 16 deletions scripts/mini_align
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,12 @@ minimap_exts=('.mmi' '.fai')
num_minimap_exts=${#minimap_exts[@]}
missing=0
for ext in "${minimap_exts[@]}"; do
minimap_index=${REFERENCE}${ext}
minimap_index="${REFERENCE}${ext}"
if ${FORCE_INDEX}; then
echo "Removing previous index file ${minimap_index}"
rm -rf ${minimap_index}
rm -rf "${minimap_index}"
fi
if [[ ! -e ${minimap_index} ]]; then
if [[ ! -e "${minimap_index}" ]]; then
((missing+=1))
fi
done;
Expand All @@ -132,9 +132,9 @@ if [ "$missing" -eq 0 ]; then
echo "Found minimap files." >&2
elif [ "$missing" -eq "$num_minimap_exts" ]; then
echo "Constructing minimap index." >&2
samtools faidx ${REFERENCE}
minimap2 -I ${INDEX_SIZE} ${ALIGN_OPTS} -d ${REFERENCE}.mmi ${REFERENCE} \
|| (echo "Indexing draft failed" && exit 1)
samtools faidx "${REFERENCE}"
minimap2 -I "${INDEX_SIZE}" ${ALIGN_OPTS} -d "${REFERENCE}.mmi" "${REFERENCE}" \
|| { echo "Indexing draft failed"; exit 1; }
else
echo "Missing ${missing} index files. Clean up any files named
${REFERENCE}<EXT> where <EXT> is one of ${minimap_exts[*]}." >&2
Expand All @@ -147,15 +147,15 @@ fi

if [ "$CHUNK" != "" ]; then
echo "Splitting input into ${CHUNK} chunks." >&2
split_fastx ${INPUT} ${INPUT}.chunks ${CHUNK} \
|| (echo "Failed to split input into chunks.")
INPUT=${INPUT}.chunks
split_fastx "${INPUT}" "${INPUT}.chunks" "${CHUNK}" \
|| { echo "Failed to split input into chunks."; exit 1; }
INPUT="${INPUT}.chunks"
fi

minimap2 ${ALIGN_OPTS} -t ${THREADS} -a ${REFERENCE}.mmi ${INPUT} \
-A ${MATCH_SCORE} -B ${MISMATCH_SCORE} -O ${GAP_OPEN} -E ${GAP_EXTEND} |
samtools view -@ ${THREADS} -T ${REFERENCE} ${FILTER} -bS - |
samtools sort -@ ${THREADS} ${SORT} -l 9 -o ${PREFIX}.bam - \
|| (echo "Alignment pipeline failed." && exit 1)
samtools index -@ ${THREADS} ${PREFIX}.bam ${PREFIX}.bam.bai \
|| (echo "Failed to index alignment file." && exit 1)
minimap2 ${ALIGN_OPTS} -t "${THREADS}" -a "${REFERENCE}.mmi" "${INPUT}" \
-A "${MATCH_SCORE}" -B "${MISMATCH_SCORE}" -O "${GAP_OPEN}" -E "${GAP_EXTEND}" |
samtools view -@ "${THREADS}" -T "${REFERENCE}" ${FILTER} -bS - |
samtools sort -@ "${THREADS}" ${SORT} -l 9 -o "${PREFIX}.bam" - \
|| { echo "Alignment pipeline failed."; exit 1; }
samtools index -@ "${THREADS}" "${PREFIX}.bam" "${PREFIX}.bam.bai" \
|| { echo "Failed to index alignment file."; exit 1; }

0 comments on commit db8a1c9

Please sign in to comment.