Skip to content

Commit

Permalink
Merge branch 'main' into 24.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bernt-matthias authored Mar 7, 2024
2 parents 288cce4 + 72d538d commit a3927bd
Show file tree
Hide file tree
Showing 17 changed files with 69 additions and 7,117 deletions.
1 change: 0 additions & 1 deletion .tt_skip
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ tool_collections/hgv/hgv_hilbertvis
tool_collections/hgv/snpfreq
tool_collections/taxonomy/find_diag_hits
tool_collections/taxonomy/gi2taxonomy
tool_collections/taxonomy/kraken2tax
tool_collections/taxonomy/lca_wrapper
tool_collections/taxonomy/poisson2test
tool_collections/taxonomy/t2ps
Expand Down
31 changes: 15 additions & 16 deletions tool_collections/gops/basecoverage/gops_basecoverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,40 @@
from __future__ import print_function

import fileinput
import sys

from bx.cookbook import doc_optparse
from bx.intervals.io import NiceReaderWrapper
from bx.intervals.operations.base_coverage import base_coverage
from bx.tabular.io import ParseError
from galaxy.tools.util.galaxyops import fail, parse_cols_arg, skipped

assert sys.version_info[:2] >= ( 2, 4 )


def main():
options, args = doc_optparse.parse( __doc__ )
options, args = doc_optparse.parse(__doc__)
try:
chr_col_1, start_col_1, end_col_1, strand_col_1 = parse_cols_arg( options.cols1 )
chr_col_1, start_col_1, end_col_1, strand_col_1 = parse_cols_arg(options.cols1)
in_fname, out_fname = args
except:
except Exception:
doc_optparse.exception()

g1 = NiceReaderWrapper( fileinput.FileInput( in_fname ),
chrom_col=chr_col_1,
start_col=start_col_1,
end_col=end_col_1,
strand_col=strand_col_1,
fix_strand=True )
g1 = NiceReaderWrapper(
fileinput.FileInput(in_fname),
chrom_col=chr_col_1,
start_col=start_col_1,
end_col=end_col_1,
strand_col=strand_col_1,
fix_strand=True
)

try:
bases = base_coverage(g1)
except ParseError as exc:
fail( "Invalid file format: %s" % str( exc ) )
out_file = open( out_fname, "w" )
out_file.write( "%s\n" % str( bases ) )
fail("Invalid file format: %s" % str(exc))
out_file = open(out_fname, "w")
out_file.write("%s\n" % str(bases))
out_file.close()
if g1.skipped > 0:
print(skipped( g1, filedesc="" ))
print(skipped(g1, filedesc=""))


if __name__ == "__main__":
Expand Down
47 changes: 11 additions & 36 deletions tool_collections/gops/basecoverage/operation_filter.py
Original file line number Diff line number Diff line change
@@ -1,42 +1,35 @@
# runs after the job (and after the default post-filter)
from galaxy.jobs.handler import JOB_ERROR
from galaxy.tools.parameters import DataToolParameter

# Older py compatibility
try:
set()
except:
from sets import Set as set


def validate_input( trans, error_map, param_values, page_param_map ):
def validate_input(trans, error_map, param_values, page_param_map):
dbkeys = set()
data_param_names = set()
data_params = 0
for name, param in page_param_map.items():
if isinstance( param, DataToolParameter ):
if isinstance(param, DataToolParameter):
# for each dataset parameter
if param_values.get(name, None) is not None:
dbkeys.add( param_values[name].dbkey )
dbkeys.add(param_values[name].dbkey)
data_params += 1
# check meta data
try:
param = param_values[name]
if isinstance( param.datatype, trans.app.datatypes_registry.get_datatype_by_extension( 'gff' ).__class__ ):
if isinstance(param.datatype, trans.app.datatypes_registry.get_datatype_by_extension('gff').__class__):
# TODO: currently cannot validate GFF inputs b/c they are not derived from interval.
pass
else: # Validate interval datatype.
int( param.metadata.startCol )
int( param.metadata.endCol )
int( param.metadata.chromCol )
int(param.metadata.startCol)
int(param.metadata.endCol)
int(param.metadata.chromCol)
if param.metadata.strandCol is not None:
int( param.metadata.strandCol )
except:
int(param.metadata.strandCol)
except Exception:
error_msg = "The attributes of this dataset are not properly set. " + \
"Click the pencil icon in the history item to set the chrom, start, end and strand columns."
error_map[name] = error_msg
data_param_names.add( name )
if len( dbkeys ) > 1:
data_param_names.add(name)
if len(dbkeys) > 1:
for name in data_param_names:
error_map[name] = "All datasets must belong to same genomic build, " \
"this dataset is linked to build '%s'" % param_values[name].dbkey
Expand All @@ -45,22 +38,7 @@ def validate_input( trans, error_map, param_values, page_param_map ):
error_map[name] = "A dataset of the appropriate type is required"


# Commented out by INS, 5/30/2007. What is the PURPOSE of this?
def exec_after_process(app, inp_data, out_data, param_dict, tool=None, stdout=None, stderr=None):
"""Verify the output data after each run"""
for data in out_data.values():
try:
if stderr and len( stderr ) > 0:
raise Exception( stderr )
except Exception:
data.blurb = JOB_ERROR
data.state = JOB_ERROR


def exec_after_merge(app, inp_data, out_data, param_dict, tool=None, stdout=None, stderr=None):
exec_after_process(
app, inp_data, out_data, param_dict, tool=tool, stdout=stdout, stderr=stderr)

# strip strand column if clusters were merged
for data in out_data.values():
if param_dict['returntype'] is True:
Expand All @@ -72,9 +50,6 @@ def exec_after_merge(app, inp_data, out_data, param_dict, tool=None, stdout=None


def exec_after_cluster(app, inp_data, out_data, param_dict, tool=None, stdout=None, stderr=None):
exec_after_process(
app, inp_data, out_data, param_dict, tool=tool, stdout=stdout, stderr=stderr)

# strip strand column if clusters were merged
if param_dict["returntype"] == '1':
for data in out_data.values():
Expand Down
6 changes: 3 additions & 3 deletions tool_collections/taxonomy/kraken2tax/kraken2tax.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<tool id="Kraken2Tax" name="Convert Kraken" version="1.2">
<tool id="Kraken2Tax" name="Convert Kraken" version="1.2+galaxy0">
<description>data to Galaxy taxonomy representation</description>
<requirements>
<requirement type="package" version="4.1.0">gawk</requirement>
<requirement type="package" version="1.0.0">gb_taxonomy_tools</requirement>
<requirement type="package" version="5.1.0">gawk</requirement>
<requirement type="package" version="1.0.1">gb_taxonomy_tools</requirement>
</requirements>
<command>
<![CDATA[
Expand Down
Loading

0 comments on commit a3927bd

Please sign in to comment.