Skip to content

Commit cec5ba1

Browse files
draniondrkthomp
authored andcommitted
Updated to python3
Relative refereces Updated to python3 Update README.md Update MANUAL.md
1 parent 3e195d9 commit cec5ba1

70 files changed

Lines changed: 609 additions & 363 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
bd2k-extras/
12
pimmuno.py
23
pimmuno_2.py
34
*.pyc
45
/src/*.egg-info/
56
develop_data/
67
venv/
78
.cache/
9+
jobStore/
810
test-report.xml
911
__pycache__
1012
*.DONE

.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/profiles_settings.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/protect3.iml

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/Basic_Run_.xml

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

MANUAL.md

Lines changed: 15 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -27,87 +27,55 @@ ProTECT is implemented in the [Toil](https://github.com/BD2KGenomics/toil.git) f
2727
runs the workflow described in [protect/Flowchart.txt](
2828
https://github.com/BD2KGenomics/protect/blob/master/Flowchart.txt).
2929

30+
**This manual is a quick adaptation for an adaptation of ProTECT to py3**
31+
3032

3133
# Installation
3234

3335
ProTECT requires Toil and we recommend installing ProTECT and its requirements in a
3436
[virtualenv](http://docs.python-guide.org/en/latest/dev/virtualenvs/).
3537

36-
ProTECT also requires [s3am](https://github.com/BD2KGenomics/s3am.git) version 2.0.1 to download and
38+
~ProTECT also requires [s3am](https://github.com/BD2KGenomics/s3am.git) version 2.0.1 to download and
3739
upload files from S3. We recommend installing s3am in its own virtualenv using the directions in
3840
the s3am manual, then putting the s3am binary on your $PATH. ProTECT will NOT attempt to install
39-
s3am during installation.
41+
s3am during installation.~
4042

41-
ProTECT uses pkg_resources from setuptools to verify versions of tools during install. As of setuptools
42-
39.0.1, some modules were moved to the packaging module. If your machine has setuptools >=39.0.1, you
43-
will need the packaging module.
43+
currently WIP. for now, **only references to local files will work**. anything that requires access to s3am (s3 buckets) will **fail**.
4444

4545
Lastly, ProTECT uses [docker](https://www.docker.com/) to run the various sub-tools in a
4646
reproducible, platform independent manner. ProTECT will NOT attempt to install docker during
4747
installation.
4848

49-
### Method 1 - Using PIP (recommended)
50-
51-
First create a virtualenv at your desired location (Here we create it in the folder ~/venvs)
52-
53-
virtualenv ~/venvs/protect
54-
55-
Activate the virtualenv
56-
57-
source ~/venvs/protect/bin/activate
58-
59-
NOTE: Installation was tested using pip 7.1.2 and 8.1.1. We have seen issues with the installation
60-
of pyYAML with lower versions of pip and recommend upgrading pip before installing ProTECT.
61-
62-
pip install --upgrade pip
63-
64-
Install Toil
65-
66-
pip install toil[aws]==3.5.2
67-
68-
Install packaging (required if setuptools>=39.0.1)
69-
70-
pip install packaging
71-
72-
Install ProTECT and all dependencies in the virtualenv
73-
74-
pip install protect
75-
49+
~Method 1 - Using PIP (recommended)~
7650
### Method 2 - Installing from Source
7751

7852
This will install ProTECT in an editable mode.
7953

8054
Obtain the source from Github
8155

82-
git clone https://www.github.com/BD2KGenomics/protect.git
56+
git clone https://www.github.com/Dranion/protect.git
8357

8458
Create and activate a virtualenv in the project folder (Important since the Makefile checks for
8559
this and will fail if it detects that you are not in a virtual environment)
8660

8761
cd protect
88-
virtualenv venv
62+
virtualenv --python=python3 venv
8963
source venv/bin/activate
9064

9165
Install Toil and pytest
9266

9367
make prepare
9468

95-
Install packaging (required if setuptools>=39.0.1)
69+
Install the python3 conversion of bd2k and s3am. *s3am is untested as I am running locally*
9670

97-
pip install packaging
71+
make special_install
9872

9973
Install ProTECT
10074

10175
make develop
10276

103-
## Method 3 - Using Docker
77+
~Method 3 - Using Docker~
10478

105-
Dockerized versions of ProTECT releases can be found at https://quay.io/organization/ucsc_cgl. These
106-
Docker containers run the ProTECT pipeline in single machine mode. The only difference between the
107-
Docker and Python versions of the pipeline is that the Docker container takes the config options,
108-
described below, as command line arguments as opposed to a config file. Running the container
109-
without any arguments will list all the available options. Also, currently the dockerized version of
110-
ProTECT only supports local file export.
11179

11280
# Running ProTECT
11381

@@ -173,7 +141,7 @@ in the pipeline, and the information on the input samples. Elements before a `:`
173141
dictionary read into ProTECT and should **NOT** be modified (Barring the patient ID key in the
174142
patients dictionary). Only values to the right of the `:` should be edited.
175143

176-
Every required reference file is provided in the AWS bucket `cgl-pipeline-inputs` under the folder
144+
Every required reference file is provided in the AWS bucket `protect-data` under the folder
177145
`protect/hg19_references` or `protect/hg38_references`. The `README` file in the same location
178146
describes in detail how each file was generated. To use a file located in an s3 bucket, replace
179147
`/path/to` in the following descriptions with `s3://<databucket>/<folder_in_bucket>`.
@@ -547,7 +515,7 @@ purposes:
547515
12: g/f/jobO4yiE4 return self.run(fileStore)
548516
13: g/f/jobO4yiE4 File "/home/ucsc/arjun/tools/dev/toil_clean/src/toil/job.py", line 1406, in run
549517
14: g/f/jobO4yiE4 rValue = userFunction(*((self,) + tuple(self._args)), **self._kwargs)
550-
15: g/f/jobO4yiE4 File "/home/ucsc/arjun/tools/protect_toil_clean/local/lib/python2.7/site-packages/protect/binding_prediction/common.py", line 566, in merge_mhc_peptide_calls
518+
15: g/f/jobO4yiE4 File "/home/ucsc/arjun/tools/protect_toil_clean/local/lib/python3/site-packages/protect/binding_prediction/common.py", line 566, in merge_mhc_peptide_calls
551519
16: g/f/jobO4yiE4 raise RuntimeError('No peptides available for ranking')
552520
17: g/f/jobO4yiE4 RuntimeError: No peptides available for ranking
553521
18: g/f/jobO4yiE4 ERROR:toil.worker:Exiting the worker because of a failed job on host sjcb10st7
@@ -581,9 +549,9 @@ do not store logs from tools (see BD2KGenomics/protect#275). The error looks sim
581549
Z/O/job1uH92D return self.run(fileStore)
582550
Z/O/job1uH92D File "/home/ucsc/arjun/tools/dev/toil_clean/src/toil/job.py", line 1406, in run
583551
Z/O/job1uH92D rValue = userFunction(*((self,) + tuple(self._args)), **self._kwargs)
584-
Z/O/job1uH92D File "/home/ucsc/arjun/tools/protect_toil_clean/local/lib/python2.7/site-packages/protect/mutation_calling/radia.py", line 238, in run_filter_radia
552+
Z/O/job1uH92D File "/home/ucsc/arjun/tools/protect_toil_clean/local/lib/python3/site-packages/protect/mutation_calling/radia.py", line 238, in run_filter_radia
585553
Z/O/job1uH92D tool_version=radia_options['version'])
586-
Z/O/job1uH92D File "/home/ucsc/arjun/tools/protect_toil_clean/local/lib/python2.7/site-packages/protect/common.py", line 138, in docker_call
554+
Z/O/job1uH92D File "/home/ucsc/arjun/tools/protect_toil_clean/local/lib/python3/site-packages/protect/common.py", line 138, in docker_call
587555
Z/O/job1uH92D 'for command \"%s\"' % ' '.join(call),)
588556
Z/O/job1uH92D RuntimeError: docker command returned a non-zero exit status (1)for command "docker run --rm=true -v /scratch/bio/ucsc/toil-681c097c-61da-4687-b734-c5051f0aa19f/tmped2fnu/f041f939-5c0d-40be-a884-68635e929d09:/data --log-driver=none aarjunrao/filterradia:bcda721fc1f9c28d8b9224c2f95c440759cd3a03 TCGA-CH-5788 17 /data/radia.vcf /data /home/radia/scripts -d /data/radia_dbsnp -r /data/radia_retrogenes -p /data/radia_pseudogenes -c /data/radia_cosmic -t /data/radia_gencode --noSnpEff --noBlacklist --noTargets --noRnaBlacklist -f /data/hg38.fa --log=INFO -g /data/radia_filtered_chr17_radia.log"
589557
Z/O/job1uH92D ERROR:toil.worker:Exiting the worker because of a failed job on host sjcb10st1

Makefile

100644100755
Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,22 @@ help:
4545
@echo "$$help"
4646

4747

48-
python=python2.7
49-
pip=pip2.7
48+
python=python
49+
pip=pip
5050
tests=src/protect/test/unit
5151
extras=
52-
5352
green=\033[0;32m
5453
normal=\033[0m
5554
red=\033[0;31m
5655

56+
# WIP
57+
special_install: check_venv
58+
git clone https://github.com/Dranion/bd2k-extras.git
59+
make -C bd2k-extras/bd2k-python-lib develop
60+
make -C bd2k-extras/s3am develop
61+
5762
prepare: check_venv
58-
@$(pip) install toil==3.8.0 pytest==2.8.3
63+
@$(pip) install toil pytest
5964

6065
develop: check_venv
6166
$(pip) install -e .$(extras)
@@ -107,11 +112,10 @@ clean_pypi:
107112

108113
clean: clean_develop clean_sdist clean_pypi
109114

110-
111115
check_venv:
112-
@$(python) -c 'import sys; sys.exit( int( not hasattr(sys, "real_prefix") ) )' \
113-
|| ( echo "$(red)A virtualenv must be active.$(normal)" ; false )
114-
116+
@$(python) -c 'import sys; sys.exit( int( not (hasattr(sys, "real_prefix") or ( hasattr(sys, "base_prefix") and sys.base_prefix != sys.prefix ) ) ) )' \
117+
|| [ ! -z "${VIRTUAL_ENV}" ] \
118+
|| ( echo "$(red)A virtualenv must be active.$(normal)\n" ; false )
115119

116120
check_clean_working_copy:
117121
@echo "$(green)Checking if your working copy is clean ...$(normal)"

0 commit comments

Comments
 (0)