-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #164 from /issues/161-provide-hg38-support
Add hg38 support (resolves #161)
- Loading branch information
Showing
14 changed files
with
278 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -167,7 +167,7 @@ def run_radia_perchrom(job, bams, univ_options, radia_options, chrom): | |
''.join(['--rnaTumorFasta=', input_files['genome.fa']]), | ||
'-f', input_files['genome.fa'], | ||
'-o', docker_path(radia_output), | ||
'-i', 'hg19_M_rCRS', | ||
'-i', univ_options['ref'], | ||
'-m', input_files['genome.fa'], | ||
'-d', '[email protected]', | ||
'-q', 'Illumina', | ||
|
@@ -206,11 +206,20 @@ def run_filter_radia(job, bams, radia_file, univ_options, radia_options, chrom): | |
'normal.bam.bai': bams['normal_dnai'], | ||
'radia.vcf': radia_file, | ||
'genome.fa.tar.gz': radia_options['genome_fasta'], | ||
'genome.fa.fai.tar.gz': radia_options['genome_fai']} | ||
'genome.fa.fai.tar.gz': radia_options['genome_fai'], | ||
'cosmic_beds': radia_options['cosmic_beds'], | ||
'dbsnp_beds': radia_options['dbsnp_beds'], | ||
'retrogene_beds': radia_options['retrogene_beds'], | ||
'pseudogene_beds': radia_options['pseudogene_beds'], | ||
'gencode_beds': radia_options['gencode_beds'] | ||
} | ||
input_files = get_files_from_filestore(job, input_files, work_dir, docker=False) | ||
|
||
for key in ('genome.fa', 'genome.fa.fai'): | ||
input_files[key] = untargz(input_files[key + '.tar.gz'], work_dir) | ||
for key in ('cosmic_beds', 'dbsnp_beds', 'retrogene_beds', 'pseudogene_beds', 'gencode_beds'): | ||
input_files[key] = untargz(input_files[key], work_dir) | ||
|
||
input_files = {key: docker_path(path) for key, path in input_files.items()} | ||
|
||
filterradia_log = ''.join([work_dir, '/radia_filtered_', chrom, '_radia.log']) | ||
|
@@ -219,11 +228,11 @@ def run_filter_radia(job, bams, radia_file, univ_options, radia_options, chrom): | |
input_files['radia.vcf'], | ||
'/data', | ||
'/home/radia/scripts', | ||
'-d', '/home/radia/data/hg19/snp135', | ||
'-r', '/home/radia/data/hg19/retroGenes/', | ||
'-p', '/home/radia/data/hg19/pseudoGenes/', | ||
'-c', '/home/radia/data/hg19/cosmic/', | ||
'-t', '/home/radia/data/hg19/gaf/2_1', | ||
'-d', input_files['dbsnp_beds'], | ||
'-r', input_files['retrogene_beds'], | ||
'-p', input_files['pseudogene_beds'], | ||
'-c', input_files['cosmic_beds'], | ||
'-t', input_files['gencode_beds'], | ||
'--noSnpEff', | ||
'--noBlacklist', | ||
'--noTargets', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
#!/usr/bin/env python2.7 | ||
# Copyright 2016 Arjun Arkal Rao | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
""" | ||
Author : Arjun Arkal Rao | ||
Affiliation : UCSC BME, UCSC Genomics Institute | ||
File : protect/test/test_snpeff.py | ||
""" | ||
from __future__ import print_function | ||
|
||
from protect.common import untargz | ||
from protect.mutation_annotation.snpeff import run_snpeff | ||
from protect.pipeline.ProTECT import _parse_config_file | ||
from protect.test import ProtectTest | ||
from toil.job import Job | ||
|
||
import os | ||
import subprocess | ||
|
||
|
||
class TestSnpeff(ProtectTest): | ||
def setUp(self): | ||
super(TestSnpeff, self).setUp() | ||
test_dir = self._createTempDir() | ||
self.options = Job.Runner.getDefaultOptions(self._getTestJobStorePath()) | ||
self.options.logLevel = 'INFO' | ||
self.options.workDir = test_dir | ||
self.options.clean = 'always' | ||
|
||
def test_snpeff(self): | ||
""" | ||
Test the functionality of run_transgene | ||
""" | ||
univ_options = self._getTestUnivOptions() | ||
univ_options['output_folder'] = '/mnt/ephemeral/done' | ||
config_file = os.path.join(self._projectRootPath(), | ||
'src/protect/test/test_inputs/ci_parameters.yaml') | ||
test_src_folder = os.path.join(self._projectRootPath(), 'src', 'protect', 'test') | ||
a = Job.wrapJobFn(self._get_test_mutation_vcf) | ||
b = Job.wrapJobFn(self._get_all_tools, config_file).encapsulate() | ||
c = Job.wrapJobFn(self._get_tool, b.rv(), 'snpeff') | ||
d = Job.wrapJobFn(run_snpeff, a.rv(), univ_options, c.rv(), disk='100M', | ||
memory='100M', cores=1).encapsulate() | ||
a.addChild(b) | ||
b.addChild(c) | ||
|
||
a.addChild(d) | ||
c.addChild(d) | ||
Job.Runner.startToil(a, self.options) | ||
|
||
@staticmethod | ||
def _get_all_tools(job, config_file): | ||
sample_set, univ_options, tool_options = _parse_config_file(job, config_file, | ||
max_cores=None) | ||
return tool_options | ||
|
||
@staticmethod | ||
def _get_tool(job, all_tools, tool): | ||
return all_tools[tool] | ||
|
||
@staticmethod | ||
def _get_test_mutation_vcf(job): | ||
""" | ||
Get the test mutation vcf file and write to jobstore | ||
:return: FSID for the mutations vcf | ||
""" | ||
base_call = 's3am download s3://cgl-protect-data/unit_results/mutations/merged/' | ||
filename = 'all_merged.vcf' | ||
call = (base_call + ('%s.tar.gz ' % filename)*2).strip().split(' ') | ||
subprocess.check_call(call) | ||
untargz(filename + '.tar.gz', os.getcwd()) | ||
return job.fileStore.writeGlobalFile(filename) | ||
|
||
|
||
# noinspection PyProtectedMember | ||
_get_all_tools = TestSnpeff._get_all_tools | ||
# noinspection PyProtectedMember | ||
_get_tool = TestSnpeff._get_tool | ||
# noinspection PyProtectedMember | ||
_get_test_mutation_vcf = TestSnpeff._get_test_mutation_vcf |
Oops, something went wrong.