comparison hubArchiveCreator.py @ 24:fcc1021bd496 draft

planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 93e2e2fb59f99677425104a80c17f665fa7b2b4a-dirty
author yating-l
date Wed, 31 May 2017 11:35:16 -0400
parents 884ee2a71680
children 7e8a8b732db3
comparison
equal deleted inserted replaced
23:2677f1899aa8 24:fcc1021bd496
18 # Internal dependencies 18 # Internal dependencies
19 from Bam import Bam 19 from Bam import Bam
20 from BedSimpleRepeats import BedSimpleRepeats 20 from BedSimpleRepeats import BedSimpleRepeats
21 from BedSpliceJunctions import BedSpliceJunctions 21 from BedSpliceJunctions import BedSpliceJunctions
22 from Bed import Bed 22 from Bed import Bed
23 from cytoBand import cytoBand
23 from BigWig import BigWig 24 from BigWig import BigWig
24 from util.Fasta import Fasta 25 from util.Fasta import Fasta
25 from util.Filters import TraceBackFormatter 26 from util.Filters import TraceBackFormatter
26 from Gff3 import Gff3 27 from Gff3 import Gff3
27 from Gtf import Gtf 28 from Gtf import Gtf
28 from Psl import Psl 29 from Psl import Psl
29 from TrackHub import TrackHub 30 from TrackHub import TrackHub
30 from bigPsl import bigPsl 31 from bigPsl import bigPsl
31 from BedBlastAlignments import BedBlastAlignments 32 from BedBlastAlignments import BedBlastAlignments
33 from BigBed import BigBed
32 34
33 # TODO: Verify each subprocessed dependency is accessible [gff3ToGenePred, genePredToBed, twoBitInfo, faToTwoBit, bedToBigBed, sort 35 # TODO: Verify each subprocessed dependency is accessible [gff3ToGenePred, genePredToBed, twoBitInfo, faToTwoBit, bedToBigBed, sort
34 36
35 37
36 def main(argv): 38 def main(argv):
53 parser.add_argument('--bedSpliceJunctions', action='append', help='Bed12+1 format, using spliceJunctions.as') 55 parser.add_argument('--bedSpliceJunctions', action='append', help='Bed12+1 format, using spliceJunctions.as')
54 56
55 # Generic Bed (Blastx transformed to bed) 57 # Generic Bed (Blastx transformed to bed)
56 parser.add_argument('--bed', action='append', help='Bed generic format') 58 parser.add_argument('--bed', action='append', help='Bed generic format')
57 59
60 #cytoBandIdeo
61 parser.add_argument('--cytoBand', action='append', help='Cytoband Track, using cytoBandIdeo.as')
62
58 # BigPsl (blat alignment) 63 # BigPsl (blat alignment)
59 parser.add_argument('--bigpsl', action='append', help='bigPsl format, using bigPsl.as') 64 parser.add_argument('--bigpsl', action='append', help='bigPsl format, using bigPsl.as')
60 65
61 # Bed12+12 (tblastn alignment) 66 # Bed12+12 (tblastn alignment)
62 parser.add_argument('--bedBlastAlignments', action='append', help='Bed12+12 format, using bigPsl.as') 67 parser.add_argument('--bedBlastAlignments', action='append', help='Bed12+12 format, using bigPsl.as')
67 # Bam Management 72 # Bam Management
68 parser.add_argument('--bam', action='append', help='Bam format') 73 parser.add_argument('--bam', action='append', help='Bam format')
69 74
70 # Psl Management 75 # Psl Management
71 parser.add_argument('--psl', action='append', help='Psl format') 76 parser.add_argument('--psl', action='append', help='Psl format')
77
78 # BigBed Management
79 parser.add_argument('--bigbed', action='append', help='BigBed format')
72 80
73 # TODO: Check if the running directory can have issues if we run the tool outside 81 # TODO: Check if the running directory can have issues if we run the tool outside
74 parser.add_argument('-d', '--directory', 82 parser.add_argument('-d', '--directory',
75 help='Running tool directory, where to find the templates. Default is running directory') 83 help='Running tool directory, where to find the templates. Default is running directory')
76 parser.add_argument('-u', '--ucsc_tools_path', 84 parser.add_argument('-u', '--ucsc_tools_path',
122 # These inputs are populated in the Galaxy Wrapper xml and are in this format: 130 # These inputs are populated in the Galaxy Wrapper xml and are in this format:
123 # ARRAY[DICT{FILE_PATH: DICT{NAME: NAME_VALUE, EXTRA_DATA: EXTRA_DATA_VALUE}}] 131 # ARRAY[DICT{FILE_PATH: DICT{NAME: NAME_VALUE, EXTRA_DATA: EXTRA_DATA_VALUE}}]
124 # EXTRA_DATA could be anything, for example the index of a BAM => {"index", FILE_PATH} 132 # EXTRA_DATA could be anything, for example the index of a BAM => {"index", FILE_PATH}
125 array_inputs_bam = args.bam 133 array_inputs_bam = args.bam
126 array_inputs_bed_generic = args.bed 134 array_inputs_bed_generic = args.bed
135 array_inputs_bed_cytoBand = args.cytoBand
127 array_inputs_bed_simple_repeats = args.bedSimpleRepeats 136 array_inputs_bed_simple_repeats = args.bedSimpleRepeats
128 array_inputs_bed_splice_junctions = args.bedSpliceJunctions 137 array_inputs_bed_splice_junctions = args.bedSpliceJunctions
129 array_inputs_bigwig = args.bigwig 138 array_inputs_bigwig = args.bigwig
130 array_inputs_gff3 = args.gff3 139 array_inputs_gff3 = args.gff3
131 array_inputs_gtf = args.gtf 140 array_inputs_gtf = args.gtf
132 array_inputs_psl = args.psl 141 array_inputs_psl = args.psl
133 array_inputs_bigpsl = args.bigpsl 142 array_inputs_bigpsl = args.bigpsl
134 array_inputs_bed_blast_alignments = args.bedBlastAlignments 143 array_inputs_bed_blast_alignments = args.bedBlastAlignments
144 array_inputs_bigbed = args.bigbed
135 145
136 outputFile = args.output 146 outputFile = args.output
137 147
138 json_inputs_data = args.data_json 148 json_inputs_data = args.data_json
139 149
150 all_datatype_dictionary = {} 160 all_datatype_dictionary = {}
151 161
152 for (inputs, datatype_class) in [ 162 for (inputs, datatype_class) in [
153 (array_inputs_bam, Bam), 163 (array_inputs_bam, Bam),
154 (array_inputs_bed_generic, Bed), 164 (array_inputs_bed_generic, Bed),
165 (array_inputs_bed_cytoBand, cytoBand),
155 (array_inputs_bigwig, BigWig), 166 (array_inputs_bigwig, BigWig),
156 (array_inputs_bed_simple_repeats, BedSimpleRepeats), 167 (array_inputs_bed_simple_repeats, BedSimpleRepeats),
157 (array_inputs_bed_splice_junctions, BedSpliceJunctions), 168 (array_inputs_bed_splice_junctions, BedSpliceJunctions),
158 (array_inputs_gff3, Gff3), 169 (array_inputs_gff3, Gff3),
159 (array_inputs_gtf, Gtf), 170 (array_inputs_gtf, Gtf),
160 (array_inputs_psl, Psl), 171 (array_inputs_psl, Psl),
161 (array_inputs_bigpsl, bigPsl), 172 (array_inputs_bigpsl, bigPsl),
162 (array_inputs_bed_blast_alignments, BedBlastAlignments)]: 173 (array_inputs_bed_blast_alignments, BedBlastAlignments),
174 (array_inputs_bigbed, BigBed)]:
163 if inputs: 175 if inputs:
164 all_datatype_dictionary.update(create_ordered_datatype_objects(datatype_class, inputs, inputs_data)) 176 all_datatype_dictionary.update(create_ordered_datatype_objects(datatype_class, inputs, inputs_data))
165 177
166 # Create Ordered Dictionary to add the tracks in the tool form order 178 # Create Ordered Dictionary to add the tracks in the tool form order
167 all_datatype_ordered_dictionary = collections.OrderedDict(all_datatype_dictionary) 179 all_datatype_ordered_dictionary = collections.OrderedDict(all_datatype_dictionary)