Giter Site home page Giter Site logo

ptdolan / cirquestdsv Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 1.0 495.01 MB

Annotation and Analysis of Deep Sequencing Variants from CirSeq

Home Page: ptdolan.github.io/CirQuestDSV

Python 34.65% R 38.07% Jupyter Notebook 27.20% Shell 0.08%
python analysis sequencing deep rna-sequencing population-genetics r ggplot2

cirquestdsv's Introduction

CirQuestDSV

===========

Description:

This is a repository for code related to analysis of Circular Resequencing data. Code is written in python and R. Original CirSeq paper is here.

All code in this repository is intended for use downstream of Q-threshold count table generation by the CirSeq software package.

This package currently contains two main scripts: Q20Analysis.py: an annotation program for analyzing the output of CirSeq ('"Q" files') and annotating coding regions, translating ORFs, and annotating biophysical characteristics of the substitutions. AnnotAnalysis.R: An R script for generating a collection of summary plots and data tables based on the naming scheme of the Input Directory. It generates the following:

  • In CirQuestDSV_tables directory:

    • A table of high frequency mutations.
    • An agglomerated q20annot file in an .RData format. Useful for further analysis in R, without reloading the dataset.
  • In Entropy directory:

    • Plots of the Shannon entropy (scaled 0-1) for each nucleotide position in the genome.
  • In CirQuestDSV_figures directory:

    • Frequency plots of the frequency of individual alleles cross the genome.
    • Trajectories for labeled passages (see below.)
    • MDS and PCA dimension reduction of all samples.

Please fork this project to improve annotation in the python portion ("Q20Analysis.py") or to develop analyses based on this data structure in R.

Requirements:

Python (3.X compliant) R

Usage:

Notes on file names:

  1. All input file names must end in "Q20.txt" or "Q20threshold.txt"! This makes sure that overwriting does not occur when output files and input files are in the same directory.

  2. Each input file requires specific naming for grouping and plotting features. these will also be parsed for data table annotation. e.g.: "~/pathto/myData/MouseAplusTreatment_1-Q20.txt"

  3. For grouped passages: In order for files to be grouped correctly in trajectory plots, files in directory must be labeled "MYHEADERTEXT_1-Q20.txt","HEADERTEXT_2-Q20.txt","HEADERTEXT_3-Q20.txt",..., where HEADERTEXT denotes any sample information (can include special characters (except "_" and "-"). **Those files that do not match criteria (passage number at a minimum) are excluded from trajectory plots. Including MYHEADERTEXT is optional but useful for labeling if no header needed, "1-Q20.txt","2-Q20.txt","3-Q20.txt" is sufficient for grouping.

Usage instructions:

  1. Open a terminal in the same directory as the scripts and run:

    python Q20Analysis.py <directory with q20 files> <translation start> <translation end> <next ORF start> <next ORF stop> and so on...

    This generates an annotated q20 ("-q20annot.txt") file. You can stop here and use this annotated file for interpretation, or you can use this enhanced q20 to generate plots with the associated R script, "AnnotAnalysis.R".

  2. "AnnotAnalysis.R". This program reads a directory of annotated files and combines them to generate frequency plots, trajectory plots, it also performs dimension reduction analysis and outputs a number of useful output files.

with R installed, in command line:

Rscript ./path/to/AnnotAnalysis.R ./pathto/q20annots/

or:

R

then, in R:

source("./path/to/AnnotAnalysis.R","./pathto/q20annots/")

----------------------------------------

MIT License

Copyright (c) [2016-2017] [Patrick T. Dolan]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

cirquestdsv's People

Contributors

ptdolan avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

yinghongxiao

cirquestdsv's Issues

Mapping non-overlapping multiple reading frames

These are comment based on discussions with Peter and Zach:
Is it possible to plot all non-overlapping ORFs?
What to do when overlapping?
What about positive vs. negative stranded viruses?
Currently, needs to be given as positive for translation, technically could reverse strandedness automatically when given descending ORFs.

Issues!

Hi Patrick,
This script works. However, for me, in output files it only generated figure(one Manhattaanplot and one Entropy) and table for last passage if I have multi-Q20s. And No DirFre_table or Figure generate.
What I did:
I did Q20Analysis.py, it works well.
I only changed one line in Rscript: rootDir<- "/Users/yinghongxiao/desktop/Miseq_test/
Then I did

R
source("AnnotAnalysis.R")

Best,
Hong

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.