Skip to content

Commit

Permalink
Merge pull request #943 from deeptools/develop
Browse files Browse the repository at this point in the history
changed iteritmes() in estimateEscaleFactor to its python3 compatible items()
  • Loading branch information
LeilyR authored Apr 16, 2020
2 parents 09963a0 + f6570d1 commit 1e274d4
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 10 deletions.
7 changes: 6 additions & 1 deletion CHANGES.txt
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
3.4.3

* Changed iteritems() in estimateEscaleFactor to its python3 compatible items().
* Added the missing argument (--clusterUsingSamples) to plotProfile.

3.4.2

* Programmed around a bug in matplotlib that prevented the plotCorrelation scatter plot from working. See https://bioinformatics.stackexchange.com/questions/12830/plot-correlation-between-several-bam-files/12831
Expand Down Expand Up @@ -325,7 +330,7 @@
* bamPEFragmentSize now has -bs and -n options to allow adjusting the number of alignments sampled. Note that the default value is auto-adjusted if the sampling is too sparse.
* bamPEFragmentSize now accepts single-end files.
* The --hclust option to plotProfile and plotHeatmap continues even if one of the groups is too small for plotting (matplotlib will produce a warning that you can ignore). This was issue #280.

2.0.1

* A critical bug that prevented plotPCA from running was fixed.
Expand Down
8 changes: 4 additions & 4 deletions bin/estimateScaleFactor
Original file line number Diff line number Diff line change
Expand Up @@ -89,24 +89,24 @@ def parseArguments(args=None):

def main(args):
"""
The algorithm samples the genome a number of times as specified
The algorithm samples the genome a number of times as specified
by the --numberOfSamples parameter to estimate scaling factors of
betweeen to samples
betweeen to samples
"""
if len(args.bamfiles) > 2:
print("SES method to stimate scale factors only works for two samples")
exit(0)

sys.stderr.write("{:,} number of samples will be computed.\n".format(args.numberOfSamples))
sizeFactorsDict = estimateScaleFactor(args.bamfiles, args.sampleWindowLength,
sizeFactorsDict = estimateScaleFactor(args.bamfiles, args.sampleWindowLength,
args.numberOfSamples,
args.normalizationLength,
numberOfProcessors=args.numberOfProcessors,
chrsToSkip=args.ignoreForNormalization,
verbose=args.verbose)

for k, v in sizeFactorsDict.iteritems():
for k, v in sizeFactorsDict.items():
print("{}: {}".format(k, v))


Expand Down
2 changes: 1 addition & 1 deletion deeptools/_version.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# This file is originally generated from Git information by running 'setup.py
# version'. Distribution tarballs contain a pre-generated copy of this file.

__version__ = '3.4.2'
__version__ = '3.4.3'
8 changes: 8 additions & 0 deletions deeptools/parserCommon.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,14 @@ def heatmapperOptionalArgs(mode=['heatmap', 'profile'][0]):
type=int,
default=8)

optional.add_argument('--clusterUsingSamples',
help='List of sample numbers (order as in '
'matrix), that are used for clustering by '
'--kmeans or --hclust if not given, all samples '
'are taken into account for clustering. '
'Example: --ClusterUsingSamples 1 3',
type=int, nargs='+')

elif mode == 'heatmap':
optional.add_argument(
'--plotType',
Expand Down
4 changes: 2 additions & 2 deletions deeptools/plotProfile.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -909,12 +909,12 @@ def main(args=None):
filterHeatmapValues(hm, hm.parameters['min threshold'], hm.parameters['max threshold'])

if args.kmeans is not None:
hm.matrix.hmcluster(args.kmeans, method='kmeans')
hm.matrix.hmcluster(args.kmeans, method='kmeans', clustering_samples=args.clusterUsingSamples)
else:
if args.hclust is not None:
print("Performing hierarchical clustering."
"Please note that it might be very slow for large datasets.\n")
hm.matrix.hmcluster(args.hclust, method='hierarchical')
hm.matrix.hmcluster(args.hclust, method='hierarchical', clustering_samples=args.clusterUsingSamples)

group_len_ratio = np.diff(hm.matrix.group_boundaries) / float(len(hm.matrix.regions))
if np.any(group_len_ratio < 5.0 / 1000):
Expand Down
4 changes: 2 additions & 2 deletions galaxy/wrapper/deepTools_macros.xml
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<macros>

<token name="@THREADS@">--numberOfProcessors "\${GALAXY_SLOTS:-4}"</token>
<token name="@WRAPPER_VERSION@">3.4.2.0</token>
<token name="@WRAPPER_VERSION@">3.4.3.0</token>
<xml name="requirements">
<requirements>
<requirement type="package" version="3.4.2">deeptools</requirement>
<requirement type="package" version="3.4.3">deeptools</requirement>
<requirement type="package" version="1.9">samtools</requirement>
</requirements>
<expand macro="stdio" />
Expand Down

0 comments on commit 1e274d4

Please sign in to comment.