Skip to content

Commit

Permalink
Allow flexible installation location of long-to-linked-pe (#128)
Browse files Browse the repository at this point in the history
* Allow flexible installation location of long-to-linked-pe

* If already found on the PATH, use that path, else in src dir
* Also remove unneeded btllib version restriction in requirements.txt

* Remove hard-coded path to tigmint-make in run_tigmint_demo.sh

* Update CI

* Change python version for CI

* Use mamba for all CI
  • Loading branch information
lcoombe authored Sep 29, 2023
1 parent 0dc2a72 commit edacf53
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
8 changes: 5 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,17 @@ jobs:
displayName: Create Anaconda environment
- script: |
source activate tigmint_CI
conda install --yes --quiet --name tigmint_CI -c conda-forge -c bioconda pytest bedtools bwa samtools=1.9 minimap2 pylint 'btllib<=1.4.10' compilers ntlink
conda install --yes --quiet --name tigmint_CI -c conda-forge -c bioconda --file requirements.txt
conda install --yes --quiet --name tigmint_CI -c conda-forge -c bioconda mamba python=3.8
mamba install --yes --quiet -c conda-forge -c bioconda pytest bedtools bwa samtools=1.9 minimap2 pylint btllib compilers ntlink
mamba install --yes --quiet -c conda-forge -c bioconda --file requirements.txt
displayName: Install Anaconda packages
- script: |
source activate tigmint_CI
make -C src all
displayName: Compile C++ executables
- script: |
source activate tigmint_CI
conda install --yes -c bioconda -c conda-forge clang clang-tools
mamba install --yes -c bioconda -c conda-forge clang clang-tools
make -C src lint
displayName: Run clang-format and clang-tidy
- script: |
Expand All @@ -34,6 +35,7 @@ jobs:
displayName: Run pylint
- script: |
source activate tigmint_CI
export PATH=$(pwd)/bin:$PATH
cd tests
pytest -vs tigmint_test.py
displayName: Run pytests
8 changes: 7 additions & 1 deletion bin/tigmint-make
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@ ifdef bin
PATH:=$(bin):$(PATH)
endif

# Determine path to long-to-linked-pe script
src_path=$(bin)/../src
ifneq ($(shell command -v long-to-linked-pe),)
src_path=$(shell dirname $(shell command -v long-to-linked-pe))
endif

# Use pigz or bgzip for parallel compression if available.
ifneq ($(shell command -v pigz),)
gzip=pigz -p$t
Expand Down Expand Up @@ -302,7 +308,7 @@ endif
ifeq ($(mapping), ntLink)
$(gtime) $(bin)/tigmint-ntlink-map --bed $@ -k$(ntLink_k) -w$(ntLink_w) -t$t --path $(bin) -m$(minsize) --span $(span) $(draft) $<
else
$(gtime) sh -c '$(bin)/../src/long-to-linked-pe -l $(cut) -m$(minsize) -g$G -s -b $(reads).barcode-multiplicity.tsv --bx -t$t --fasta -f $(reads).tigmint-long.params.tsv $< | \
$(gtime) sh -c '$(src_path)/long-to-linked-pe -l $(cut) -m$(minsize) -g$G -s -b $(reads).barcode-multiplicity.tsv --bx -t$t --fasta -f $(reads).tigmint-long.params.tsv $< | \
minimap2 -y -t$t -x map-$(longmap) --secondary=no $(draft).fa - | \
$(bin)/tigmint_molecule_paf.py -q$(mapq) -s$(minsize) $(dist_options) - | sort -k1,1 -k2,2n -k3,3n $(SORT_OPTS) > $@'
endif
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ intervaltree
pybedtools
pysam
numpy
btllib <=1.4.10
btllib
6 changes: 4 additions & 2 deletions tests/test_installation/run_tigmint_demo.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#!/bin/bash

echo "Please ensure that tigmint-make is in your PATH!"

echo "Running tigmint with linked reads..."

../../bin/tigmint-make -B tigmint draft=test_contig reads=test_linkedreads
tigmint-make -B tigmint draft=test_contig reads=test_linkedreads

echo "Running tigmint with long reads..."

../../bin/tigmint-make -B tigmint-long draft=test_contig_long reads=test_longreads span=10 G=7000 dist=auto
tigmint-make -B tigmint-long draft=test_contig_long reads=test_longreads span=10 G=7000 dist=auto

echo "Done! Compare your output files to those in the 'expected_outputs' directory to ensure that the run was successful."

0 comments on commit edacf53

Please sign in to comment.