Code Monkey home page Code Monkey logo

gfa_annotate's Introduction

gfa_annotate

Translate gene annotation (intervals) from a bed format to the node id space of a variation graph. The bed format is only allowed to have of four columns (see below).

If you want to convert gff to bed file, use the gff2bed.py script

Help message:

gfa_annotate 0.1.0

Sebastian V

Overlap annotation and genome graphs

USAGE:
    gfa_annotate -g <gfa> -b <bed> -o <output>

FLAGS:
    -h, --help       Print help information
    -V, --version    Print version information

Input:
    -b <bed>        bed file
    -g <gfa>        input gfa

Additional features:
    -f, --fraction    Report fraction of how much is covered
    -l, --length      Report length in the table

Output:
    -o <output>        Output file

Example input BED format:

  • Tab-separated
  • Only four columns

Example:

TAIR10 100 200 gene
OR
TAIR10 250 350 AT1234

Output

Col Type Description
1 int Node id
2* String list Type
3 int Length (opt)

*If the fraction parameter is set, the fraction value in added after the entry. If the same entry has two different fractions, entry is represented twice with different fractions. Must be here because it is specific to the annotation and not the node.

Example (header for understanding):

Default

Node id Feature
11 AT1234
12 AT14213, AT4321

With fraction and length:

node id Feature;Fraction,[] Length
11 AT1234;1 21
12 AT14213;0.75,AT4321;1 4

gff2bed.py information

Requirements:

  • python3
  • argparse
  • logging

Pre-processing:

usage: gff2bed.py [-h] -g GFF [-a ATTRIBUTE] -o OUTPUT

optional arguments:
  -h, --help            show this help message and exit
  -g GFF, --gff GFF     Gff file
  -a ATTRIBUTE, --attribute ATTRIBUTE 
                        Extract this attribute (except of type)
  -o OUTPUT, --output OUTPUT
                        Output file

Post-processing:

If you want the inverse: "Which feature/attribute is covered by which node?", you can use this python script.

usage: attribute2node.py [-h] -i INPUT -o OUTPUT

optional arguments:
  -h, --help            show this help message and exit
  -i INPUT, --input INPUT
                        gfa_annotate output file
  -o OUTPUT, --output OUTPUT
                        Output file

Adding intergenic information to the node -> feature data:

Testing

Check out ./data/exmaple_data/

cargo test

Additional information:

How many nodes are not fully covered?

Annotation from one accession: test2

Annotation from all accessions: test1!

TODO

  • Feature --> Node list (inverse of the output right now)
  • Report stuff which is not covered by anything (like report all nodes no matter what)
  • Update plots + the pipeline the plots were created.

gfa_annotate's People

Contributors

moinsebi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.