This Series of blog pages is about the Script of PyMOL. If you are an expert of PyMOL/Python and give me some suggestions or find some errors in this page, I will be very happpppy. This is my First time to use PyMOL
Since the Dr.Marcelo Marcet-Palacios only provide a exist file of PyMOL software without a PyMOL API for Python. I am starting to setup the environment of Open-Source PyMOL, which take a long time(take care).
Setup Environment.
Dr.Marcelo Marcet-Palacios helped me to install the PyMOL by a Mac-package. However, I found the python script cannot load the PyMOL module. I started to find the reason.
in your script, you wish you can install the pymol following the steps of installing an Open-Source PyMOL.
So I started to follow the http://www.pymolwiki.org/index.php/MAC_Install to install an Open-Source PyMOL. If your mac is over 10.5, my feedback is not use the fink, which is not easy to install.
Try this
1 2 3 4
sudo port install tcl -corefoundation sudo port install tk -quartz
sudo port install pymol
The other issue make me so annoying is that
1 2 3 4 5 6 7 8
Traceback (most recent call last): File "/usr/local/Cellar/pymol/1.8.2.1/libexec/lib/python2.7/site-packages/pymol/__init__.py", line 72, in <module> import pymol File "/usr/local/Cellar/pymol/1.8.2.1/libexec/lib/python2.7/site-packages/pymol/__init__.py", line 536, in <module> import pymol._cmd ImportError: dlopen(/usr/local/Cellar/pymol/1.8.2.1/libexec/lib/python2.7/site-packages/pymol/_cmd.so, 2): Library not loaded: /usr/local/opt/glew/lib/libGLEW.2.0.0.dylib Referenced from: /usr/local/Cellar/pymol/1.8.2.1/libexec/lib/python2.7/site-packages/pymol/_cmd.so Reason: image not found
I have taken a Machine Learning Course at the University of Alberta. Our professor is Russell Greiner. We need to make a project and do some researches by Machine Learning method with our coach Koosha Golmohammadi. Since this is my first Machine Learning project. Soooo, this is not as good as some projects made by Machine Learning experts. However, we achieve a result is 90% accuracy which is closed to some the U.S agency in Boston.
1 Scraping Data.
We scraped some real estate data from real estate data website from Edmonton and marked in Edmonton Map.
2 Matching Data
Then we tried to match the real estate data with over 110 features in Open City Edmonton Data
It is a tough work there are different names for an address which is easier for the human to understand than a machine. After a little of the algorithm in nature language process(very basic).
we got the following useful data.
This is our first step for collating data and scraping data.
I will keep updating for Machine learning. See you next time.
When I was in 3rd year in Undergraduate, I has an opportunity to develop a Mobile Application. Since I have the experience of developing Android Mobile Application which is a CMPUT 301 course project. I build a team which from 2 different teams in 301 course.
The First Plan for us is build an Android Application by Java and an iOS Application by Object-C. The Customer asked us to finish in a half year. We don’t think that is enough to develop two Applications and test two.
We were looking for some solutions. The first solutions is Cordova Phonegap. However we searched some Phonegap products. The User experience and User Interface is much worse than an Application developed by Java or Object-C.
Then one of my team member ask his sister’s boyfriend who works in Google. He recommand the Ionic + Parse for our mobile application. That is the first time I heard about the Ionic.
Then I use Ionic + Parse to develop 3 Mobile Applications inculde one course project. It is not easy until we fully understand what the structure in the Ionic. Trust me! Ionic is a very clear Structure.
The Structure
In my Understanding the Ionic Stucture is like this form.
note0 : Trivial Division use the trivial prime, which cannot use Miller-Rabin primality test
note1 : Euler’s factorization method stops the algorithm
when a number cannot found number = a^2 + b^2 = c^2 + d^2.
Miller-Rabin is only judge the prime not find the factors.
note2 : Since I have not find a better way to find a number = a^2 + b^2 = c^2 + d^2.
So Euler's spend on the this function I will list after that
note3 : In Pollards_rho Miller-Rabin primality test, inorder to handle some base cases. I use the
trial_division to handle some special cases.
#Integer factorization:
1.1
Trial division: (Baseline) This is a base line in my integer factorization algorithm project. It is using a prime sieve for prime number generation which can judge a number is a prime or continue do factorization.
Running time: in the worst case it is O(2^(n/2)/((n/2)*ln2))
n is base-2 n digit number.
1.2
Euler’s factorization method: This is an implementation factorization algorithm, which solves the following problem. Given an number, then find all prime factors. The base knowledge of Euler’s factorization is if a number = a^2 + b^2 = c^2 + d^2. There is a quickly way to seperate into 2 factors.
Running time: It is very slow, worst case is greater than trial division, only quick in some special cases and has potient quick.
1.3
Fermat’s factorization method: This is an implementation factorization algorithm, which solves the following problem. Given an number, then find all prime factors. The base knowledge of Fermat’s factorization method: is if a number = a^2 - b^2 There is a quickly way to seperate into 2 factors.
Running time: Worst case is O(N^{1/2}) General case is O(N^{1/3}) time.
1.4
Pollard’s rho algorithm: This is an implementation factorization algorithm, which solves the following problem. Given an number, then find all prime factors. The base knowledge of Pollard’s rho algorithm is if a find the abs(x^2+1-x) mod N if not 1 then it is a factor of N.
Running time: General case by the Birthday paradox in O(\sqrt p)\ <= O(n^{1/4}) but this is a heuristic claim, and rigorous analysis of the algorithm remains open.
2 A description of what sort of tests I have included
1 St: 2 primes production (each prime > million)
When the prime is very big, test the speed of each methods.
###1.1 The testcases: 15485867*32452867 = 502560782130689
Algorithm
trivial prime
Miller-Rabin primality test
Trial division(baseline)
31.0308229923
null
Euler’s factorization method
32.3473279476+3.276534002
null
Fermat’s factorization method
2.5645339489
3.19916701317
Pollard’s rho algorithm
0.0414018630981
0.0358607769012
###1.2 The testcases: 15487019*15487469 = 239854726664911
Algorithm
trivial prime
Miller-Rabin primality test
Trial division(baseline)
22.700715065
null
Euler’s factorization method
21.358424902+3.0871624554
null
Fermat’s factorization method
3.99884200096
2.206387043
Pollard’s rho algorithm
0.0165410041809
0.0110921859741
###1.3 The testcases: 15490781*67869427 = 1051350430252487
Algorithm
trivial prime
Miller-Rabin primality test
Trial division(baseline)
53.9460468292
null
Euler’s factorization method
47.7404336929+8.194948196
null
Fermat’s factorization method
8.05504488945
9.30907988548
Pollard’s rho algorithm
0.0999021530151
0.0918011665344
2 nd: 4 primes production (each prime between[1000,9999])
When the prime is big and more factors, test the speed of each methods.
###2.1 The testcases: 8147 8369 8623 * 7127 = 4190216175859403
Algorithm
trivial prime
Miller-Rabin primality test
Trial division(baseline)
109.196480989
null
Euler’s factorization method
105.0888099666+5.89233399
null
Fermat’s factorization method
2.5645339489
3.19916701317
Pollard’s rho algorithm
0.0414018630981
0.0358607769012
###2.2 The testcases: 1259 1451 1613 * 1811 = 5336370322687
Algorithm
trivial prime
Miller-Rabin primality test
Trial division(baseline)
2.96865296364
null
Euler’s factorization method
3.3992729187+0.5768110752
null
Fermat’s factorization method
5.54617881775
3.116948843
Pollard’s rho algorithm
0.00448799133301
0.00167012214661
###2.3 The testcases: 6277 5351 8831 * 9733 = 2886979418455921
Algorithm
trivial prime
Miller-Rabin primality test
Trial division(baseline)
77.4180650711
null
Euler’s factorization method
72.7111520767+13.2122049
null
Fermat’s factorization method
2.87196207047
3.24289989471
Pollard’s rho algorithm
0.479516983032
0.00454497337341
3 rd: over 6 small prime product
When the prime is not that big, but we have more factors for the number which need to be factorization.
integer factorization algorithm type the number you want to run the algorithm eg: 1 then will run the Trial division 1.Trial division 2.Euler’s factorization method 3.Fermat’s factorization method 4.Pollard’s rho algorithm input the number:
1 2 3
Then input the id of factorization method.
for the 3rd and 4th, you also need to choose the id of the prime generate method.
runner.py -+—-1 “Trial division”—-+—“type number of testcases” | +—“input the number which needs factorization” | | +—-2 “Euler’s factorization method”—+—“type number of testcases” | +—“input the number which needs factorization” | | +—-3 “Fermat’s factorization method”—+—“type the prime generate method” | +—1 “trivial prime” | + +—“type number of testcases” | | +—“input the number which needs factorization” | | | +—2 “Miller-Rabin primality test” | +—“type number of testcases” | +—“input the number which needs factorization” | | +—-4 “Pollard’s rho algorithm”—+—“type the prime generate method” +—1 “trivial prime” | +—“type number of testcases” | +—“input the number which needs factorization” | +—2 “Miller-Rabin primality test” +—“type number of testcases” +—“input the number which needs factorization” ``` Or
You can runner each single file which has been listed:
Algorithm
trivial prime
Miller-Rabin primality test
Trial division(baseline)
trial_division.py
note0
Euler’s factorization method
euler_trivial.py note2
note1
Fermat’s factorization method
fermatfactor_trivial.py
fermatfactor_improved_prime.py
Pollard’s rho algorithm
Pollards_rho_trivial.py
Pollards_rho_improved_prime.py
Anything else you deem relevant.
1 I used the trivial prime: which judge if a number is a prime.
2 I used another prime test called Miller-Rabin primality test: which is much quicker and I have referenced in all my test cases. Prime test is correct.
HIV virus’s protine order like hexagon. In the previous research, they working on the 2 dimension. However, in 3 dimension, the protine fills spherical surface.
This prgramming project is used to help the biology researcher to plot the HIV virus and get a list of all surface protine coordinations by setting the different radius.
The main structure.
If the point B rotated point A and get point C, I named points A is the father or root of B and C. As I mentioned that HIV virus’s surfaces protines order like a hexagen, protine will rotated 120 degree to get another protine.
There are a K_keepers list of points which generated and a Pivot list of points.
Use a Queue push in the points generated by the other 2 points, and push out the points which is already generated 2 points. When the distance is less than the protine’s radius, then the protines should not be placed at that coordination.
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.