hepcat72
hepcat72

Reputation: 1124

What's the conda package for the `sort` command line utility?

I'm building a snakemake workflow and one of the rules uses the sort command line utility, and it uses the -k option, but I cannot find a corresponding conda package for that utility. My workflow is using:

(ATACCD) $ which sort
/usr/bin/sort
(ATACCD) $ sort --version
2.3-Apple (154)

conda search sort (or rather mamba search sort) shows tons of packages, but none of them are clearly the regular plain old sort command line utility.

I'm using channels:

I've looked specifically at what seemed to me to be the most likely candidates (the short named ones: gsort, usort, natsort). Is there like some general *nix environment I should be using?

My base environment doesn't have a sort in it, nor does the environment I'm currently using (ATACCD). And miniconda is the first thing in my PATH:

(ATACCD) $ echo $PATH
/Users/rleach/.miniconda3/envs/ATACCD/bin:/Users/rleach/.miniconda3/condabin:/Library/...

UPDATE: And I just found out that the cat package I included is wrong too:

channels:
  - conda-forge
dependencies:
  - cat>=5.2.3

(It's actually in the bioconda channel, despite my yaml spec.)

My rule tries to use it and I get:

usage: CAT (prepare | contigs | bin | bins | add_names | summarise) [-v / --version] [-h / --help]
CAT: error: one of the arguments prepare contigs bin bins add_names summarise is required

The thing is that the snakemake linters require me to have a conda env file for every rule... How do I satisfy these basic requirements?

Upvotes: 2

Views: 218

Answers (1)

merv
merv

Reputation: 77090

The conda-suggest package is useful for this. It is a database constructed from scraping all the bin/ folders of all the Conda Forge packages. Unfortunately, it has been a few years since the database has been rebuilt, but it should cover most things.

# mamba install -n base conda-suggest
conda suggest message sort
Command 'sort' not found in the environment, but can be installed with any of:

    $ conda install -c conda-forge coreutils

That is, the coreutils package is what you are looking for. That is also what provides cat.

Upvotes: 2

Related Questions