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

Add toil-lib dependency (resolves BD2KGenomics/toil#922) #434

Merged
merged 4 commits into from
Sep 6, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def check_provided(distribution, min_version, max_version=None, optional=False):
author_email='[email protected]',
url="https://github.com/BD2KGenomics/toil-scripts",
install_requires=[
'tqdm==3.8.0', # FIXME: Remove once ADAM stops using it (superfluous import)
'toil-lib==1.0.3',
'pyyaml==3.11'],
tests_require=[
'pytest==2.8.3'],
Expand Down
2 changes: 1 addition & 1 deletion src/toil_scripts/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

_log = logging.getLogger(__name__)

# TODO: replace this with toil_scripts.lib.urls._download_s3_url
# TODO: replace this with toil_lib.urls._download_s3_url

def download_from_s3_url(file_path, url):
from urlparse import urlparse
Expand Down
3 changes: 2 additions & 1 deletion src/toil_scripts/adam_gatk_pipeline/align_and_call.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,15 @@
# these don't seem necessary! but, must be imported here due to a serialization issue
from toil.lib.spark import spawn_spark_cluster

from toil_lib.programs import mock_mode

# import job steps from other toil pipelines
from toil_scripts.adam_pipeline.adam_preprocessing import * #static_adam_preprocessing_dag
from toil_scripts.bwa_alignment.bwa_alignment import * #download_shared_files
from toil_scripts.gatk_germline.germline import * #batch_start
from toil_scripts.gatk_processing.gatk_preprocessing import * #download_gatk_files
from toil_scripts.rnaseq_cgl.rnaseq_cgl_pipeline import generate_file

from toil_scripts.lib.programs import mock_mode

def sample_loop(job, uuid_list, inputs):
"""
Expand Down
4 changes: 2 additions & 2 deletions src/toil_scripts/adam_kmers/count_kmers.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
from toil.lib.spark import spawn_spark_cluster

# imports from toil_scripts
from toil_scripts.lib import require
from toil_scripts.tools.spark_tools import call_adam, call_conductor, \
from toil_lib import require
from toil_lib.tools.spark_tools import call_adam, call_conductor, \
MasterAddress, HDFS_MASTER_PORT, SPARK_MASTER_PORT


Expand Down
9 changes: 5 additions & 4 deletions src/toil_scripts/adam_pipeline/adam_preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,12 @@
from toil.job import Job
from toil.lib.spark import spawn_spark_cluster

from toil_scripts.lib import require
from toil_scripts.lib.files import copy_files, move_files
from toil_scripts.lib.programs import docker_call, mock_mode
from toil_lib import require
from toil_lib.files import copy_files, move_files
from toil_lib.programs import docker_call, mock_mode
from toil_lib.tools.spark_tools import call_adam, call_conductor, MasterAddress, HDFS_MASTER_PORT, SPARK_MASTER_PORT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

toil_lib imports should be ahead of toil_scripts imports.


from toil_scripts.rnaseq_cgl.rnaseq_cgl_pipeline import generate_file
from toil_scripts.tools.spark_tools import call_adam, call_conductor, MasterAddress, HDFS_MASTER_PORT, SPARK_MASTER_PORT

log = logging.getLogger(__name__)

Expand Down
12 changes: 6 additions & 6 deletions src/toil_scripts/bwa_alignment/bwa_alignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@

import yaml
from toil.job import Job
from toil_lib import require, required_length
from toil_lib.files import copy_file_job
from toil_lib.jobs import map_job
from toil_lib.tools.aligners import run_bwakit
from toil_lib.tools.indexing import run_samtools_faidx, run_bwa_index
from toil_lib.urls import download_url_job, s3am_upload_job

from toil_scripts.lib import require, required_length
from toil_scripts.lib.files import copy_file_job
from toil_scripts.lib.jobs import map_job
from toil_scripts.lib.urls import download_url_job, s3am_upload_job
from toil_scripts.rnaseq_cgl.rnaseq_cgl_pipeline import generate_file
from toil_scripts.tools.aligners import run_bwakit
from toil_scripts.tools.indexing import run_samtools_faidx, run_bwa_index


def download_reference_files(job, inputs, samples):
Expand Down
23 changes: 11 additions & 12 deletions src/toil_scripts/exome_variant_pipeline/exome_variant_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,17 @@
from bd2k.util.files import mkdir_p
from bd2k.util.processes import which
from toil.job import Job

from toil_scripts.lib import require
from toil_scripts.lib.files import copy_files
from toil_scripts.lib.jobs import map_job
from toil_scripts.lib.urls import download_url_job, s3am_upload
from toil_scripts.tools.mutation_callers import run_muse
from toil_scripts.tools.mutation_callers import run_mutect
from toil_scripts.tools.mutation_callers import run_pindel
from toil_scripts.tools.preprocessing import run_gatk_preprocessing
from toil_scripts.tools.preprocessing import run_picard_create_sequence_dictionary
from toil_scripts.tools.preprocessing import run_samtools_faidx
from toil_scripts.tools.preprocessing import run_samtools_index
from toil_lib import require
from toil_lib.files import copy_files
from toil_lib.jobs import map_job
from toil_lib.tools.mutation_callers import run_muse
from toil_lib.tools.mutation_callers import run_mutect
from toil_lib.tools.mutation_callers import run_pindel
from toil_lib.tools.preprocessing import run_gatk_preprocessing
from toil_lib.tools.preprocessing import run_picard_create_sequence_dictionary
from toil_lib.tools.preprocessing import run_samtools_faidx
from toil_lib.tools.preprocessing import run_samtools_index
from toil_lib.urls import download_url_job, s3am_upload


# Start of Job Functions
Expand Down
7 changes: 4 additions & 3 deletions src/toil_scripts/gatk_germline/germline.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@

import yaml
from toil.job import Job
from toil_lib import require
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 line of whitespace between toil and toil_lib imports? (I thought that was the policy, but can't remember)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran optimize imports before realizing it messed up the align_and-call pipeline's imports, so I just did a quick find-and-replace. I'll go back and do that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PyCharm's optimize imports feature doesn't put a space there, but puts 1 line of whitespace between that block and toil_scripts. Do you have a preference?

from toil_lib.programs import docker_call
from toil_lib.urls import s3am_upload

from toil_scripts import download_from_s3_url
from toil_scripts.lib import require
from toil_scripts.lib.programs import docker_call
from toil_scripts.lib.urls import s3am_upload
from toil_scripts.rnaseq_cgl.rnaseq_cgl_pipeline import generate_file


Expand Down
7 changes: 4 additions & 3 deletions src/toil_scripts/gatk_processing/gatk_preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@

import yaml
from toil.job import Job
from toil_lib import require
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

toil_lib imports should be ahead of toil_scripts imports.

from toil_lib.programs import docker_call
from toil_lib.urls import s3am_upload

from toil_scripts import download_from_s3_url
from toil_scripts.lib import require
from toil_scripts.lib.programs import docker_call
from toil_scripts.lib.urls import s3am_upload
from toil_scripts.rnaseq_cgl.rnaseq_cgl_pipeline import generate_file

_log = logging.getLogger(__name__)
Expand Down
63 changes: 0 additions & 63 deletions src/toil_scripts/lib/__init__.py

This file was deleted.

107 changes: 0 additions & 107 deletions src/toil_scripts/lib/files.py

This file was deleted.

23 changes: 0 additions & 23 deletions src/toil_scripts/lib/jobs.py

This file was deleted.

Loading