Skip to content

Commit

Permalink
Implement #832 (#835)
Browse files Browse the repository at this point in the history
* Implement #832

* update dti requirement
  • Loading branch information
dpryan79 authored May 15, 2019
1 parent 7cb5336 commit 57a6dbb
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
11 changes: 10 additions & 1 deletion deeptools/plotEnrichment.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ def plot_enrichment_args():
type=parserCommon.writableFile,
metavar='FILE')

optional.add_argument('--attributeKey',
help='Instead of deriving labels from the feature column in a GTF file, '
'use the given attribute key, such as gene_biotype. For BED files or '
'entries without the attribute key, None is used as the label.')

optional.add_argument('--labels', '-l',
metavar='sample1 sample2',
help='User defined labels instead of default labels from '
Expand Down Expand Up @@ -495,10 +500,14 @@ def main(args=None):
if len(args.labels) != len(args.bamfiles):
sys.exit("Error: The number of labels ({0}) does not match the number of BAM files ({1})!".format(len(args.labels), len(args.bamfiles)))

# Ensure that if we're given an attributeKey that it's not empty
if args.attributeKey and args.attributeKey == "":
args.attributeKey = None

global gtf
if not args.regionLabels and args.smartLabels:
args.regionLabels = smartLabels(args.BED)
gtf = Enrichment(args.BED, keepExons=args.keepExons, labels=args.regionLabels)
gtf = Enrichment(args.BED, keepExons=args.keepExons, labels=args.regionLabels, attributeKey=args.attributeKey)

# Get fragment size and chromosome dict
fhs = [openBam(x) for x in args.bamfiles]
Expand Down
9 changes: 9 additions & 0 deletions galaxy/wrapper/plotEnrichment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
#end if
#if $advancedOpt.showAdvancedOpt == "yes"
#if $advancedOpt.attributeKey and str($advancedOpt.attributeKey).strip() != "":
--attributeKey '$advancedOpt.attributeKey'
#end if
#if $advancedOpt.labels and str($advancedOpt.labels).strip() != "":
--labels $advancedOpt.labels
#end if
Expand Down Expand Up @@ -84,6 +88,11 @@
<expand macro="input_image_file_format" />

<expand macro="advancedOpt_scaffold">
<param argument="--attributeKey" type="text" size="20" label="Optional attribute key"
help="Instead of deriving the feature label from the feature column, use the value of the given
attribute key. For example, the gene_biotype. Note that &quot;None&quote; is used for BED files
or entries where the attributeKey is not found." />

<param argument="--plotHeight" type="integer" value="20" min="3"
label="Plot height"
help="Height in cm. The default for the plot height is 20 centimeters. The minimum value is 3 cm." />
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ py2bit>=0.2.0
numpydoc>=0.5
pyBigWig>=0.2.1
plotly>=2.0.0
deeptoolsintervals>=0.1.7
deeptoolsintervals>=0.1.8
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def openREADME():
"pyBigWig >= 0.2.1",
"py2bit >= 0.2.0",
"plotly >= 2.0.0",
"deeptoolsintervals >= 0.1.7"
"deeptoolsintervals >= 0.1.8"
],
zip_safe=True,
cmdclass={'sdist': sdist, 'install': install}
Expand Down

0 comments on commit 57a6dbb

Please sign in to comment.