nlapier2 / Metalign

Metalign: efficient alignment-based metagenomic profiling via containment min hash
MIT License
32 stars 7 forks source link

Allow use of system/user installed Minimap2/KMC/etc #16

Closed peterk87 closed 4 years ago

peterk87 commented 4 years ago

Right now Minimap2 needs to be installed in a path relative to the calling script:

https://github.com/nlapier2/Metalign/blob/94b6820da1396dd3187dc96cdb9fbb0511636d91/map_and_profile.py#L427

It's fairly easy to install Minimap2 and KMC3 with Conda from the Bioconda channel:

conda install -c bioconda minimap2 kmc -y

Code could be changed to:

# default to using $PATH accessible minimap2
parser.add_argument('--minimap2-bin', default='minimap2')

# check the valid version of minimap2 is being used
# maybe raise exception if no valid minimap2 installed or specified?
check_minimap2(args.minimap2_bin)

# change call slightly
mapper = subprocess.Popen([minimap2_bin, '-ax', ...
dkoslicki commented 4 years ago

Good idea! We welcome a pull request, otherwise we will try to get to it after we fix a few other issues (namely #12 and CMash installation issues).

peterk87 commented 4 years ago

I could give it a try :)

What version of Python are you targeting? Python 3.6 and later? f-strings, in-line type hints are very nice.

dkoslicki commented 4 years ago

@peterk87 Yes, Python >=3.6 is the goal. And goal is to get Travis CI up in the next month, so we can auto test PR's, but until then, we can just make/run manual tests.

peterk87 commented 4 years ago

@dkoslicki That's great to hear! Hope setting up CI isn't too tricky for you guys! I've found it difficult to get even tiny bioinformatics analyses to run in a reasonable amount of time with very limited memory.

I've found the cookiecutter recipe for Python packages to have a nice Travis-CI setup (and generally nice structure for a Python package)

Recent Python tools I've been developed have been bootstrapped with:

$ cookiecutter https://github.com/audreyr/cookiecutter-pypackage.git

Also has some config for auto deployment to PyPI on tagged release creation in Github.

Hope that helps!

dkoslicki commented 4 years ago

relative location calls now removed (assuming installed by user) in 8a616e022c0cde8543a9837d7d5cd4704b413685. Also KMC, minimap2, and CMash now auto-installed in Bioconda release, so closing this issue.