Skip to content

Commit

Permalink
cleaning_up
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelauliano committed May 10, 2023
1 parent eb01bd2 commit 55a0fce
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 132 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/github-actions-build-code.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Build and Publish MitoHiFi code

on: workflow_dispatch
# push:
# branches:
# - 'reviews'
on: #workflow_dispatch
push:
branches:
- 'reviews'


env:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/github-actions-integration-test.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: MitoHiFi Integration Test

on: #workflow_dispatch
push:
branches:
- 'reviews'
on: workflow_dispatch
# push:
# branches:
# - 'reviews'

jobs:
integration_test:
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MitoHiFi

------ This is v3.0.0 -------
------ This is v3.2 -------

MitoHiFi is a python pipeline distributed under the [MIT License](LICENSE)

Expand All @@ -15,15 +15,15 @@ Find out more [Darwin Tree of Life data portal](https://portal.darwintreeoflife.
## 1. Background
**MitoHiFi is a python workflow that assembles mitogenomes from Pacbio HiFi reads.**

With MitoHiFi v3.0.0 you can start from the raw Pacbio HiFi reads (flag **-r**) or from the assembled contigs (flag **-c**). You also need a reference mitochondria sequence in FASTA and [GenBank format](https://www.ncbi.nlm.nih.gov/Sitemap/samplerecord.html). We provide an internal script (findMitoReference.py) that can be used to find and download the most closely-related reference genome for your species from NCBI.
With MitoHiFi v3.2 you can start from the raw Pacbio HiFi reads (flag **-r**) or from the assembled contigs (flag **-c**). You also need a reference mitochondria sequence in FASTA and [GenBank format](https://www.ncbi.nlm.nih.gov/Sitemap/samplerecord.html). We provide an internal script (findMitoReference.py) that can be used to find and download the most closely-related reference genome for your species from NCBI.



*The dissemination of high-quality long reads - such as PacBio HiFi - makes the assembly of high-quality mitogenome straightforward. Because of the circular nature of the molecule, however, the mitogenome is usually assembled redundantly resulting in multiple-copy mitogenome contigs. This pipeline was developed to finalise the assembly and annotate the mitogenome. It also considers heteroplasmy and aims to assemble and annotate all the mtDNA variants in your sample, among which MitoHiFi v2.2 will choose a representative as the final genome assembly according to the similarity to the reference genome and gene completeness. In addtion, an multiple sequence alignment (MSA) of all the variants is provided to facilitate the analysis of mitochondria heteroplasmy.*



MitoHiFi v3.0.0 will:
MitoHiFi v3.2 will:

(i) extract mito reads and assemble them with hifiasm (flag **-r**), or find the mito contigs among assembled contigs (flag **-c**)<br />

Expand All @@ -39,7 +39,7 @@ MitoHiFi v3.0.0 will:

## 2. Installation

There are two ways to install MitoHiFi v3.0.0:
There are two ways to install MitoHiFi v3.2:

(i) manually - and then you will need to have all the dependencies installed in your PATH.

Expand Down Expand Up @@ -80,18 +80,18 @@ export PATH=</path/to/MitoFinder>:${PATH}

where `</path/to/MitoFinder>` needs to be replaced with the path where MitoFinder was installed.

**Once all dependencies are installed, install MitoHiFi v2.3 (Linux)**
**Once all dependencies are installed, install MitoHiFi v3.2 (Linux)**

```
git clone https://github.com/marcelauliano/MitoHiFi.git
```

### 2.2 Running MitoHiFi v3.0.0 from a Singularity with a Docker image
### 2.2 Running MitoHiFi v3.2 from a Singularity with a Docker image


We have wrapped up MitoHiFi v3.0.0 code into a singularity container. We recommend using singularity versions => 3.7, as lower versions do not support spaces in the arguments, and you would not be able to pass more than one set of reads to the flag **-r**
We have wrapped up MitoHiFi v3.2 code into a singularity container. We recommend using singularity versions => 3.7, as lower versions do not support spaces in the arguments, and you would not be able to pass more than one set of reads to the flag **-r**

MitoHiFi.v3.0.0 siungularity image should be run as:
MitoHiFi.v3.2 siungularity image should be run as:

```
singularity exec --bind /lustre/:/lustre/ docker://ghcr.io/marcelauliano/mitohifi:master mitohifi.py -r "/data/f1.fasta /data/f2.fasta /data/f3.fasta" -f /data/reference.fasta -g /data/reference.gb -t 10 -o 2
Expand Down Expand Up @@ -301,4 +301,4 @@ And for tRNAs annotation:

For more information on python code and pipeline: [email protected] and [email protected]

Questions on the Singularity: Marcela Uliano [email protected]
Questions about the Docker container: Marcela Uliano-Silva [email protected]
27 changes: 0 additions & 27 deletions environment/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -87,30 +87,3 @@ RUN pip3 --no-cache-dir install --upgrade pip \
entrezpy \
dna_features_viewer \
bcbio-gff

# FROM ghcr.io/marcelauliano/mitohifi:reviews

# WORKDIR /opt

# # /opt/MitoHiFi
# RUN git clone -b reviews https://github.com/marcelauliano/MitoHiFi.git \
# && cd MitoHiFi/src \
# && chmod +x *.py \
# && sed -i '1i#!/usr/bin/env python3' mitohifi.py findFrameShifts.py fixContigHeaders.py \
# && sed -i '1 s/python\>/python3/' *.py \
# && sed -i 's/"python2",\s//' parallel_annotation_mitos.py \
# && sed -i 's/MITOS\/data/\/opt\/databases/' parallel_annotation_mitos.py \
# && pip3 --no-cache-dir install --upgrade pip \
# && pip3 --no-cache-dir install biopython \
# pandas \
# Pillow \
# matplotlib \
# entrezpy \
# dna_features_viewer \
# bcbio-gff

# WORKDIR /tmp

# ENV CONDA_DIR=/opt/conda

# ENV PATH /opt/wrappers:/opt/cdhit/:/opt/hifiasm-0.16.1/:/opt/MitoHiFi/src/:/opt/MitoFinder/:/opt/minimap2-2.24_x64-linux/:${PATH}
81 changes: 1 addition & 80 deletions environment/code/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,82 +1,3 @@
# FROM ubuntu:18.04

# ENV DEBIAN_FRONTEND=noninteractive

# RUN apt-get -qq -y update \
# && apt-get -qq -y update \
# && apt-get -qq -y install \
# autoconf \
# automake \
# bedtools \
# build-essential \
# curl \
# default-jre \
# git \
# infernal \
# libopenjp2-7 \
# libtiff5 \
# libz-dev \
# mafft \
# ncbi-blast+ \
# python3-dev \
# python3-pip \
# samtools \
# wget \
# vim \
# && rm -rf /var/lib/apt/lists/*


# WORKDIR /opt

# # /opt/minimap2-2.24_x64-linux
# RUN curl -L https://github.com/lh3/minimap2/releases/download/v2.24/minimap2-2.24_x64-linux.tar.bz2 \
# | tar -jxvf -

# # /opt/hifiasm-0.16.1
# RUN curl -L https://github.com/chhylp123/hifiasm/archive/refs/tags/0.16.1.tar.gz \
# | tar -xzvf - \
# && cd hifiasm-0.16.1 \
# && make \
# && wget -P /usr/local/src https://bootstrap.pypa.io/pip/2.7/get-pip.py \
# && python2 /usr/local/src/get-pip.py \
# && python2 -m pip --no-cache-dir install biopython==1.70

# # /opt/MitoFinder
# RUN git clone https://github.com/RemiAllio/MitoFinder.git \
# && cd MitoFinder \
# && ./install.sh \
# && sed -i 's/\/usr\/bin\/python/\/usr\/bin\/env python/' mitofinder
# RUN chmod -R 755 /opt/MitoFinder

# RUN git clone https://github.com/weizhongli/cdhit.git && \
# cd cdhit && \
# make MAX_SEQ=10000000

# RUN mkdir -p /opt/wrappers

# COPY mitos_wrapper.sh /opt/wrappers/runmitos.py
# COPY mitofinder_wrapper.sh /opt/wrappers/mitofinder

# RUN chmod -R 755 /opt/wrappers

# ARG CONDA_DIR=/opt/conda

# RUN wget -P /usr/local/src https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \
# && bash /usr/local/src/Miniconda3-latest-Linux-x86_64.sh -b -p $CONDA_DIR \
# && $CONDA_DIR/bin/conda install -n base conda-libmamba-solver

# RUN $CONDA_DIR/bin/conda create -n mitos_env --experimental-solver=libmamba -c bioconda -y mitos
# RUN $CONDA_DIR/bin/conda create -n mitofinder_env --experimental-solver=libmamba python=2.7

# RUN $CONDA_DIR/bin/conda clean -a

# RUN mkdir -p /opt/databases

# WORKDIR /opt/databases

# RUN curl -L https://zenodo.org/record/4284483/files/refseq89m.tar.bz2?download=1 | tar -jxvf - \
# && curl -L https://zenodo.org/record/4284483/files/refseq89f.tar.bz2?download=1 | tar -jxvf -

FROM ghcr.io/marcelauliano/mitohifi-base:reviews

WORKDIR /opt
Expand All @@ -94,4 +15,4 @@ WORKDIR /tmp

ENV CONDA_DIR=/opt/conda

ENV PATH /opt/wrappers:/opt/cdhit/:/opt/hifiasm-0.16.1/:/opt/MitoHiFi/src/:/opt/MitoFinder/:/opt/minimap2-2.24_x64-linux/:${PATH}
ENV PATH /opt/wrappers:/opt/cdhit/:/opt/hifiasm-0.16.1/:/opt/MitoHiFi/src/:/opt/MitoFinder/:/opt/minimap2-2.24_x64-linux/:${PATH}
8 changes: 0 additions & 8 deletions src/mitohifi.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,14 +369,6 @@ def main():
shutil.copy(repr_contig_fasta, final_fasta)
shutil.copy(repr_contig_annotation, final_annotation)

#repr_contig_get_gb = ["mitofinder", "--new-genes", "--max-contig-size",
# str(max_contig_size), "-j", "final_mitogenome.annotation",
# "-a", repr_contig_fasta, "-r", args.g, "-o", args.o, "-p", str(args.p),
# "--circular-size", "8000"]
#subprocess.run(repr_contig_get_gb, stderr=subprocess.DEVNULL, stdout=subprocess.DEVNULL)

#final_fasta = os.path.join("final_mitogenome.annotation", "final_mitogenome.annotation_MitoFinder_mitfi_Final_Results", "final_mitogenome.annotation_mtDNA_contig.fasta")
#final_gbk = os.path.join("final_mitogenome.annotation", "final_mitogenome.annotation_MitoFinder_mitfi_Final_Results", "final_mitogenome.annotation_mtDNA_contig.gb")

# Generate contigs stats
step += 1
Expand Down

0 comments on commit 55a0fce

Please sign in to comment.