GithubHelp home page GithubHelp logo

bhavana-krishnan / positionweightmatrix Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 92 KB

A position weight matrix (PWM), also known as a position-specific weight matrix (PSWM) or position-specific scoring matrix (PSSM), is a commonly used representation of motifs (patterns) in biological sequences. This repository is aimed at generating PWMs for a given set of sequences.

Python 100.00%

positionweightmatrix's Introduction

Position Weight Matrix

This Project is aimed at developing Object Orineted Programming for Position Weight Matrix (PWM) using Python. This repository contains two scripts. First script can generate the Position Frequency Matrix, Position Probability Matrix and the Position Weight Matrix. The second script uses Biopython module to generate the above three. Additionally, pseudocounts can be used if required and scores for each sequence is obtained from the matrix generated from the given set of input sequences.

A position weight matrix (PWM), also known as a position-specific weight matrix (PSWM) or position-specific scoring matrix (PSSM), is a commonly used representation of motifs (patterns) in biological sequences.

PWMs are often derived from a set of aligned sequences that are thought to be functionally related and have become an important part of many software tools for computational motif discovery. For more details on PWM and its calculations, Please refer to Position Weight Matrix

Logical Calculation of PWM

The Flowchart below depicts how the PWM is calculated. alt text

Requiremnets

The following are the required packages and can be installed using the command "pip install <package_name>"

Package:package_name
  • BioPython:Bio
  • Numpy:numpy
  • Pandas:pandas

How to run the script?

To Obtain Position Weight Matrix:

  • The input to be given for the script "PositionWeightMatrix.py" is a list of sequences with uniform length and can be given as input while creating an instance.
  • Please refer to creating instance and Object Instance Sections in the script for modifications of input and instances.
  • Then, run the script using "python PositionWeightMatrix.py"

To Obtain PWM Score for each sequence from Matrix:

  • The input for the script "PWM_Score.py" is a file with sequences of uniform length. Therefore, the infile and the outfile path have to be updated in the script.
  • Example Input file "exampleseqs.txt" is provided in this repository for reference.
  • The pseudocouts if any, can be modified in this script. This script uses BioPython Package.
  • Then, run the script using "python PWM_Score.py"

Results

  • The script "PositionWeightMatrix.py" can generate PFM, PPM AND PWM using methods .getPFM(), .getPPM() and .getPWM() respectively.
  • The script "PWM_Score.py" gives an output file "exampleseqsscore.txt" with a PWM score generated for each sequence based on the PWM Matrix.

positionweightmatrix's People

Contributors

bhavana-krishnan 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.