Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
sb43 authored Jul 9, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents c64bd0f + 01348e4 commit fea9993
Showing 7 changed files with 4 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -13,4 +13,4 @@ script:
- echo 'Build and check docker image'
- docker build -t annotatevcf .
- docker images | grep -c annotatevcf
- docker run -t --rm annotatevcf annotateVcf -h
- docker run -t --rm annotatevcf annotateVcf -h
3 changes: 0 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

FROM ubuntu:20.04 as builder
USER root

@@ -55,11 +54,9 @@ apt-get remove -yq unattended-upgrades && \
apt-get autoremove -yq



RUN locale-gen en_US.UTF-8
RUN update-locale LANG=en_US.UTF-8


ENV CGP_OPT /opt/wtsi-cgp
ENV PATH $CGP_OPT/bin:$CGP_OPT/python-lib/bin:$PATH
ENV PYTHONPATH $CGP_OPT/python-lib/lib/python3.6/site-packages
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -61,10 +61,8 @@ Release `.whl` files are generated as part of the release process and can be fou

### Package Dependancies


`pip` will install the relevant dependancies, listed here for convenience, please refer requirements.txt for versions.


## Development environment

This project uses git pre-commit hooks. As these will execute on your system it
1 change: 0 additions & 1 deletion annotate/annotate_cmd.py
Original file line number Diff line number Diff line change
@@ -5,7 +5,6 @@
import pkg_resources
import logging.config


# load config and reference files....

configdir = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'config/')
1 change: 0 additions & 1 deletion annotate/config/drvData.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"drv_genes":"lof_genes_v1.0.txt",
"drv_genes_prev":"lof_genes_previous_symbol.v1.0.txt",

"drv_mut":"driver_mutations_grch38_v1.0.tsv.gz",
"lof_consequences":["stop_lost","start_lost","ess_splice","frameshift","nonsense"],
"header_info":"vcf_info.txt",
9 changes: 1 addition & 8 deletions annotate/staticMethods.py
Original file line number Diff line number Diff line change
@@ -35,7 +35,6 @@ def __init__(self):
super().__init__()

@staticmethod

def input_checker(infile):
"""
checks user input file and returns it's type
@@ -58,7 +57,6 @@ def prepare_ref_data(json_file, ref_dir):
with open(json_file, 'r') as cfgfile:
cfg = json.load(cfgfile)
path_dict = StaticMthods._format_dir_input(ref_dir)

my_file_param = ('drv_genes', 'drv_genes_prev', 'drv_mut',
'header_info', 'genome_loc')
for prm in my_file_param:
@@ -129,7 +127,6 @@ def get_file_metadata(full_file_name):
def get_filtered_vcf(vcf, outfile_name):
"""
:param vcf: input vcf file
:param outfile_name: filename no extension
:return: filtered var vcf outfile
"""
@@ -139,7 +136,6 @@ def get_filtered_vcf(vcf, outfile_name):
return outfile_name

@staticmethod

def map_drv_genes(filtered_vcf, info_vc_prm, genome_loc, header_file, outfile_name):
"""
:param filtered_vcf: read filtered vcf file
@@ -161,7 +157,6 @@ def filter_lof_genes(drv_gene_vcf, lof_gene_list, prev_gene_dict, out_filename):
:param prev_gene_dict:
:param out_filename:
:return: vcf with lof variant locations
"""
fh = open(out_filename, "w")
with open(drv_gene_vcf) as gene_f:
@@ -242,7 +237,6 @@ def run_command(cmd):
status, please check log file for more details")
logging.error("OUT:{}:Error:{}:Exit:{}".format(out, error, exit_code))
return

except OSError as oe:
logging.error("Unable to run command:{} Error:{}".format(cmd, oe.args[0]))
sys.exit("Unable to run command:{} Error:{}".format(cmd, oe.args[0]))
@@ -256,5 +250,4 @@ def tempdir(mypath):
try:
shutil.rmtree(path)
except IOError:
sys.stderr.write('Failed to clean up temp dir {}'.format(path))

sys.stderr.write('Failed to clean up temp dir {}'.format(path))
6 changes: 2 additions & 4 deletions tests/test_check_combined_data.py
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@
of archCompare
'''


class TestClass():
pass

@@ -41,13 +42,11 @@ def test_static_methods(self):
exp_drv_gene_prev_dict={'ATD': 'ATM', 'ATC': 'ATM', 'ATDC': 'ATM', 'ATA': 'ATM'}
# create object for static class ....
so=sm.StaticMthods()

exp_metadata = (file_name, ext)
obs_metadata = so.get_file_metadata(vcf_file)
assert exp_metadata == obs_metadata, 'get_file_metadata test OK'

exp_ref_data=[drv_genes, drv_genes_prev, drv_muts, header_file,genome_loc, lof_consequences]

obs_ref_data = so.prepare_ref_data(driver_json,driver_data)
assert exp_ref_data == obs_ref_data, 'prepare_ref_data test OK'

@@ -89,5 +88,4 @@ def test_static_methods(self):
obs_drv_vcf_sub = so.unheader_vcf(obs_drv_vcf, outputPath + '/obs_drv.vcf')
exp_drv_vcf_sub = so.unheader_vcf(drv_vcf, outputPath+'/exp_drv.vcf')
assert filecmp.cmp(exp_drv_vcf_sub, obs_drv_vcf_sub,
shallow=True), 'Final driver records in vcf files are identical OK'

shallow=True), 'Final driver records in vcf files are identical OK'

0 comments on commit fea9993

Please sign in to comment.