Skip to content

Commit

Permalink
Merge pull request #95 from fls-bioinformatics-core/ensure-all-classe…
Browse files Browse the repository at this point in the history
…s-inherit-from-object

Update Python classes to ensure that they all explicitly subclass 'object'
  • Loading branch information
pjbriggs committed Apr 30, 2019
2 parents d464325 + 2a709f6 commit 2b1f7de
Show file tree
Hide file tree
Showing 26 changed files with 108 additions and 108 deletions.
6 changes: 3 additions & 3 deletions ChIP-seq/make_macs2_xls.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# make_macs2_xls.py: Convert MACS output file to XLS(X) spreadsheet
# Copyright (C) University of Manchester 2013-2016 Peter Briggs, Ian Donaldson
# Copyright (C) University of Manchester 2013-2019 Peter Briggs, Ian Donaldson
#
########################################################################
#
Expand Down Expand Up @@ -48,13 +48,13 @@
# Module metadata
#######################################################################

__version__ = '0.5.0'
__version__ = '0.5.1'

#######################################################################
# Class definitions
#######################################################################

class MacsXLS:
class MacsXLS(object):
"""Class for reading and manipulating XLS output from MACS
Reads the XLS output file from the MACS peak caller and
Expand Down
6 changes: 3 additions & 3 deletions NGS-general/manage_seqs.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# manage_seqs.py: Utility for handling sets of named sequences
# Copyright (C) University of Manchester 2014 Peter Briggs
# Copyright (C) University of Manchester 2014-2019 Peter Briggs
#
########################################################################
#
Expand All @@ -25,7 +25,7 @@
# Module metadata
#######################################################################

__version__ = "0.0.2"
__version__ = "0.0.3"

#######################################################################
# Import modules that this module depends on
Expand All @@ -40,7 +40,7 @@
# Classes
#######################################################################

class SeqDb:
class SeqDb(object):
"""Class for storing set of sequences with associated names
SeqDb stores arbitrary sequence strings associated with
Expand Down
8 changes: 4 additions & 4 deletions NGS-general/sam2soap.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# sam2soap.py: convert from SAM to SOAP format
# Copyright (C) University of Manchester 2012 Peter Briggs, Casey Bergman
# Copyright (C) University of Manchester 2012-2019 Peter Briggs, Casey Bergman
#
#######################################################################
#
Expand Down Expand Up @@ -30,7 +30,7 @@
# Class definitions
#######################################################################

class SAMBitwiseFlag:
class SAMBitwiseFlag(object):
"""Class to decode bitwise flag from SAM file.
Deconvolutes the decimal value of the bitwise flag from a
Expand Down Expand Up @@ -82,7 +82,7 @@ def __bitIsSet(self,data,bit):
except IndexError:
return False

class SAMLine:
class SAMLine(object):
"""Class to represent SAM alignment data line
Decodes a SAM alignment data line and sets the class properties
Expand Down Expand Up @@ -155,7 +155,7 @@ def __init__(self,line=None):
# Derived class properties
self.bitwiseFlag = SAMBitwiseFlag(self.flag)

class SOAPLine:
class SOAPLine(object):
"""Class to represent SOAP file line
The class has the following properties which can be set by
Expand Down
6 changes: 3 additions & 3 deletions NGS-general/split_fasta.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# split_fasta.py: extract individual chromosome sequences from fasta file
# Copyright (C) University of Manchester 2013 Peter Briggs
# Copyright (C) University of Manchester 2013-2019 Peter Briggs
#
########################################################################
#
Expand All @@ -22,7 +22,7 @@
# Module metadata
#######################################################################

__version__ = "0.2.0"
__version__ = "0.2.1"

#######################################################################
# Import modules
Expand Down Expand Up @@ -129,7 +129,7 @@ def next(self):
import cStringIO

# Test data
class TestData:
class TestData(object):
"""Set up example data to use in unit test classes
"""
Expand Down
8 changes: 4 additions & 4 deletions RNA-seq/bowtie_mapping_stats.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# bowtie_mapping_stats.py: write Bowtie mapping stats to a spreadsheet
# Copyright (C) University of Manchester 2011-2014 Peter Briggs
# Copyright (C) University of Manchester 2011-2019 Peter Briggs
#
########################################################################
#
Expand Down Expand Up @@ -75,7 +75,7 @@
# Module metadata
#######################################################################

__version__ = "1.1.5"
__version__ = "1.1.6"

#######################################################################
# Import
Expand Down Expand Up @@ -113,7 +113,7 @@
# Classes
#######################################################################

class BowtieMappingStats:
class BowtieMappingStats(object):
"""Collect and output mapping statistics for multiple samples
Read and store mapping stats from one or more samples from one
Expand Down Expand Up @@ -337,7 +337,7 @@ def tab_file(self,tab_file=None):
open(tab_file,'w').write(txt)
return txt

class BowtieSample:
class BowtieSample(object):
"""Store mapping statistics for a sample
Simple holder for mapping statistics extracted from a bowtie
Expand Down
8 changes: 4 additions & 4 deletions bcftbx/Experiment.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# Experiment.py: classes for defining SOLiD sequencing experiments
# Copyright (C) University of Manchester 2011-2013 Peter Briggs
# Copyright (C) University of Manchester 2011-2019 Peter Briggs
#
########################################################################
#
Expand Down Expand Up @@ -30,7 +30,7 @@
# Class definitions
#######################################################################

class Experiment:
class Experiment(object):
"""Class defining an experiment from a SOLiD run.
An 'experiment' is a collection of related data.
Expand Down Expand Up @@ -89,7 +89,7 @@ def copy(self):
expt_copy.library = self.library
return expt_copy

class ExperimentList:
class ExperimentList(object):
"""Container for a collection of Experiments
Experiments are created and added to the ExperimentList by calling
Expand Down Expand Up @@ -299,7 +299,7 @@ def __getitem__(self,key):
def __len__(self):
return len(self.experiments)

class LinkNames:
class LinkNames(object):
"""Class to construct names for links to primary data files
The LinkNames class encodes a set of naming schemes that are used to
Expand Down
10 changes: 5 additions & 5 deletions bcftbx/FASTQFile.py
@@ -1,5 +1,5 @@
# FASTQFile.py: read and manipulate FASTQ files and data
# Copyright (C) University of Manchester 2012-13 Peter Briggs
# Copyright (C) University of Manchester 2012-19 Peter Briggs
#
########################################################################
#
Expand All @@ -26,7 +26,7 @@
"""

__version__ = "1.0.0"
__version__ = "1.0.1"

CHUNKSIZE = 102400

Expand Down Expand Up @@ -144,7 +144,7 @@ def next(self):
self._ip = ip
return FastqRead(*read)

class FastqRead:
class FastqRead(object):
"""Class to store a FASTQ record with information about a read
Provides the following properties for accessing the read data:
Expand Down Expand Up @@ -262,7 +262,7 @@ def __repr__(self):
def __eq__(self,other):
return (str(self) == str(other))

class SequenceIdentifier:
class SequenceIdentifier(object):
"""Class to store/manipulate sequence identifier information from a FASTQ record
Provides access to the data items in the sequence identifier line of a FASTQ
Expand Down Expand Up @@ -386,7 +386,7 @@ def __repr__(self):
# Return what was put in
return self.__seqid

class FastqAttributes:
class FastqAttributes(object):
"""Class to provide access to gross attributes of a FASTQ file
Given a FASTQ file (can be uncompressed or gzipped), enables
Expand Down
14 changes: 7 additions & 7 deletions bcftbx/IlluminaData.py
Expand Up @@ -44,7 +44,7 @@
# Class definitions
#######################################################################

class IlluminaRun:
class IlluminaRun(object):
"""Class for examining 'raw' Illumina data directory.
Provides the following properties:
Expand Down Expand Up @@ -180,7 +180,7 @@ def cycles(self):
return None
return ncycles

class IlluminaRunInfo:
class IlluminaRunInfo(object):
"""Class for examining Illumina RunInfo.xml file
Extracts basic information from a RunInfo.xml file:
Expand Down Expand Up @@ -244,7 +244,7 @@ def bases_mask(self):
% read['is_indexed_read'])
return ','.join(bases_mask)

class IlluminaData:
class IlluminaData(object):
"""Class for examining Illumina data post bcl-to-fastq conversion
Provides the following attributes:
Expand Down Expand Up @@ -428,7 +428,7 @@ def get_project(self,name):
if project.name == name: return project
raise IlluminaDataError, "No matching project for '%s'" % name

class IlluminaProject:
class IlluminaProject(object):
"""Class for storing information on a 'project' within an Illumina run
A project is a subset of fastq files from a run of an Illumina
Expand Down Expand Up @@ -615,7 +615,7 @@ def prettyPrintSamples(self):
"""
return utils.pretty_print_names(self.samples)

class IlluminaSample:
class IlluminaSample(object):
"""Class for storing information on a 'sample' within an Illumina project
A sample is a fastq file generated within an Illumina sequencer run.
Expand Down Expand Up @@ -734,7 +734,7 @@ def __repr__(self):
i.e. the sample name."""
return str(self.name)

class SampleSheet:
class SampleSheet(object):
"""
Class for handling Illumina sample sheets
Expand Down Expand Up @@ -2313,7 +2313,7 @@ def set(self,package=None,paired_end=None,
if force_sample_dir is not None:
self._force_sample_dir = force_sample_dir

class IlluminaFastq:
class IlluminaFastq(object):
"""Class for extracting information about Fastq files
Given the name of a Fastq file from CASAVA/Illumina platform, extract
Expand Down
8 changes: 4 additions & 4 deletions bcftbx/Md5sum.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# Md5sum.py: classes and functions for md5 checksum operations
# Copyright (C) University of Manchester 2012-2014 Peter Briggs
# Copyright (C) University of Manchester 2012-2019 Peter Briggs
#
########################################################################
#
Expand Down Expand Up @@ -43,7 +43,7 @@ class methods for running MD5 checks across all files in a directory, and
# Module metadata
#######################################################################

__version__ = "1.1.0"
__version__ = "1.1.1"

#######################################################################
# Import modules that this module depends on
Expand All @@ -69,7 +69,7 @@ class methods for running MD5 checks across all files in a directory, and
# Classes
#######################################################################

class Md5Checker:
class Md5Checker(object):
"""Provides static methods for performing checks using MD5 sums
The Md5Checker class is a collection of static methods that can
Expand Down Expand Up @@ -323,7 +323,7 @@ def verify_md5sums(self,filen=None,fp=None):
status = self.MD5_ERROR
yield (f,status)

class Md5CheckReporter:
class Md5CheckReporter(object):
"""Provides a generic reporting class for Md5Checker methods
Typical usage modes are either:
Expand Down
8 changes: 4 additions & 4 deletions bcftbx/Pipeline.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#
# Pipeline.py: classes for running scripts iteratively
# Copyright (C) University of Manchester 2011 Peter Briggs
# Copyright (C) University of Manchester 2011-2019 Peter Briggs
#
########################################################################
#
Expand Down Expand Up @@ -47,7 +47,7 @@
# Module metadata
#######################################################################

__version__ = "0.1.3"
__version__ = "0.1.4"

#######################################################################
# Import modules that this module depends on
Expand All @@ -65,7 +65,7 @@
#######################################################################

# Job: container for a script run
class Job:
class Job(object):
"""Wrapper class for setting up, submitting and monitoring running scripts
Set up a job by creating a Job instance specifying the name, working directory,
Expand Down Expand Up @@ -263,7 +263,7 @@ def runner(self):
return self.__runner

# PipelineRunner: class to set up and run multiple jobs
class PipelineRunner:
class PipelineRunner(object):
"""Class to run and manage multiple concurrent jobs.
PipelineRunner enables multiple jobs to be queued via the 'queueJob' method. The
Expand Down

0 comments on commit 2b1f7de

Please sign in to comment.