diff jbrowse_hub.py @ 26:a4a54b925c73 draft

planemo upload for repository https://github.com/Yating-L/jbrowse_hub commit e81fecac281f299db00cfc88a068e056b031ae9d-dirty
author yating-l
date Wed, 15 Mar 2017 10:51:23 -0400
parents f2285f29a6fa
children 5580dbf2a31c
line wrap: on
line diff
--- a/jbrowse_hub.py	Tue Mar 14 17:41:29 2017 -0400
+++ b/jbrowse_hub.py	Wed Mar 15 10:51:23 2017 -0400
@@ -83,8 +83,6 @@
     array_inputs_blastxml = args.blastxml
     if array_inputs_bam:
         all_datatype_dictionary['bam'] = array_inputs_bam
-    if array_inputs_bai:
-        all_datatype_dictionary['bai'] = array_inputs_bai
     if array_inputs_bed_simple_repeats:
         all_datatype_dictionary['bedSimpleRepeats'] = array_inputs_bed_simple_repeats
     if array_inputs_bed_splice_junctions:
@@ -115,91 +113,6 @@
     jbrowseHub = TrackHub.TrackHub(all_tracks, reference, out_path, tool_directory, genome, extra_files_path)
     jbrowseHub.createHub()
          
-    
-
-'''
-    if reference:
-        p = subprocess.Popen(['JBrowse-1.12.1/bin/prepare-refseqs.pl', '--fasta', reference, '--out', out_path])
-        # Wait for process to terminate.
-        p.communicate()
-    else:
-        parser.print_help()
-
-   
-    if input_simple_repeats:
-        bedToGff3(input_simple_repeats, chrom_size, 'trfbig', 'repeats.gff3')
-        label = "repeats"
-        p = subprocess.Popen(['JBrowse-1.12.1/bin/flatfile-to-json.pl', '--gff', 'repeats.gff3', '--trackType', 'CanvasFeatures', '--trackLabel', label, '--out', out_path])
-        p.communicate()
-    if input_splice_junctions:
-        bedToGff3(input_splice_junctions, chrom_size, 'regtools', 'regtools.gff3')
-        label = "regtools"
-        p = subprocess.Popen(['JBrowse-1.12.1/bin/flatfile-to-json.pl', '--gff', 'regtools.gff3', '--trackType', 'CanvasFeatures', '--trackLabel', label, '--out', out_path])
-        p.communicate()
-        attr = dict()
-        track = dict()
-        attr['glyph'] = 'JBrowse/View/FeatureGlyph/Segments'
-        track['regtools'] = attr
-        json_file = os.path.join(out_path, "trackList.json")
-        utils.add_tracks_to_json(json_file, track, 'add_attr')
-    if blastxml:
-        blastxmlToGff3.blastxml2gff3(blastxml, "blast.gff3")
-        label = "blast"
-        p = subprocess.Popen(['JBrowse-1.12.1/bin/flatfile-to-json.pl', '--gff', 'blast.gff3', '--trackType', 'CanvasFeatures', '--trackLabel', label, '--out', out_path])
-        p.communicate()
-    if array_inputs_gff3:
-        for gff3 in array_inputs_gff3:
-            label = os.path.basename(gff3)
-            label = label.replace('.', '_')
-            p = subprocess.Popen(['JBrowse-1.12.1/bin/flatfile-to-json.pl', '--gff', gff3, '--trackType', 'CanvasFeatures', '--trackLabel', label, '--out', out_path])
-            p.communicate()
-            if 'Augustus' in label:
-                attr = dict()
-                track = dict()
-                attr['transcriptType'] = 'transcript'
-                track['Augustus'] = attr
-                json_file = os.path.join(out_path, "trackList.json")
-                utils.add_tracks_to_json(json_file, track, 'add_attr')
-    if bam:
-        json_file = os.path.join(out_path, "trackList.json")
-        bam_track = dict()
-        bam_track['type'] = 'JBrowse/View/Track/Alignments2'
-        bam_track['label'] = 'alignments'
-        bam_track['urlTemplate'] = '../raw/HISAT_on_data_3,_data_2,_and_data_1.bam'
-        utils.add_tracks_to_json(json_file, bam_track, 'add_tracks')
-        print "add bam track\n"
-    if bigwig:
-        json_file = os.path.join(out_path, "trackList.json")
-        bigwig_track = dict()
-        bigwig_track['label'] = 'rnaseq'
-        bigwig_track['key'] = 'RNA-Seq Coverage'
-        bigwig_track['urlTemplate'] = '../raw/Convert_Bam_to_BigWig_on_data_3_and_data_15.bigwig'
-        bigwig_track['type'] = 'JBrowse/View/Track/Wiggle/XYPlot'
-        bigwig_track['variance_band'] = True
-        bigwig_track['style'] = dict()
-        bigwig_track['style']['pos_color'] = '#FFA600'
-        bigwig_track['style']['neg_color'] = '#005EFF'
-        bigwig_track['style']['clip_marker_color'] = 'red'
-        bigwig_track['style']['height'] = 100
-        utils.add_tracks_to_json(json_file, bigwig_track, 'add_tracks')
-    
-    if gtf:
-        utils.gtfToGff3(gtf, 'stringtie.gff3', chrom_size)
-        label = os.path.basename('stringtie')
-        p = subprocess.Popen(['JBrowse-1.12.1/bin/flatfile-to-json.pl', '--gff', 'stringtie.gff3', '--trackType', 'CanvasFeatures', '--trackLabel', label, '--out', out_path])
-        p.communicate()
-        attr = dict()
-        track = dict()
-        attr['glyph'] = 'JBrowse/View/FeatureGlyph/Segments'
-        track['stringtie'] = attr
-        json_file = os.path.join(out_path, "trackList.json")
-        utils.add_tracks_to_json(json_file, track, 'add_attr')
-        
-    # Index name, it takes a long time, exclude it for now
-    p = subprocess.Popen(['JBrowse-1.12.1/bin/generate-names.pl', '-v', '--out', out_path])
-    p.communicate()
-    print "finished name index \n"
-'''
 
 if __name__ == "__main__":
     main(sys.argv)