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