https://github.com/alexcoppe/vcfc
A C library for VCF files analyses
https://github.com/alexcoppe/vcfc
Last synced: 5 days ago
JSON representation
A C library for VCF files analyses
- Host: GitHub
- URL: https://github.com/alexcoppe/vcfc
- Owner: alexcoppe
- License: apache-2.0
- Created: 2019-10-31T21:32:44.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-06-30T10:31:37.000Z (11 months ago)
- Last Synced: 2025-02-17T09:35:29.005Z (3 months ago)
- Language: C
- Size: 69.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vcfc :dna:
A C library and programs for working with VCF files# Build from GitHub :floppy_disk:
```sh
git clone https://github.com/alexcoppe/vcfc.git
cd vcfc
make
```# Programs available :man_technologist:
## get_columns2
Shows only the columns you choose from a multi columns file (usually named cvs file). You have to choose the columns by numbers using the -f parameter. It works on a .vcf file and does not shows meta-information lines e.g. ##fileformat=VCFv4.2.
Option | What does it do
------------ | -------------
-h | Show help
-d | The field delimiter to use instead of the tab character
-f | The fields to be shown (separated by ,)##### Example
```console
>>> get_columns2 -f 2,1,3,4 input.txt
```## get_pass_variants
This program filters a VCF file showing only the ones with PASS (annotated by [SnpEff](https://pcingola.github.io/SnpEff/)) in the FILTER field.
Option | What does it do
------------ | -------------
-h | Show help##### Example
```console
>>> get_pass_variants mutations.vcf
```
## filter_vcf_by_bedFilter a VCF file using a BED file.
Option | What does it do
------------ | -------------
-h | Show help
-a | show the header in the filtered VCF```console
>>> filter_vcf_by_bed -a sample.bed variants.vcf
```
# Functions available 📚:The following table shows the available functions. If you want to see a detailed description of the functions go to the [library documentation](docs/library.md) page.
| Function | Description|
| ------------- |:-------------|
|[bed_entries](docs/library.md)|reads a file and returns an array of BedEntry pointers. Use a single free call to free the array|
|[get_format_fields](docs/library.md)|takes as input a pointer to a format string (var->format) or a sample string (like var->samples[0]) gotten from the Variant struct and returns an array of pointers to the format or sample fields|
|[get_variant_from_vcf_line](docs/library.md)|reads a single line from a VCF file and returns a Variant struct|
|[free_variant](docs/library.md)|frees the memory allocatated by the get_variant_from_vcf_line|
|[nice_print_variant](docs/library.md)|prints all the fields from a Variant struct|