https://github.com/qbicsoftware/mtb-parser-lib
A simple module for diagnostic variant information parsing
https://github.com/qbicsoftware/mtb-parser-lib
cnv other parser python snv tumor
Last synced: 5 months ago
JSON representation
A simple module for diagnostic variant information parsing
- Host: GitHub
- URL: https://github.com/qbicsoftware/mtb-parser-lib
- Owner: qbicsoftware
- License: mit
- Created: 2017-12-27T08:45:15.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-12-02T13:18:06.000Z (over 7 years ago)
- Last Synced: 2025-12-01T23:54:15.902Z (7 months ago)
- Topics: cnv, other, parser, python, snv, tumor
- Language: Python
- Homepage:
- Size: 86.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# qbic.mtbparser
[]()
[](https://travis-ci.org/qbicsoftware/mtb-parser-lib.svg?branch=master)
[](https://codecov.io/gh/qbicsoftware/mtb-parser-lib)
[](https://github.com/qbicsoftware/qbic.mtbparser/releases)
[](https://pypi.python.org/pypi/mtbparser/0.2)
[]()
A simple module that provides parser for different diagnostic variant information as part of the Molecular Tumor Board data provisioning in Tübingen.
## Documentation
File formats for
* [Somatic SNVs](./docs/somatic_snvs.md)
* [Somatic CNVs](./docs/cnvs.md)
* [Somatic structural variants](./docs/structural_variants.md)
* [Germline SNVs](./docs/germline_snvs.md)
* [Germline CNVs](./docs/cnvs.md)
* [Metadata](./docs/metadata.md)
Python class info
* SnvParser
### How to use the SnvParser class
Parsing a SNV file following the formats described above is fairly simple. Just create an ``SnvParser`` object with the path to the ``tsv``-file and specify its type by providing the correct header (``SSnvHeader, GSnvHeader, ...``).
```python
from mtbparser.snv_parser import SnvParser
from mtbparser.snv_utils import SSnvHeader
# Path to a valid SNV tsv file, as specified in
# the file format documentation.
somatic_snv_file = "/path/to/mySSnv.tsv"
# Create parser object for somatic SNVs
parser = SnvParser(somatic_snv_file, SSnvHeader)
# Iterate through parsed SNV items and get the gene name
for snv_item in parser.getSNVs():
print(snv_item.get_snv_info(SSnvHeader.GENE.name))
```
## Author
This code implementation was done at the [Quantitative Biology Center](http://qbic.life). Please contact the author [@sven1103](https://github.com/sven1103) for more information.
## Changelog
### v0.2.7
Rename enums, so their names and values are equal.
### v0.2.6
You can now extract a copy of the complete SNV Item information as dictionary.
### v0.2.5
Bugfix: parsing of empty first columns failed because of the usage of strip() function. Columns can be empty, if they contain no information, so trimming whitespaces leads to a wrong total column number. We use rstrip() now, to remove escape characters and trailing whitespaces.
### v0.2.4
Fixed typo in 'tumor_content' definition in the metadata section.
### v0.2.3
Just v0.2.2, but had to rename the version on PyPi
### v0.2.2
Reading of files failed, because Python expects ACII encoding by default. Now, files are explicitely opened with utf-8 encoding.
### v0.2.1
Installation with ``pip`` failed, because the DESCRIPTION.rst for the module description was not provided in the sdist package.
### v0.2
The first _production-ready_ version of ``mtbparser``, that is also deployed on PyPI. Only updated documentation and proper formatting for PyPI deployment.
### v0.1dev
A first develeopment version, should work, tests are good, coverage > 90%.