Code Monkey home page Code Monkey logo

pystrand's Introduction

PyStrand

Python scripts for changing strand orientation of a VCF file (non-Illumina format [ACGT]) containing bi-allelic SNVs only:

  1. Complementer (complement.py) will swap the VCF strand based on it self (Complementing the REF/ALT).
  2. Conditional complementer (conditional_comeplement.py) will swap strand to match another vcf file.

NB. This script only works for BiAllelic SNVs (for INDEL or multi allelic might need adjustment) NB. Feed the files to the script in an increasing order of VCF length. (small match to large)

Extensive use of the following libraries:

  1. PyVCF https://pyvcf.readthedocs.io/en/latest/INTRO.html#
  2. BioPython https://biopython.org/
  3. Pandas http://pandas.pydata.org/

Example of output vcf file (only the first 5 columns) and the compasrion with the input files:

#################################################Conditioned OUT_VCF first 20 rows minus the header:
#####################e.g. position 89725#########
#CHROM	POS	ID	REF	ALT
1	83412	BovineHD0100000027	A	G
1	89725	BovineHD0100046367	G	A
1	100260	BovineHD0100000030	A	.
#################################################The second IN_VCF2:
#CHROM	POS	ID	REF	ALT
1	1	BovineHD0100028526	G	A
1	3	BovineHD0100009498	A	G
1	5	BovineHD0100016113	G	A
1	6	BovineHD0100016967	G	A
1	16947	BovineHD0100000005	C	A
1	36337	BovineHD0100000015	A	G
1	67130	BovineHD0100000024	A	.
1	78655	BovineHD0100000026	A	G
1	83412	BovineHD0100000027	A	G
1	89725	BovineHD0100046367	G	A
1	100260	BovineHD0100000030	A	G
#################################################The first IN_VCF1:
#CHROM	POS	ID	REF	ALT
1	83412	BovineHD0100000027	A	G
1	89725	BovineHD0100046367	C	T
1	100260	BovineHD0100000030	T	.

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.