Giter VIP home page Giter VIP logo

vcf2fasta's Introduction

vcf2fasta.pl

Converts a VCF file to a FASTA alignment provided a reference genome and a GFF file

Given a FASTA reference genome, a multi-sample VCF file and a GFF file, this script will generate FASTA alignments of any feature found in the GFF file; for instance, coding sequences (CDS). Gene names will be taken from the first id in field 9 of the GFF. It is important that the GFF file is sorted by position. The script will take diploid, phased, and/or haploid data. It is important to note that the script currently only takes very standard VCF formats; for instance, those generated by haplotype-based algorithms (HaplotypeCaller and FreeBayes), which include gaps and multi-nucleotide variants, will not work.

Installation

git clone https://github.com/santiagosnchez/vcf2fasta
cd vcf2fasta
chmod +x vcf2fasta.pl
sudo cp vcf2fasta.pl /usr/local/bin

Running the code

Use the -h flag for more details:

perl vcf2fasta.pl -h
Usage:
perl vcf2fasta.pl -f <fasta-ref> -v <vcf-file> -g <gff-file> -e <gff-feature> [ --ref ] [ --phased ]

option --ref will include the reference sequence.
option --phase informs the program that the VCF is pased.
defaults ignore the two options.

examples:
perl vcf2fasta.pl -f ref.fas -v snps.vcf -g annotation.gff -e CDS
perl vcf2fasta.pl -f ref.fas -v snps.phased.vcf -g annotation.gff -e CDS --phased
perl vcf2fasta.pl -f ref.fas -v snps.phased.vcf -g annotation.gff -e CDS --phased --ref

Note: Working on a Python version...

vcf2fasta's People

Contributors

santiagosnchez 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.