# HG changeset patch # User jjohnson # Date 1529513913 14400 # Node ID e67b0cc10377c60cb04920706b344f0a7238e981 # Parent 390a3c4a7f6b635043668012517f558d7fa37137 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/spectrast commit af2d54a900c86c6b9926b87b514517c0f0f0a975-dirty diff -r 390a3c4a7f6b -r e67b0cc10377 spectrast_params.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spectrast_params.py Wed Jun 20 12:58:33 2018 -0400 @@ -0,0 +1,111 @@ +#!/usr/bin/env python + +from __future__ import print_function + +import argparse +import re +import sys + +search_opts = [ + 'libraryFile', + 'databaseFile', + 'databaseType', + 'indexCacheAll', + # 'filterSelectedListFileName', + 'precursorMzTolerance', + 'precursorMzUseAverage', + 'searchAllCharges', + 'detectHomologs', + 'fvalFractionDelta', + 'useSp4Scoring', + 'fvalUseDotBias', + 'usePValue', + 'useTierwiseOpenModSearch', + # 'expectedCysteineMod', + # 'ignoreSpectraWithUnmodCysteine', + # 'ignoreChargeOneLibSpectra', + # 'ignoreAbnormalSpectra', + 'outputExtension', + 'outputDirectory', + 'hitListTopHitFvalThreshold', + 'hitListLowerHitsFvalThreshold', + 'hitListShowHomologs', + 'hitListShowMaxRank', + 'hitListOnlyTopHit', + 'hitListExcludeNoMatch', + 'enzymeForPepXMLOutput', + 'printFingerprintingSummary', + 'filterMinPeakCount', + 'filterAllPeaksBelowMz', + 'filterMaxIntensityBelow', + 'filterMinMzRange', + 'filterCountPeakIntensityThreshold', + 'filterRemovePeakIntensityThreshold', + 'filterMaxPeaksUsed', + 'filterMaxDynamicRange', + 'peakScalingMzPower', + 'peakScalingIntensityPower', + 'peakScalingUnassignedPeaks', + 'peakNoBinning', + 'peakBinningNumBinsPerMzUnit', + 'peakBinningFractionToNeighbor', + 'filterLibMaxPeaksUsed', + 'filterLightIonsMzThreshold', + 'filterITRAQReporterPeaks', + 'filterTMTReporterPeaks', + # 'filterRemoveHuge515Threshold', +] + + +def __main__(): + parser = argparse.ArgumentParser( + description='Parse SpectraST search.params files' + + ' to create an updated search.params') + parser.add_argument( + 'param_files', nargs='*', + help='A SpectraST search.params files') + parser.add_argument( + '-o', '--output', + help='Output file (-) for stdout') + args = parser.parse_args() + + output_wtr = open(args.output, 'w')\ + if args.output and args.output != '-' else sys.stdout + + optpat = re.compile('^([a-z]\w+)\s*[=:]\s*([^=]+)$') + search_params = dict() + + # Collect all search_params + def parse_params(param_file, fh): + for i, line in enumerate(fh): + try: + m = optpat.match(line.rstrip()) + if m: + k, v = m.groups() + if k in search_opts: + search_params[k] = v + except Exception, e: + print('%s(%d): %s %s' % (param_file, i, line, e), + file=sys.stderr) + + if args.param_files: + for param_file in args.param_files: + try: + with open(param_file, 'r') as fh: + parse_params(param_file, fh) + except Exception, e: + print('parse_params: %s' % e, file=sys.stderr) + else: + try: + parse_params('stdin', sys.stdin) + except Exception, e: + print('parse_params: %s' % e, file=sys.stderr) + + # Write search_params + for search_opt in search_opts: + if search_opt in search_params: + print('%s = %s' % (search_opt, search_params[search_opt]), file=output_wtr) + + +if __name__ == "__main__": + __main__() diff -r 390a3c4a7f6b -r e67b0cc10377 spectrast_search.xml --- a/spectrast_search.xml Mon Jun 18 10:08:02 2018 -0400 +++ b/spectrast_search.xml Wed Jun 20 12:58:33 2018 -0400 @@ -3,62 +3,64 @@ macros.xml - + + @@ -346,7 +348,7 @@ - + @@ -363,22 +365,31 @@ printFingerprintingSummary and printFingerprintingSummary == 'fingerprint.summary' - + + collection['collection_selector'] == 'dataset' - - + + - + - - - + + collection['collection_selector'] == 'collection' and outputExtension == 'pep.xml' + + + + collection['collection_selector'] == 'collection' and outputExtension == 'xls' + + + + collection['collection_selector'] == 'collection' and outputExtension == 'txt' + @@ -389,7 +400,7 @@ - +