Skip to content

Commit

Permalink
Merge pull request #26 from JbaptisteLam/master
Browse files Browse the repository at this point in the history
Version 1.1 release
  • Loading branch information
JbaptisteLam authored Mar 29, 2023
2 parents 96c1c14 + 87a61ca commit 3dee9ce
Show file tree
Hide file tree
Showing 59 changed files with 2,145 additions and 1,511 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
__pycache__/
*.egg-info/
*.tar.gz
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM python:3.9.16

LABEL maintainer="Jean-Baptiste Lamouche"
LABEL name="[email protected]"

#Install vcf2circos
RUN pip install git+https://github.com/JbaptisteLam/vcf2circos@manuscript

#Download config
RUN wget https://www.lbgi.fr/~lamouche/vcf2circos/config_vcf2circos_29032023.tar.gz

#Untar config
RUN tar -xzf config_vcf2circos_29032023.tar.gz

#Set configuration path
RUN sed -i 's,\"Static\": \"/enadisk/maison/lamouche/dev_vcf2circos/Static\"\,,\"Static\": \"/Static\"\,,' /Static/options.json

ENTRYPOINT ["vcf2circos"]

187 changes: 112 additions & 75 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,74 @@ See documentation and code in [GitHub vcf2circos](https://github.com/bioinfo-chr

This package is based on [PCircos](https://github.com/CJinnny/PCircos) code

```
-._ _.--'"`'--._ _.--'"`'--._ _.--'"`'--._ _
'-:`.'|`|"':-. '-:`.'|`|"':-. '-:`.'|`|"':-. '.` : '.
'. '. | | | |'. '. | | | |'. '. | | | |'. '.: '. '.
: '. '.| | | | '. '.| | | | '. '.| | | | '. '. : '. `.
' '. `.:_ | :_.' '. `.:_ | :_.' '. `.:_ | :_.' '. `.' `.
`-..,..-' `-..,..-' `-..,..-' ` `
__ ___ _
/ _|__ \ (_)
__ _____| |_ ) |___ _ _ __ ___ ___ ___
\ \ / / __| _| / // __| | '__/ __/ _ \/ __|
\ V / (__| | / /| (__| | | | (_| (_) \__ \
\_/ \___|_| |____\___|_|_| \___\___/|___/
Author: Jean-Baptiste Lamouche, Antony Le Bechec, Jin Cui
Version: 1.1
Last update: Mars 26 2023
usage: python vcf2circos.py [-h] -i INPUT -o OUTPUT [-e EXPORT] [-p OPTIONS] [-a ASSEMBLY]
optional arguments:
-h, --help show this help message and exit
-i INPUT, --input INPUT
Input vcf File
VCF SHOULD be multiallelic split to avoid trouble in vcf2circos
example: bcftools -m -any <vcf>
Format will be autodetected from file path.
Supported format:
'vcf.gz', 'vcf'
-o OUTPUT, --output OUTPUT
Output file.
Format will be autodetected from file path.
Supported format:
'png', 'jpg', 'jpeg', 'webp', 'svg', 'pdf', 'eps', 'json'
-e EXPORT, --export EXPORT
Export file.
Format is 'json'.
Generate json file from VCF input file
-p OPTIONS, --options OPTIONS
Options file in json format
-a ASSEMBLY, --assembly ASSEMBLY
Genome assembly to use for now values available (hg19, hg38)
```

![Doc Circos](docs/circos_help.png)
<br/>

# Installation

## Git clone
## Git clone and Pip

Download package source files.

```
$ git clone https://github.com/bioinfo-chru-strasbourg/vcf2circos.git .
```

## Pip

Compile source using Pip to generate binary "vcf2circos"

```
$ python -m pip install -e .
```

## Docker

Build docker image "vcf2circos:latest"
Build docker image "vcf2circos:latest"
From inside cloned repository

```
$ docker-compose build
$ docker image build -t vcf2circos:latest .
```

## Configuration folder
Expand All @@ -42,8 +82,7 @@ Configuration files could be download here: [vcf2circos-config](http://www.lbgi.
```
tar -xzf <tarballname> <folder>
```
Regarding where you place your configuration folder previously downloaded, you need to specify the absolute path of the Static folder in "Static" json key (which will replace default value "config/Static")<br><br>
An <b>example VCF</b> is also available in the configuration folder called example.vcf
Regarding where you place your configuration folder previously downloaded, you need to specify the absolute path of the Static folder in "Static" json key (which will replace default value)<br><br>

<br/>

Expand All @@ -52,35 +91,21 @@ An <b>example VCF</b> is also available in the configuration folder called examp
## Binary

```
$ vcf2circos --input config/Static/example.vcf.gz --options config/Static/options.json --output <outputpath>.html
$ vcf2circos --input config/Static/example.vcf.gz --options <jsonfile> --output <outputpath>.html -a <assembly hg19 or hg38>
```

## Docker

```
$ docker run -v $(pwd):/data vcf2circos:latest --input=demo_data/example.vcf.gz --output=/data/example.vcf.gz.html --options=demo_data/options.example.json
```

## Python

```
$ python vcf2circos/__main__.py --input config/Static/example.vcf.gz --options config/Static/options.json --output <outputpath>.html
$ docker run -it --rm vcf2circos:1.1 -i <input.vcf> -o <output.html> -p /Static/options.json -a hg19
```

<br/>


# Input

This package allows multiple input formats:
- VCF including SNV/InDel/SV (see [VCF specifications](https://samtools.github.io/hts-specs/VCFv4.2.pdf)). Header needs to contain contigs (in order of appearance). See [VCF example](demo_data/example.vcf.gz).
- JSON configuration file (see [PCircos](https://github.com/CJinnny/PCircos) documentation). See [JSON configuration example](demo_data/demo_params.json).

Format will be autodetected from file path.

- VCF including SNV/InDel/SV (see [VCF specifications](https://samtools.github.io/hts-specs/VCFv4.2.pdf)). Header needs to contain contigs (in order of appearance). See [VCF example](tests/example.vcf).

<br/>

Expand All @@ -91,17 +116,9 @@ This package generates Circos plot in multiple formats (html, png, jpg, jpeg, we
- Image files (i.e. png, jpg, jpeg, webp, svg, pdf, eps). See [PNG example](docs/refontcircos.png) and [PDF example](docs/refontcircos.pdf)
- JSON Plotly file (see [Plotly documentation](https://plotly.com/)).

Format will be autodetected from file path.

Output Circos plot sections from a VCF file:
![Doc Circos](docs/docs.circos.png)


<br/>

# Export

Circos plot generated from VCF file can be exported as JSON configuration file, for further use. See [JSON configuration export example](demo_data/example.vcf.gz.export.json)
![Doc Circos](docs/circos.png)


<br/>
Expand All @@ -113,36 +130,53 @@ Circos plot generated from a VCF file can be configured using a JSON options fil
Here is an example of a JSON options file:
```
{
"General": {
"title": "",
"width": 1200,
"height": 1200,
"plot_bgcolor": "white"
},
"Static": "config/Static",
"Assembly": "hg19",
"Chromosomes": {
"cytoband": "True",
"list": ["chr1", "chrX"]
},
"Genes": {
"only_snv_in_sv_genes": false
},
"Variants": {
"annotations": {
"fields": ["SVTYPE", "SVLEN"]
},
"rings": {
"position": 0.4,
"height": 0.04,
"space": 0.01,
"nrings": 6
}
},
"Extra": [
"gc"
]
}
"General": {
"title": "",
"width": 1000,
"height": 1000,
"plot_bgcolor": "white"
},
"Static": "<path of config>",
"Assembly": "hg19",
"Chromosomes": {
"list": ["chrX"],
"all": false
},
"Genes": {
"only_snv_in_sv_genes": false,
"extend": false
},
"Variants": {
"annotations": {
"fields": [
"REF",
"ALT",
"Tx",
"SV_length",
"SVLEN",
"END",
"CN",
"Gene_name",
"Gene_count",
"DDD_HI_percent",
"OMIM_morbid",
"GnomAD_pLI",
"LOEUF_bin",
"AnnotSV_ranking_criteria",
"ACMG_class"
]
},
"rings": {
"position": 0.5,
"height": 0.04,
"space": 0.01,
"nrings": 6
}
},
"Extra": [
"gc"
],
```

<br/>
Expand Down Expand Up @@ -174,8 +208,8 @@ Example:
```
"General": {
"title": "",
"width": 1400,
"height": 1400,
"width": 1000,
"height": 1000,
"plot_bgcolor": "white"
}
```
Expand All @@ -202,17 +236,20 @@ The "list" option define the list of chromosomes to show in the Circos plot. Ord

## Genes section

The "Genes" section defines information about Genes (e.g. refGene data, list of genes to show). These information are used to annnotate variants (SNV and SV), and are used with algorithms highlight interesting information (e.g. only SNV on CNV genes). They also can be shown in the Circos plot (below Chromosomes ring)
The "Genes" section defines information about Genes (e.g. refGene data, list of genes to show). These information are used to annnotate variants (SNV and SV), and are used with algorithms highlight interesting information (e.g. only SNV on CNV genes). They also can be shown in the Circos plot (below Chromosomes ring)
only_snv_in_sv_genes: display only snv indels located inside SV boundaries
extend: display genes located 1Mb in upstream and downstream of SV boundaries

```
"only_snv_in_sv_genes": true
}
"only_snv_in_sv_genes": true,
"extend": true
```
### List of genes

The "list" option defines the list of genes to show in the Circos plot, below Chromosomes/Cytoband ring. This list refers to the "gene" column in the data.

<br>
</br>

### Filter SNV on CNV genes

The "only_snv_in_sv_genes" option will select (and show) only SNV that are located on genes mutated with at least 1 SV.
Expand Down
Binary file removed dist/vcf2circos-2.1.1-py3-none-any.whl
Binary file not shown.
47 changes: 0 additions & 47 deletions docker-compose.yml

This file was deleted.

Empty file removed docker/.env
Empty file.
Loading

0 comments on commit 3dee9ce

Please sign in to comment.