Thursday, March 30, 2017

Creating the framework of the website

Problem: Figuring out what framework to use.
What to keep in mind: The framework needs to be written in python, it must have access to certain bioinformatic databases (Protein Data Bank, SWISS-PROT, Uniprot)

https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2773253/
Pylons project
Web2py
CherryPy
Galaxy
Biomart
Virtuoso
Waf
SCons
Ruffus
Paver
Snakemake
Grok
Nagare
First you need to download Django, this is a framework that has already been designed with python.
Connect django with database.
Steps here: https://docs.djangoproject.com/en/1.10/topics/install/#database-installation

Internalization (i18n) V. Localization (L10n)
Internalization is when you code something but you code it so that it can be adapted into another language. Localization is when you code in a way that can't be adapted into other languages, like if you put slang which is untranslatable into something you write.

Reviews of certain frameworks
https://www.quora.com/What-is-the-best-Python-web-app-framework-And-why
http://softwareengineering.stackexchange.com/questions/144878/understanding-blocking-and-non-blocking-frameworks
https://www.quora.com/What-is-full-stack-integration
You want a non blocking framework because it processes your query immediately.
Non blocking frameworks that can deal with a lot of traffic: Tornado
CMS: Content management system, allows users to add and subtract things on their own without the keeper of the website okaying it, like wikipedia kind of.
Full stack integration: When the coder is very skilled and knows front end and backend tecnologies and also knows multiple languages. So not me.
Bootstrapping is when you can access models, views, and controllers that have already been coded and enter them into your code. Less work.
Django is a good CMS framework to use that is easy to code and has many built in features, and another CMS framework is pyramid except pyramid has fewer built in features and allows for more flexibility when coding. If you really wanna costumise you should use pyramid. Pyramid is good for people who are working on API projects. Django+pyramid both are bootstrapping
Flask is good for simpler projects, good for fast projects, relatively new (2010).
Use cherrypy for smaller projects
Web2py has won the Bossie 2011 award and the 2012 technology of the year award.
Galaxy has confusing instructions and their website is not clear.
https://www.reddit.com/r/programming/comments/71qgc/which_web_framework_for_bioinformatics/
Web2py is simple and straigthfoward

Installing Pyramid:
In order to operate properly, you need to create a virtual environment which allows pyramid to run for a specific app or program rather than a whole system.
1. Go to terminal type in "pip install -U pyramid"


When creating a program you need multiple frameworks, you need a web framework (pyramid), you need a front end framework (HTML kickstart or bootstrap), downloaded Bootstrap,

When picking front and back end frameworks keep in mind community (how many people use it and how many people you can ask for help) and how easy it is to use. Comparison of back end (Laravel), also use PHP frameworks.  frameworks https://www.techempower.com/benchmarks/

Person who did something similar to what i want to do:
http://blog.hanfeisun.info/2012/12/cistome-finder/

What languages to code your backend in python however not the front end, Use CSS for front end.
https://www.quora.com/Which-programming-languages-are-front-end-and-which-ones-are-back-end

Front end v back end: From end is the appearance of the program, it is every thing asthetic, backend is the part of the program that takes input and spits out an answer or changes the page.
http://codeup.com/different-types-of-programmers-front-end-vs-back-end/

Frameworks and how they work:
Someone inputs a query on your website, then you take their query and it sends the query to the backend and then it sends the response to the web framework and it is displayed in the front end framework.

NEW FRAMEWORK: WeBIAS



Comparison:
http://www.infoworld.com/article/2622836/application-development/pillars-of-python--six-python-web-frameworks-compared.html


Abstract:
http://lymestats.tumblr.com/page/2

Sunday, January 29, 2017

How to run a code in terminal

Save the python code and name it in some folder on your desktop.
Go to terminal, go to shell in the toolbar and then click on import
Import the code you want to run
To import code:
cd location of file (i.e. desktop, documents, photos)
cd the name of the folder your file is in
 
python file.py

Then run that code in terminal (you can run some codes directly from IDLE however it's easiest to just run from terminal)
Save that code in terminal into the same folder you saved the python code in
Open the folder, double click on the code from terminal
It should open up in a tab on safari or google chrome whichever is in your settings

https://en.wikibooks.org/wiki/Python_Programming/Creating_Python_Programs

Issues:
I keep getting up to the point where I import the direct file, however for some reason it keeps saying invalid syntax. I do not know why this keeps happening.

Monday, January 23, 2017

Biopython beginner coding

Right now I am struggling with allowing for user input to be directly placed into the code.
So this would print "hello parv" if I input my name. However, with me for some reason whenever I try to code this it just prints hello and doesn't take my input into account. I've looked at a few different tutorials for coding for inputs and every time I try it on IDLE, it doesn't work.
http://anh.cs.luc.edu/python/hands-on/3.1/handsonHtml/io.html
Also, for some reason, I cannot import any modules. The website I look at for instruction which is directly from the python creators says you just write the keyword import followed by whatever you want to import. However, for some reason, it doesn't recognize the module I am trying to import, it seems like the IDLE program I am using to code is not attached to the python database.
https://docs.python.org/3/reference/import.html
I am starting to think that before I import a module I need to download it. However, now the issue is to find where I download the modules. From what I am currently reading on python, I might even need to download the ability to import.
https://docs.python.org/3/install/index.html?highlight=names%20modules

To do math on python:
From math import (enter math function)
ex) Enter the x value in radians not degrees.
You may not need to import from math depending on the function you are trying to complete.


https://docs.python.org/3.2/library/math.html#module-math

USER INPUT!
FINALLY FIGURED OUT HOW TO MAKE THE CODE TAKE USER INPUT. In order to make a function take user input you must have a question or statement followed by a ; or : or ? or ! some type of open end punctuation. Then you press enter, and beneath you can enter your input. Make sure the input matches the function perfectly.

BOLEAN PLUS USER INPUT

MORE complex Boolean with user input
 
Testing each of the conditions

https://docs.python.org/3/library/stdtypes.html
Python codes
https://wiki.python.org/moin/SimplePrograms

Monday, December 19, 2016

Setting up Biopython

http://www.codesdope.com/python-introduction
Open IDLE
When running a new file and trying to add it to the old code (if you have a new code that you are messing up, but you don't want to screw up your old code with all this clutter of failures, you create a new file and then

In python you have color code schemes
Keywords (orange):
'False', 'None', 'True', 'and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'nonlocal', 'not', 'or', 'pass', 'raise', 'return', 'try', 'while', 'with', 'yield'

Outputs (blue): 
Anything you write after print 
This will be the output:
In order to have a command executed to create an output you need the >>> you cannot have anything run if you just run it like this
 
You can write a new code here in a new file of IDLE, have it not run bc it has no arrows, then while in the new tab you click on run, up at the top there, then click on run module, it will ask you to save it, save it. Then it will run it in the main IDLE tab that runs all your instructions.  
To make a comment you need a # an then a comment, it will appear in red and it will not affect your code, it's just instructions for yourself. 
You can define variables and then manipulate them with commands making them add, subtract, divide or multiply. 
There are certain words that you cannot make variables, these are keywords and they appear in orange. Each one has a different function in python. 
You can get the code to identify what you are inputting (I don't understand the use of this yet). If you write, type and then a word, it'll identify it as string or str, if you write a number it'll say integer or int, if you write a decimaled number it will write float. 


Issues: because the website I am using to learn to code is made for python 2 and not python 3, some of the commands and syntax and just general rules for coding have been changed. So as I try to complete the excercises the website gives me, I need to modify the code and it takes many trial and errors before I manage to get it to complete the function I want it to. What I am currently trying to figure out is how to solve these two function because I've been working on getting them to work for the past hour and reading articles about the changes from 2 to 3 and I can't figure it out. 

https://docs.python.org/3.0/whatsnew/3.0.html
What has changed in python from 2 to 3. 
Help for beginner functions (colors) http://www.annedawson.net/Python3_Intro.htm
http://www.annedawson.net/Python3Programs.txt (example programs)


Sunday, December 11, 2016

Progress report 3

https://docs.google.com/presentation/d/1dQfjkiDvQALoH287uLhs4TDPdfTRDmXyto4qvGHUdmk/edit#slide=id.g1a0be35812_0_23

Sunday, December 4, 2016

Including Protein Structure and Docking sites in Website (RaptorX)

RaptorX is a free downloadable program which predicts the 3D protein tertiary model as well as possible binding sites. It also allows you to compare 2 or more protien structures through protein structure alignment. You send in your sequence (job) and then they will send you back "its secondary and tertiary structures as well as contact map, solvent accessibility, disordered regions and binding sites." In order to download the software you must be affiliated with an organization. Since I am not, after I have designed my website I need to "please send us your name, organization and your email address through contact us and we will do some internal setup so that you can download the software." 
Official Website: 
http://raptorx.uchicago.edu/
User guide: 
https://www.oregon.gov/OMD/OEM/docs/plan_train/RAPTOR/RAPTOR_User_Guide.pdf
Protein structure, modeling and applications:
https://www.ncbi.nlm.nih.gov/books/NBK6824/

ProDy:
https://pypi.python.org/pypi/ProDy/1.8.2

Thursday, December 1, 2016

Matlab Bioinformatics

The MatLab bioinformatics is a toolbox which includes modules which allow you to read information from FASTA, SAM, CEL, CDF files. You can also access information GenBank and NCBI Gene Expression Omnibus. The program can open the files and then present the data found within the files as visuals ( sequence browsers, spatial heatmaps, and clustergrams). It also has "statistical techniques for detecting peaks, imputing values for missing data, and selecting features" 

After reviewing the overview of the bioinformatics program on MatLab, I have come to the conclusion that it would be no help to me. The primary purpose of the program is to allow scientists to input their data, code for how they'd like the program to organize the data and then analyze the data. This would help the scientist come to conclusions about the data faster than had they just looked at completely unorganized data. Also helps them detect trends. I am not trying to analyze data at this point. I am trying to collect all the proteins functions and place them in one place. Later on, once I have designed the website I could use Matlab to analyze all the data I've collected and come to a conclusion myself. Scientists would ideally go through and take all the data I've compiled and then organize it themselves and come to a conclusion themselves. I am just the mediator, I allow them to access all the data in one place and then they analyze it. 

What I take from this: I need to include the protein sequence in a FASTA file so that if researchers do what to put my data into MatLab and analyze the trends they can.