GithubHelp home page GithubHelp logo

discoverydna / map_motif Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 5.0 4.91 MB

Map frequency matrices on sequence alignments.

Python 0.14% Jupyter Notebook 99.67% HTML 0.03% JavaScript 0.13% CSS 0.03%

map_motif's Introduction

Map Motif

About

This repository houses code that maps TFBS onto alignments. The purpose is to identify where TFBS are in an alignment. There are currently three aspects of the code, located in /code directory.

  1. the map+motif.py script that can be implemented in command line.
  2. motif_scoring_and_extraction.ipynb that is a jupyter notebook of the script for interactive coding and visualization
  3. The /D3_vis portion, which is a working project to visualize TFBS interactively in the browser.

map_motif.py

map_motif.py is a python script that has two inputs.

File Inputs:

  1. alignment (fasta)
  2. TFBS Position Frequency Matrix.

Arguments:

  1. alignment fasta file
  2. TFBS Position Frequency Matrix
  3. optional -threshold score cutoff (outputs only scores greater than the specified threshold)

File Outputs: -.csv file that outputs found TFBSs at each position, if any, in alignment.

Output data frame includes:

  • position
  • score
  • sequence entry
  • raw_position (from each sequence entry)
  • strand (which direction the motif was found)
  • motif_found (sequence motif at each postion)

The output file will be saved in directory script was ran.

Example output file: map_motif-alignment.fa-motif.fm.csv

To Run

python map_motif.py alignment.fa motif.fm 3.2

map_motif's People

Contributors

alexnakagawa avatar iamciera avatar isaakcagampangheller avatar jshi1010 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

map_motif's Issues

Read in only one raw sequence option

It would be cool to allow the program to run only one sequence. Maybe have the program print out the number of sequences it reads when running the program, so the user knows how may sequences it is running.

File input for Jupyter Notebook

The only way that the file input works for the Jupyter notebook implementation is that the files have to be in the same directory. See 'motif_mapping.ipynb`, first chunk.

We should have a variable that specifies 1. where the input files are and 2. where the output files should go.

clarification of line

I still don't know what this does

positions = {'score':score, 'position':position, 'species': i}
position_list.append(positions) 

line 136

map_motif.py table output to .csv

The file extension for the map_motif.py program say ".csv", but the file is tab separated. Either change the extension to .tsv or change the output to .csv file type.

Redundant files and organization

The code folder is a little crazy. attn: @alexnakagawa, @jshi1010

Few issues:

  1. What is the difference between these two files?
    motif_mapping.ipynb & Motif_Scoring_and_Extraction.ipynb. Is the motif_mapping file just for D3 building?

  2. Motif_Scoring_and_Extraction.ipynb filename should be lowercase: motif_scoring_and_extraction.ipynb

  3. We should split the command line code (map_motif.py) from the Jupyter notebook code and maybe even the an additional folder for D3 code. The structure could be py, ipynb, and D3. Thoughts?

Add print statements.

For the command line version. There are many things that need to be printed.

  • Like make sure the user is inputting alignment files. Maybe just checking if the files have "-" and print out if the sequences are NOT alignments. Or just print how many files and what type of files are read in
  • error messages (like "this is not a fasta file"
  • success print statement and tell user where output file is located.

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.