Skip to content

Commit

Permalink
Consolidate web version, update to python3 (#22)
Browse files Browse the repository at this point in the history
* Initial consolidation from assemblytics_web

* Clean up code and merge best of web and CLI versions in scripts

* Fix PHP placement, update README, clean up more code.

* Clean up

* Use Rscript using shebang line in R scripts; handle availability error in main Assemblytics script.

* Convert all python scripts to python3 syntax.

* Make python scripts compatible with python 2 AND 3.
  • Loading branch information
MariaNattestad authored Dec 7, 2019
1 parent df5361f commit 594bf1c
Show file tree
Hide file tree
Showing 42 changed files with 4,499 additions and 490 deletions.
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
public/user_data/*
!public/user_data/.htaccess
public/user_uploads/*
!public/user_uploads/.htaccess


*.delta
!public/sample.delta
python_env
reproducibility

8 changes: 8 additions & 0 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
RewriteEngine On
RewriteBase /assemblytics/

RewriteCond %{THE_REQUEST} /public/([^\s?]*) [NC]
RewriteRule ^ %1 [L,NE,R=302]

RewriteRule ^((?!public/).*)$ public/$1 [L,NC]

156 changes: 0 additions & 156 deletions Assemblytics_variant_charts.R

This file was deleted.

22 changes: 22 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

The MIT License (MIT)

Copyright (c) 2016 Maria Nattestad

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.
42 changes: 35 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,47 @@ Assemblytics is available online at http://assemblytics.com

Please cite our paper in Bioinformatics: http://www.ncbi.nlm.nih.gov/pubmed/27318204

If you prefer to run Assemblytics from the command-line this repository contains all the code, from unique anchor filtering and calling variants to creating the output plots and summary tables.
The preprint is still freely available on the BioRxiv: https://www.biorxiv.org/content/10.1101/044925v1

The whole web application can also be downloaded and run locally, utilizing the graphical user interface and giving the added benefit of the interactive dot plot which is only available in the web version: https://github.com/marianattestad/assemblytics_web
There are three ways to use Assemblytics:
1. Use the hosted online version at http://assemblytics.com. This is the easiest option.
2. Run it from the command-line. For this you need only the contents of the `scripts/` directory. See instructions below.
3. Run the full web app from a local server. See instructions below.

Important: Use only contigs rather than scaffolds from the assembly. This will prevent false positives when the number of Ns in the scaffolded sequence does not match perfectly to the distance in the reference.

To run Assemblytics on the command-line, simply copy all the scripts in this repository into your path and make them executable (chmod +x script_name) if necessary.
## Dependencies
- R
- ggplot2
- plyr
- RColorBrewer
- scales
- Python
- argparse
- numpy

Follow the instructions at http://assemblytics.com for how to prepare your data and get a delta file for Assemblytics.
## Command-line instructions
If you prefer to run Assemblytics from the command-line the scripts/ directory contains all the code you need, from unique anchor filtering and calling variants to creating the output plots and summary tables.

Then run as:
To run Assemblytics on the command-line, keep all the scripts together inside the `scripts/` directory, either in your PATH or anywhere else you like, and make them all executable:
```
chmod a+x scripts/Assemblytics*
```
Assemblytics delta_file output_prefix unique_anchor_length path_to_R_scripts
Keeping the scripts together in the same folder will allow the main `Assemblytics` script to call all the other scripts that do filtering, analysis, indexing, and plotting.

Follow the instructions at http://assemblytics.com for how to prepare your data and get a delta file for Assemblytics.

Then run Assemblytics:

```
scripts/Assemblytics <delta_file> <output_prefix> <unique_anchor_length> <min_variant_size> <max_variant_size>
```

Important: Use only contigs rather than scaffolds from the assembly. This will prevent false positives when the number of Ns in the scaffolded sequence does not match perfectly to the distance in the reference.
## Local web app instructions
The whole web application can be downloaded and run locally, utilizing the graphical user interface and giving the added benefit of the interactive dot plot which is only available in the web version and cannot run from the CLI.

Notes for installation:
- Use a local server like [Apache](https://www.apachefriends.org/download.html) and follow the instructions there.
- Clone this repository into a folder called `assemblytics`, to make the `.htaccess` file point the server correctly to the `public/` folder, where the index.php and other pages and web app resources are located.
- Make sure to open up permissions in user_uploads and user_data so the webserver can read and write there.
- It does not contain the examples as some of these are huge files.
22 changes: 22 additions & 0 deletions public/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Assemblytics (full web application)

This repo contains the full Assemblytics web application.
The web app is running on assemblytics.com, and the command-line version is available at https://github.com/marianattestad/assemblytics
This repository exists so you can install it on your own servers or locally on your computer if need be.
The code here includes the interactive dot plot (which you can't use from the command-line version).

Dependencies:
- R
- ggplot
- plyr
- Python
- argparse
- numpy


Notes for installation:
- Make sure to open up permissions in user_uploads and user_data so the webserver can read and write there.
- It does not contain the examples as some of these are huge files.



Loading

0 comments on commit 594bf1c

Please sign in to comment.