Skip to content

Commit 60f36ef

Browse files
authored
Adding google-nucleus to the REQUIRED_PACKAGES list (#416)
* Adding google-nucleus to the REQUIRED_PACKAGES list In PR #346 we added a temporary solution to install Nucleus using its wheel file. Nucleus now has pip install so we can remove that hack. * Review comments
1 parent a2146cb commit 60f36ef

File tree

4 files changed

+11
-23
lines changed

4 files changed

+11
-23
lines changed

cloudbuild.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
# Builds docker image for gcp-variant-transforms:
1616
# Run using:
17-
# $ gcloud container builds submit --config cloudbuild.yaml --timeout 1h .
17+
# $ gcloud builds submit --config cloudbuild.yaml --timeout 1h .
1818
substitutions:
1919
_CUSTOM_TAG_NAME: 'latest'
2020
steps:

deploy_and_run_tests.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,9 @@ if [[ -z "${skip_build}" ]]; then
207207
# TODO(bashir2): This will pick and include all directories in the image,
208208
# including local build and library dirs that do not need to be included.
209209
# Update this to include only the required files/directories.
210-
gcloud container builds submit --config "${build_file}" \
210+
gcloud builds submit --config "${build_file}" \
211211
--project "${project}" \
212+
--timeout '30m' \
212213
--substitutions _CUSTOM_TAG_NAME="${image_tag}" .
213214
fi
214215

gcp_variant_transforms/beam_io/vcfio_test.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,14 @@ def _get_sample_variant_1(is_for_nucleus=False):
101101
vcfio.VariantCall(name='Sample2', genotype=[1, 0], info={'GQ': 20}))
102102
else:
103103
# 0.1 -> 0.25 float precision loss due to binary floating point conversion.
104-
vcf_line = ('20 1234 rs123;rs2 C A,T 50 '
104+
# rs123;rs2 -> rs123 it seems nuclues does not parse IDs correctly.
105+
# quality=50 -> 50.0 nucleus converts quality values to float.
106+
# TODO(samanvp): convert all quality values to float.
107+
vcf_line = ('20 1234 rs123 C A,T 50 '
105108
'PASS AF=0.5,0.25;NS=1 GT:GQ 0/0:48 1/0:20\n')
106109
variant = vcfio.Variant(
107110
reference_name='20', start=1233, end=1234, reference_bases='C',
108-
alternate_bases=['A', 'T'], names=['rs123', 'rs2'], quality=50,
111+
alternate_bases=['A', 'T'], names=['rs123'], quality=50.0,
109112
filters=['PASS'], info={'AF': [0.5, 0.25], 'NS': 1})
110113
variant.calls.append(
111114
vcfio.VariantCall(name='Sample1', genotype=[0, 0], info={'GQ': 48}))

setup.py

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414

1515
"""Beam pipelines for processing variants based on VCF files."""
1616

17-
import os
1817
import setuptools
19-
from setuptools.command.build_py import build_py
2018

2119
REQUIRED_PACKAGES = [
2220
'cython>=0.28.1',
@@ -28,6 +26,9 @@
2826
'google-api-python-client>=1.6',
2927
'intervaltree>=2.1.0,<2.2.0',
3028
'pyvcf<0.7.0',
29+
'google-nucleus==0.2.0',
30+
# Nucleus needs uptodate protocol buffer compiler (protoc).
31+
'protobuf>=3.6.1',
3132
'mmh3<2.6',
3233
# Need to explicitly install v<=1.2.0. apache-beam requires
3334
# google-cloud-pubsub 0.26.0, which relies on google-cloud-core<0.26dev,
@@ -45,20 +46,6 @@
4546
'nose>=1.0',
4647
]
4748

48-
49-
class BuildPyCommand(build_py):
50-
"""Custom build command for installing libraries outside of PyPi."""
51-
52-
_NUCLEUS_WHEEL_PATH = (
53-
'https://storage.googleapis.com/gcp-variant-transforms-setupfiles/'
54-
'nucleus/Nucleus-0.1.0-py2-none-any.whl')
55-
56-
def run(self):
57-
# Temporary workaround for installing Nucleus until it's available via PyPi.
58-
os.system('pip install {}'.format(BuildPyCommand._NUCLEUS_WHEEL_PATH))
59-
build_py.run(self)
60-
61-
6249
setuptools.setup(
6350
name='gcp_variant_transforms',
6451
version='0.5.1',
@@ -90,7 +77,4 @@ def run(self):
9077
package_data={
9178
'gcp_variant_transforms': ['gcp_variant_transforms/testing/testdata/*']
9279
},
93-
cmdclass={
94-
'build_py': BuildPyCommand,
95-
},
9680
)

0 commit comments

Comments
 (0)