Mercurial > repos > yating-l > hubarchivecreator
comparison hubArchiveCreator.py @ 9:d5781fe7b782 draft
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit e42ecb807fb34a8e4ddcf96944dd74d24c695352-dirty
| author | yating-l |
|---|---|
| date | Wed, 28 Dec 2016 17:33:08 -0500 |
| parents | be8fd2f24c60 |
| children |
comparison
equal
deleted
inserted
replaced
| 8:be8fd2f24c60 | 9:d5781fe7b782 |
|---|---|
| 16 import sys | 16 import sys |
| 17 | 17 |
| 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 Bed import Bed | 22 from Bed import Bed |
| 22 from BigWig import BigWig | 23 from BigWig import BigWig |
| 23 from util.Fasta import Fasta | 24 from util.Fasta import Fasta |
| 24 from util.Filters import TraceBackFormatter | 25 from util.Filters import TraceBackFormatter |
| 25 from Gff3 import Gff3 | 26 from Gff3 import Gff3 |
| 26 from Gtf import Gtf | 27 from Gtf import Gtf |
| 27 from Psl import Psl | 28 from Psl import Psl |
| 28 from TrackHub import TrackHub | 29 from TrackHub import TrackHub |
| 30 from bigPsl import bigPsl | |
| 29 | 31 |
| 30 # TODO: Verify each subprocessed dependency is accessible [gff3ToGenePred, genePredToBed, twoBitInfo, faToTwoBit, bedToBigBed, sort | 32 # TODO: Verify each subprocessed dependency is accessible [gff3ToGenePred, genePredToBed, twoBitInfo, faToTwoBit, bedToBigBed, sort |
| 31 | 33 |
| 32 | 34 |
| 33 def main(argv): | 35 def main(argv): |
| 44 parser.add_argument('--gtf', action='append', help='GTF format') | 46 parser.add_argument('--gtf', action='append', help='GTF format') |
| 45 | 47 |
| 46 # Bed4+12 (TrfBig) | 48 # Bed4+12 (TrfBig) |
| 47 parser.add_argument('--bedSimpleRepeats', action='append', help='Bed4+12 format, using simpleRepeats.as') | 49 parser.add_argument('--bedSimpleRepeats', action='append', help='Bed4+12 format, using simpleRepeats.as') |
| 48 | 50 |
| 51 # Bed12+1 (regtools) | |
| 52 parser.add_argument('--bedSpliceJunctions', action='append', help='Bed12+1 format, using spliceJunctions.as') | |
| 53 | |
| 49 # Generic Bed (Blastx transformed to bed) | 54 # Generic Bed (Blastx transformed to bed) |
| 50 parser.add_argument('--bed', action='append', help='Bed generic format') | 55 parser.add_argument('--bed', action='append', help='Bed generic format') |
| 56 | |
| 57 # Bed12+12 (tblastn) | |
| 58 parser.add_argument('--bigpsl', action='append', help='bigPsl format') | |
| 51 | 59 |
| 52 # BigWig Management | 60 # BigWig Management |
| 53 parser.add_argument('--bigwig', action='append', help='BigWig format') | 61 parser.add_argument('--bigwig', action='append', help='BigWig format') |
| 54 | 62 |
| 55 # Bam Management | 63 # Bam Management |
| 111 # ARRAY[DICT{FILE_PATH: DICT{NAME: NAME_VALUE, EXTRA_DATA: EXTRA_DATA_VALUE}}] | 119 # ARRAY[DICT{FILE_PATH: DICT{NAME: NAME_VALUE, EXTRA_DATA: EXTRA_DATA_VALUE}}] |
| 112 # EXTRA_DATA could be anything, for example the index of a BAM => {"index", FILE_PATH} | 120 # EXTRA_DATA could be anything, for example the index of a BAM => {"index", FILE_PATH} |
| 113 array_inputs_bam = args.bam | 121 array_inputs_bam = args.bam |
| 114 array_inputs_bed_generic = args.bed | 122 array_inputs_bed_generic = args.bed |
| 115 array_inputs_bed_simple_repeats = args.bedSimpleRepeats | 123 array_inputs_bed_simple_repeats = args.bedSimpleRepeats |
| 124 array_inputs_bed_splice_junctions = args.bedSpliceJunctions | |
| 116 array_inputs_bigwig = args.bigwig | 125 array_inputs_bigwig = args.bigwig |
| 117 array_inputs_gff3 = args.gff3 | 126 array_inputs_gff3 = args.gff3 |
| 118 array_inputs_gtf = args.gtf | 127 array_inputs_gtf = args.gtf |
| 119 array_inputs_psl = args.psl | 128 array_inputs_psl = args.psl |
| 129 array_inputs_bigpsl = args.bigpsl | |
| 120 | 130 |
| 121 outputFile = args.output | 131 outputFile = args.output |
| 122 | 132 |
| 123 json_inputs_data = args.data_json | 133 json_inputs_data = args.data_json |
| 124 | 134 |
| 137 for (inputs, datatype_class) in [ | 147 for (inputs, datatype_class) in [ |
| 138 (array_inputs_bam, Bam), | 148 (array_inputs_bam, Bam), |
| 139 (array_inputs_bed_generic, Bed), | 149 (array_inputs_bed_generic, Bed), |
| 140 (array_inputs_bigwig, BigWig), | 150 (array_inputs_bigwig, BigWig), |
| 141 (array_inputs_bed_simple_repeats, BedSimpleRepeats), | 151 (array_inputs_bed_simple_repeats, BedSimpleRepeats), |
| 152 (array_inputs_bed_splice_junctions, BedSpliceJunctions), | |
| 142 (array_inputs_gff3, Gff3), | 153 (array_inputs_gff3, Gff3), |
| 143 (array_inputs_gtf, Gtf), | 154 (array_inputs_gtf, Gtf), |
| 144 (array_inputs_psl, Psl)]: | 155 (array_inputs_psl, Psl), |
| 156 (array_inputs_bigpsl, bigPsl)]: | |
| 145 if inputs: | 157 if inputs: |
| 146 all_datatype_dictionary.update(create_ordered_datatype_objects(datatype_class, inputs, inputs_data)) | 158 all_datatype_dictionary.update(create_ordered_datatype_objects(datatype_class, inputs, inputs_data)) |
| 147 | 159 |
| 148 # Create Ordered Dictionary to add the tracks in the tool form order | 160 # Create Ordered Dictionary to add the tracks in the tool form order |
| 149 all_datatype_ordered_dictionary = collections.OrderedDict(all_datatype_dictionary) | 161 all_datatype_ordered_dictionary = collections.OrderedDict(all_datatype_dictionary) |
