Skip to content

Commit

Permalink
fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
iskandr committed Feb 19, 2016
1 parent 4a5cbc2 commit 0953984
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[![Build Status](https://travis-ci.org/hammerlab/mhctools.svg?branch=master)](https://travis-ci.org/hammerlab/mhctools) [![Coverage Status](https://coveralls.io/repos/hammerlab/mhctools/badge.svg?branch=master)](https://coveralls.io/r/hammerlab/mhctools?branch=master)

# mhctools
Python interface to running command-line and web-based MHC binding predictors.
Python interface to running command-line and web-based MHC binding predictors.

## Example

Expand Down
3 changes: 1 addition & 2 deletions mhctools/alleles.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def parse_allele_name(name, species_prefix=None):
3) allele family
4) allele code
If species_prefix is provided, that is used instead of getting the species prefix from the name.
If species_prefix is provided, that is used instead of getting the species prefix from the name.
(And in that case, a species prefix in the name will result in an error being raised.)
For example, in all of the following inputs:
Expand Down Expand Up @@ -338,7 +338,6 @@ def compact_allele_name(raw_allele):
HLA-DPA1*01:05-DPB1*100:01 into DPA10105-DPB110001
"""
parsed_alleles = parse_classi_or_classii_allele_name(raw_allele)
species = parsed_alleles[0].species
normalized_list = []
for parsed_allele in parsed_alleles:
if len(parsed_allele.allele_family) > 0:
Expand Down
22 changes: 11 additions & 11 deletions mhctools/epitope_collection_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,20 +102,20 @@ def add_binding_prediction(
source_sequence = str(self.fasta_dictionary[source_sequence_key])

binding_prediction = BindingPrediction(
source_sequence_key=source_sequence_key,
source_sequence=source_sequence,
offset=offset,
allele=normalize_allele_name(allele),
peptide=peptide,
length=len(peptide),
value=ic50,
percentile_rank=rank,
prediction_method_name=self.prediction_method_name,
measure=self.binding_measure)
source_sequence_key=source_sequence_key,
source_sequence=source_sequence,
offset=offset,
allele=normalize_allele_name(allele),
peptide=peptide,
length=len(peptide),
value=ic50,
percentile_rank=rank,
prediction_method_name=self.prediction_method_name,
measure=self.binding_measure)
self.binding_predictions.append(binding_prediction)

def get_collection(self):
return EpitopeCollection(self.binding_predictions)

def get_dataframe(self):
return self.get_collection.dataframe()
return self.get_collection().dataframe()
2 changes: 2 additions & 0 deletions mhctools/iedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
import logging
import io

# pylint: disable=import-error
from six.moves.urllib.request import urlopen, Request
# pylint: disable=import-error
from six.moves.urllib.parse import urlencode
import pandas as pd

Expand Down
2 changes: 0 additions & 2 deletions mhctools/netmhc.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
from .base_commandline_predictor import BaseCommandlinePredictor
from .file_formats import parse_netmhc_stdout


class NetMHC(BaseCommandlinePredictor):

def __init__(
self,
alleles,
Expand Down
1 change: 0 additions & 1 deletion mhctools/netmhcii_pan.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@


class NetMHCIIpan(BaseCommandlinePredictor):

def __init__(
self,
alleles,
Expand Down
6 changes: 4 additions & 2 deletions mhctools/process_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from subprocess import Popen, CalledProcessError
import time

# pylint: disable=import-error
from six.moves.queue import Queue

class AsyncProcess(object):
Expand Down Expand Up @@ -123,7 +124,7 @@ def add_to_queue(process):
# Are there any done processes?
to_remove = []
for possibly_done in processes.queue:
if possibly_done.poll() != None:
if possibly_done.poll() is not None:
possibly_done.wait()
to_remove.append(possibly_done)
# Remove them from the queue and stop checking
Expand All @@ -140,6 +141,7 @@ def add_to_queue(process):
processes.get().wait()

elapsed_time = time.time() - start_time
logging.info("Ran %d commands in %0.4f seconds",
logging.info(
"Ran %d commands in %0.4f seconds",
len(multiple_args_dict),
elapsed_time)

0 comments on commit 0953984

Please sign in to comment.