- download and install
pyenvvia github
$ git clone https://github.com/yyuu/pyenv.git ~/.pyenv
- add the following to
~/.bash_profile
| def myheatmap(ndary): | |
| X, Y = ndary.shape | |
| fig = plt.figure(figsize=(8,8)) | |
| ax = fig.add_subplot(1,1,1) | |
| ax.set_xlim(0, Y) | |
| ax.set_ylim(0, X) | |
| ax.invert_yaxis() | |
| ax.pcolor(ndary, cmap=plt.cm.Blues) | |
| fig.show() |
| def someMap: Map[String, Int] | |
| someMap.keys.map(key => (key -> someMap(key).someFunc)).toMap |
| ## line starting with '#' is will be ignored by your computer (comment line) | |
| ## configuration | |
| Host nickname_of_your_server | |
| User [email protected] | |
| Port 22 | |
| Hostname server | |
| IdentityFile ~/.ssh/server | |
| IdentitiesOnly yes |
| $ parallel mkdir -p dirs/{2}/{1} :::: <(seq 1 10) <(seq 1 5) | |
| $ parallel -k 'echo {}' :::: <(seq 1 10) | |
| $ # https://www.youtube.com/playlist?list=PL284C9FF2488BC6D1 | |
| #!/bin/sh | |
| # (@) hello world | |
| #SBATCH --job-name=hello | |
| #SBATCH --output=hello.%j.out | |
| #SBATCH --error=hello.%j.err | |
| #SBATCH --time=0:01:00 | |
| #SBATCH --qos=normal | |
| #SBATCH -p normal |
| np.array( | |
| Parallel( | |
| n_jobs=multiprocessing.cpu_count() | |
| )(delayed(pre_process_main)(read_3channel_file(lead_df, i)) | |
| for i in range(batch_interval[0], batch_interval[1])), | |
| dtype = np.float64 | |
| ) |
| $ python pgen_write.py | |
| 2017-07-04 00:44:50,706 pgen_write DEBUG pgen write test script | |
| 2017-07-04 00:44:50,706 read_alleles_range DEBUG reading alleles range 0:10 from ./pgen_in.pgen | |
| 2017-07-04 00:44:50,725 read_alleles_range DEBUG The shape of the numpy nd-array is (10, 224676) | |
| 2017-07-04 00:44:50,725 pgen_write DEBUG shape of buffer is (10, 224676) | |
| 2017-07-04 00:44:50,727 pgen_write DEBUG writing SNP 0 of 10 ... | |
| 2017-07-04 00:44:50,728 pgen_write DEBUG writing SNP 1 of 10 ... | |
| 2017-07-04 00:44:50,730 pgen_write DEBUG writing SNP 2 of 10 ... | |
| 2017-07-04 00:44:50,731 pgen_write DEBUG writing SNP 3 of 10 ... | |
| 2017-07-04 00:44:50,733 pgen_write DEBUG writing SNP 4 of 10 ... |
| PC | score | |
|---|---|---|
| 1 | 0.840188 | |
| 2 | 0.394383 | |
| 3 | 0.783099 | |
| 4 | 0.79844 | |
| 5 | 0.911647 | |
| 6 | 0.197551 | |
| 7 | 0.335223 | |
| 8 | 0.76823 | |
| 9 | 0.277775 |
This script works as a wrapper for sbatch command.
Usage:
sherlock-one-liner python --version