Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace pickle with shelve #4

Merged
merged 18 commits into from
Apr 2, 2019
Merged
Prev Previous commit
Next Next commit
Update to syntax highlight
  • Loading branch information
iabraham authored Mar 23, 2019
commit 2881579305c2b92db734c5da26dbcc150002f546
48 changes: 25 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -37,19 +37,20 @@ This is a short explanation of the inner workings of the code in this repositor
#### Testing 1
If you have Amazon S3 and `boto` set up correctly with your credentials, you should be able to activate your environment, fire up python, and run

from download_hcp import *
dfiles = download_subject('100610')

```Python
from download_hcp import *
dfiles = download_subject('100610')
```
and get no errors.


#### Testing 2
If you have workbench installed and correctly added to path, then in your conda environment, you should be able to fire up python and say

import subprocess
subprocess.run(['wb_command','-help'])

```Python
import subprocess
subprocess.run(['wb_command','-help'])
```
and get meaningful output.

## Parallelizing
@@ -65,13 +66,12 @@ Note how `do_subject` really only does:

and parallelization only involves:

with mp.Pool(N) as pool:
result = pool.map(do_subject, subject_ids)

```Python
with mp.Pool(N) as pool:
result = pool.map(do_subject, subject_ids)
```
where `N` is the number of parallel processes. That's so clean even I am surprised that it worked out this way.


---

# Using rpy2 for CIFTI2
@@ -83,14 +83,15 @@ We utilize an R module in this repo. If you set up the environment using the pro
conda install rpy2

on your environment in use. That should install the R packages needed to use R from within python. Next install the `cifti` package from CRAN:

# import rpy2's package module
import rpy2.robjects.packages as rpackages

# import R's utility package
utils = rpackages.importr('utils')
utils.install_packages('cifti')

```Python
# import rpy2's package module
import rpy2.robjects.packages as rpackages

# import R's utility package
utils = rpackages.importr('utils')
utils.install_packages('cifti')
```
It should prompt you to pick a CRAN server for the session. If the installation is successful, it should end with

.
@@ -101,10 +102,11 @@ It should prompt you to pick a CRAN server for the session. If the installation
* DONE (cifti)

You can confirm successful installation by opening python and running:

from rpy2.robjects.packages import importr
importr('cifti')


```Python
from rpy2.robjects.packages import importr
importr('cifti')
```
which should return:

>>> importr('cifti')