Commit 2680df23 authored by MARIJON Pierre's avatar MARIJON Pierre

Initial commit

parents
# Created by https://www.gitignore.io/api/python
### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# dotenv
.env
# virtualenv
.venv/
venv/
ENV/
# Spyder project settings
.spyderproject
# Rope project settings
.ropeproject
# End of https://www.gitignore.io/api/python
# paf2gfa
Convert paf in gfa of overlap
## Instalation
After colling this repository, run :
```
pip install -r requirements.txt
```
## Usage
```
paf2gfa {paf_path} {gfa_path}
```
#!/usr/bin/python3
import begin
import pandas
@begin.start
def main(paf: 'Input file', gfa: 'Output file'):
paf_data = pandas.read_csv(paf, sep="\s+", header=None, usecols=(0,4,5))
segment = set()
links = set()
for row in paf_data.itertuples():
segment.add(row._1)
segment.add(row._3)
links.add((row._1, row._3, row._2))
with open(gfa, "w") as out_file:
for seg in segment:
out_file.write("S\t{}\tACTG\tanything\n".format(seg))
for link in links:
out_file.write("L\t{}\t{}\t{}\t{}\t6M\tanything\n"
.format(link[0], link[2], link[1], link[2]))
appdirs==1.4.0
begins==0.9
numpy==1.12.0
packaging==16.8
pandas==0.19.2
pyparsing==2.1.10
python-dateutil==2.6.0
pytz==2016.10
six==1.10.0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment