Skip to content

Commit 8f05dee

Browse files
authored
Dev (#1)
Updated Readme.md; added Dockerfile
1 parent 03f09b1 commit 8f05dee

File tree

3 files changed

+120
-24
lines changed

3 files changed

+120
-24
lines changed

Dockerfile

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
FROM phusion/baseimage:jammy-1.0.1
2+
3+
ARG HTSLIB_VERSION=1.17
4+
5+
ENV TERM=xterm-256color \
6+
HTSLIB_URL=https://github.com/samtools/htslib/releases/download/${HTSLIB_VERSION}/htslib-${HTSLIB_VERSION}.tar.bz2
7+
8+
COPY . minimap2_index_modifier
9+
10+
# install deps and cleanup apt garbage
11+
RUN set -eux; \
12+
apt-get update; \
13+
apt-get install -y \
14+
wget \
15+
make \
16+
autoconf \
17+
gcc \
18+
libcurl4-openssl-dev \
19+
zlib1g-dev \
20+
libbz2-dev \
21+
liblzma-dev \
22+
bzip2 \
23+
&& rm -rf /var/lib/apt/lists/*;
24+
25+
#install htslib
26+
RUN set -eux; \
27+
mkdir temp; \
28+
cd temp; \
29+
\
30+
wget ${HTSLIB_URL}; \
31+
tar -xf htslib-${HTSLIB_VERSION}.tar.bz2; \
32+
cd htslib-${HTSLIB_VERSION}; \
33+
\
34+
autoreconf -i; \
35+
./configure; \
36+
make; \
37+
make install; \
38+
cd ../../; \
39+
rm -rf temp;
40+
41+
#install minimap2_index_modifier
42+
RUN set -eux; \
43+
cd minimap2_index_modifier; \
44+
make; \
45+
cp minimap2 /usr/local/bin; \
46+
cd ../; \
47+
rm -rf minimap2_index_modifier;
48+
49+
ENV LD_LIBRARY_PATH=/usr/local/lib

README.md

+39-24
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,47 @@
1-
## Build
2-
install htslib 1.17
3-
make
1+
Minimap2_index_modifier
2+
=======================
3+
Minimap2_index_modifier is a fork of alignment tool [minimap2](https://github.com/lh3/minimap2).
4+
Unlike the original tool, this can use the variants defined in the VCF file when generating the index, for more accurate alignment.
45

5-
## Make gz and gz.tbi from VCF
6-
bgzip -c filename.vcf > filename.vcf.gz\
7-
tabix -p vcf filename.vcf.gz
86

9-
## Run modified index creation
10-
bgzip -c test.vcf > test.vcf.gz\
11-
tabix -p vcf test.vcf.gz\
12-
./minimap2 -d test/test.modified.mni --vcf-file-with-variants test/test_long_chr1.vcf.gz test/test.fasta
7+
Minimap2_index_modifier can be used in the same way as the original minimap2.
8+
To create a modified index use additional parameter `--vcf-file-with-variants <vcf-file>`.
9+
```bash
10+
minimap2 -d index.mmi --vcf-file-with-variants input.vcf.gz reference.fasta
11+
```
1312

14-
Use flag --parse-haplotype if your VCF contains phased haplotypes
13+
Use flag `--parse-haplotype` if your VCF contains phased haplotypes.
1514

16-
## Run test
15+
## Contents
16+
* [Installation](#installation)
17+
* [Compiling from source](#compiling-from-source)
18+
* [Docker](#docker)
19+
* [Pre-built indexes](#pre-built-indexes)
20+
* [Tests](#tests)
1721

18-
### Empty test
19-
./minimap2 -d test/test.mni test/test.fasta\
20-
./minimap2 -d test/test.modified.mni --vcf-file-with-variants test/empty.vcf.gz test/test.fasta\
21-
diff test/test.mni test/test.modified.mni
22+
## Installation
23+
### Compiling from source
24+
To compile from source, use this version of tools:
2225

26+
* GCC/G++ 11.4.0+
27+
* HTSlib v1.17
2328

24-
### The same test
25-
./minimap2 -d test/test.mni test/test.fasta\
26-
./minimap2 -d test/test.modified.mni --vcf-file-with-variants test/test_long_chr1_the_same.vcf.gz test/test.fasta\
27-
diff test/test.mni test/test.modified.mni
29+
Command to compile:
30+
```bash
31+
cd minimap2_index_modifier && make
32+
```
33+
34+
### Docker
35+
Clone this repository and build a Docker image as follows.
36+
```bash
37+
docker build -t minimap2_index_modifier:2.24 .
38+
```
39+
40+
## Pre-built indexes
41+
This [link](https://nextcloud.ispras.ru/index.php/s/wcb9PpZyr8Gb5CC) contains pre-built modified indexes for next references:
42+
* GRCh38 [(GCA_000001405.15)](https://ftp-trace.ncbi.nlm.nih.gov/giab/ftp/release/references/GRCh38/)
43+
* GRCh37 [(hs37d5)](https://ftp-trace.ncbi.nlm.nih.gov/giab/ftp/release/references/GRCh37/)
44+
45+
## Tests
46+
See [test/tests.md](test/tests.md) for more details.
2847

29-
### Not the same test
30-
./minimap2 -d test/test.mni test/test.fasta\
31-
./minimap2 -d test/test.modified.mni --vcf-file-with-variants test/test_long_chr1_not_the_same.vcf.gz test/test.fasta\
32-
diff test/test.mni test/test.modified.mni

test/README.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
## Tests for minimap2_index_modiifer
2+
There are three tests to check base functionality.
3+
4+
### Common test
5+
This test create two index files: regular and modified.
6+
```bash
7+
minimap2 -d test/test.mni test/test.fasta
8+
minimap2 -d test/test.modified.mni --vcf-file-with-variants test/test_long_chr1_not_the_same.vcf.gz test/test.fasta
9+
diff test/test.mni test/test.modified.mni
10+
```
11+
12+
Modified index file should contains extra string and some strings should be mismatched.
13+
14+
### Empty VCF test
15+
If input VCF file contains no variants from reference modified index would be same as regular one.
16+
```bash
17+
minimap2 -d test/test.mni test/test.fasta
18+
minimap2 -d test/test.modified.mni --vcf-file-with-variants test/empty.vcf.gz test/test.fasta
19+
diff test/test.mni test/test.modified.mni
20+
```
21+
22+
Index files should be the same (empty output after third command).
23+
24+
### Pseudo-variants test
25+
In this test `test/test_long_chr1_the_same.vcf.gz` contains pseudo-variants (like A -> A, C -> C, etc). This variants would be processed with no effect.
26+
```bash
27+
minimap2 -d test/test.mni test/test.fasta
28+
minimap2 -d test/test.modified.mni --vcf-file-with-variants test/test_long_chr1_the_same.vcf.gz test/test.fasta
29+
diff test/test.mni test/test.modified.mni
30+
```
31+
32+
Index files should be the same.

0 commit comments

Comments
 (0)