COSMO is registered in the bio.tools registry (biotools:cosmo).
Condition-specific Mapping of Operons (COSMO) is a tool for detecting operons in microorganisms
An Operon consists of a group of structural genes that codes for enzymes involved in a metabolic pathway. The genes of an operon are located contiguously on a stretch DNA and are under the control of one promoter. A single mRNA unit is transcribed and translated into separate proteins.
COSMO takes as input, a reference genome aligned BAM file and a GTF file with gene coordinates. COSMO predicts operons by calculating average coverages of the genes/CDSs and their intergenic regions (IGRs). The user provides four cut-offs which determine whether genes/CDSs form part of the same operon. If they fail any one of these cut-offs, then they are not part of the operon.
- Python >= 3.7
- Pysam >=0.15.0
Check prerequisites
Open a terminal and run:
python3 --version
python3 -m pip --versionPython must be version 3.7 or later. If either command fails, install Python 3 or pip using your Linux distribution's instructions.
Option 1: Download and install
Click Code → Download ZIP near the top of this repository page, then extract the downloaded ZIP.
In a terminal, install using the path to the extracted folder:
python3 -m pip install /path/to/COSMO-masterReplace /path/to/COSMO-master with your actual folder path.
You do not need to open or edit setup.py.
Option 2: Install directly from GitHub
In a terminal, run:
python3 -m pip install https://github.com/SANBI-SA/COSMO/archive/refs/heads/master.zipNo manual download or extraction is needed. Both options install COSMO and its required Python dependencies.
Python environments
You can use an existing virtual or Conda environment.
If pip reports an externally-managed-environment error, create
and activate a virtual environment:
python3 -m venv ~/.venvs/cosmo
source ~/.venvs/cosmo/bin/activateThen run either installation command above.
If creating the environment fails because venv support is missing, install your distribution's Python virtual-environment package.
When using this environment, activate it before running COSMO in a new terminal:
source ~/.venvs/cosmo/bin/activateCheck installation
Run:
cosmo --helpIf COSMO starts successfully, it displays usage instructions and descriptions of its inputs and options.
Run cosmo in a terminal, activating your Python environment if you used
one. Supply a coordinate-sorted, indexed BAM file and a GTF file, as shown
below. Results are saved in an automatically created output/ folder
in your current directory.
cosmo [-h] [-D GDEPTH] [-d IDEPTH] [-F GFACTOR] [-f IFACTOR]
[-o OUTPUT]
ref length bam gtf
Detect possible genome operons using RNA expression coverages
positional arguments:
ref Name of reference sequence in BAM file
length Length of reference genome according to GTF file
bam Bam input file
gtf Gtf input file
optional arguments:
-h, --help show this help message and exit
-D GDEPTH, --gdepth GDEPTH
Average number of reads per base required to consider
a gene expressed
-d IDEPTH, --idepth IDEPTH
Average number of reads per base required to consider
an IGR expressed
-F GFACTOR, --gfactor GFACTOR
Maximum fold difference (FD) allowed between two genes/CDSs of an operon
-f IFACTOR, --ifactor IFACTOR
Maximum FD allowed between an intergenic region (IGR) and its flanking genes/CDSs
-o OUTPUT, --output OUTPUT
CSV output filename (output file is written to "output" folder)
Example code for running a file:
cosmo -D 1 -d 2 -F 5.0 -f 10.0 -o Strain_5_control.csv NC_000962 4411532 /home/Sally/Input_bam_files/Strain_5_control.bam /home/Sally/Input_bam_files/NC_000962_tuberculosis.gtf
Where the:
1) minimum CDS coverage = 1
2) min IGR coverage = 2
3) maximum FD between adjacent CDSs/genes = 5.0
4) max FD between IGR and flanking CDSs = 10.0
5) output file name given by user = Strain_5_control.csv
6) Genome name in GTF file = NC_000962
7) Size of genome in GTF file = 4411532
8) Input bam file = Strain_5_control.bam
9) GTF file name = NC_000962_tuberculosis.gtf