]
+DEBUG:root:----- Beginning of Track adding processing -----
+DEBUG:root:We just added in /home/galaxy/galaxy/database/jobs/000/188/dataset_213_files/myHub/Dbia3/groups.txt the group Default group
+DEBUG:root:We just added track gonramp_HISAT2_Accepted_Hits_bam (in group default_group)
+DEBUG:root:We DON'T add in /home/galaxy/galaxy/database/jobs/000/188/dataset_213_files/myHub/Dbia3/groups.txt the group Default group
+DEBUG:root:We just added track gonramp_RNA_Seq_Alignment_Coverage_bigwig (in group default_group)
+DEBUG:root:We just added in /home/galaxy/galaxy/database/jobs/000/188/dataset_213_files/myHub/Dbia3/groups.txt the group Other group
+DEBUG:root:We just added track gonramp_StringTie_Assembled_Transcripts_bb (in group other_group)
+DEBUG:root:We DON'T add in /home/galaxy/galaxy/database/jobs/000/188/dataset_213_files/myHub/Dbia3/groups.txt the group Other group
+DEBUG:root:We just added track gonramp_Multi_Fasta_GlimmerHMM_Gene_Predictions_bb (in group other_group)
+DEBUG:root:----- End of Track adding processing -----
+DEBUG:root:#### End of HubArchiveCreator Debug Mode: Bye! ####
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 test-data/two_groups_multiple_tracks/myHub/Dbia3.html
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 test-data/two_groups_multiple_tracks/myHub/Dbia3/description.html
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 test-data/two_groups_multiple_tracks/myHub/Dbia3/groups.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/two_groups_multiple_tracks/myHub/Dbia3/groups.txt Tue Sep 26 16:44:58 2017 -0400
@@ -0,0 +1,10 @@
+name default_group
+label Default group
+priority 2
+defaultIsClosed 0
+
+name other_group
+label Other group
+priority 2
+defaultIsClosed 0
+
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 test-data/two_groups_multiple_tracks/myHub/Dbia3/trackDb.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/two_groups_multiple_tracks/myHub/Dbia3/trackDb.txt Tue Sep 26 16:44:58 2017 -0400
@@ -0,0 +1,50 @@
+
+track gonramp_HISAT2_Accepted_Hits_bam
+longLabel HISAT2 Accepted Hits.bam
+shortLabel HISAT2 Accepted H
+bigDataUrl tracks/HISAT2_Accepted_Hits.bam
+type bam
+visibility pack
+thickDrawItem off
+priority 11
+color 0,0,0
+group default_group
+searchIndex name
+
+track gonramp_RNA_Seq_Alignment_Coverage_bigwig
+longLabel RNA-Seq Alignment Coverage
+shortLabel RNA-Seq Alignment
+bigDataUrl tracks/RNA-Seq_Alignment_Coverage.bigwig
+visibility full
+priority 10
+color 0,0,0
+group default_group
+type bigWig 1.000000 39.000000
+autoScale on
+maxHeightPixels 100:32:8
+windowingFunction mean+whiskers
+
+
+track gonramp_StringTie_Assembled_Transcripts_bb
+longLabel StringTie Assembled Transcripts
+shortLabel StringTie Assembl
+bigDataUrl tracks/StringTie_Assembled_Transcripts.bb
+type bigGenePred
+visibility dense
+thickDrawItem off
+priority 20
+color 0,0,0
+group other_group
+searchIndex name
+
+track gonramp_Multi_Fasta_GlimmerHMM_Gene_Predictions_bb
+longLabel Multi-Fasta GlimmerHMM Gene Predictions
+shortLabel Multi-Fasta Glimm
+bigDataUrl tracks/Multi-Fasta_GlimmerHMM_Gene_Predictions.bb
+type bigGenePred
+visibility dense
+thickDrawItem off
+priority 21
+color 0,0,0
+group other_group
+searchIndex name
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 test-data/two_groups_multiple_tracks/myHub/Dbia3/tracks/HISAT2_Accepted_Hits.bam
Binary file test-data/two_groups_multiple_tracks/myHub/Dbia3/tracks/HISAT2_Accepted_Hits.bam has changed
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 test-data/two_groups_multiple_tracks/myHub/Dbia3/tracks/HISAT2_Accepted_Hits.bam.bai
Binary file test-data/two_groups_multiple_tracks/myHub/Dbia3/tracks/HISAT2_Accepted_Hits.bam.bai has changed
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 test-data/two_groups_multiple_tracks/myHub/Dbia3/tracks/Multi-Fasta_GlimmerHMM_Gene_Predictions.bb
Binary file test-data/two_groups_multiple_tracks/myHub/Dbia3/tracks/Multi-Fasta_GlimmerHMM_Gene_Predictions.bb has changed
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 test-data/two_groups_multiple_tracks/myHub/Dbia3/tracks/RNA-Seq_Alignment_Coverage.bigwig
Binary file test-data/two_groups_multiple_tracks/myHub/Dbia3/tracks/RNA-Seq_Alignment_Coverage.bigwig has changed
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 test-data/two_groups_multiple_tracks/myHub/Dbia3/tracks/StringTie_Assembled_Transcripts.bb
Binary file test-data/two_groups_multiple_tracks/myHub/Dbia3/tracks/StringTie_Assembled_Transcripts.bb has changed
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 test-data/two_groups_multiple_tracks/myHub/genomes.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/two_groups_multiple_tracks/myHub/genomes.txt Tue Sep 26 16:44:58 2017 -0400
@@ -0,0 +1,10 @@
+genome Dbia3
+trackDb Dbia3/trackDb.txt
+groups Dbia3/groups.txt
+description Dbia3
+twoBitPath Dbia3/Dbia3.2bit
+organism Dbia3
+defaultPos contig25
+orderKey 4500
+scientificName Dbia3
+htmlPath Dbia3/description.html
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 test-data/two_groups_multiple_tracks/myHub/hub.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/two_groups_multiple_tracks/myHub/hub.txt Tue Sep 26 16:44:58 2017 -0400
@@ -0,0 +1,6 @@
+hub gonrampDbia3
+shortLabel Dbia3
+longLabel Dbia3
+genomesFile genomes.txt
+email gonramp@temporary.domain
+descriptionUrl Dbia3.html
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 test-data/two_groups_multiple_tracks/two_groups_multiple_tracks_trackhub.html
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/two_groups_multiple_tracks/two_groups_multiple_tracks_trackhub.html Tue Sep 26 16:44:58 2017 -0400
@@ -0,0 +1,82 @@
+
+
+
+
+ The following has been generated by Hub Archive Creator:
+
+
+
+ -
+ myHub
+
+
+ -
+ .
+
+
+
+
+
+
+
+
+
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 test-data/two_groups_no_track/__main__.log
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/two_groups_no_track/__main__.log Tue Sep 26 16:44:58 2017 -0400
@@ -0,0 +1,16 @@
+DEBUG:root:#### Welcome in HubArchiveCreator Debug Mode ####
+
+DEBUG:root:Calling faToTwoBit:
+DEBUG:root:---------
+DEBUG:root:
+DEBUG:root:Calling twoBitInfo:
+DEBUG:root:---------
+DEBUG:root:
+DEBUG:root:Calling sort:
+DEBUG:root:---------
+DEBUG:root:
+DEBUG:root:----- End of all_datatype_dictionary processing -----
+DEBUG:root:all_datatype_ordered_dictionary keys are: []
+DEBUG:root:----- Beginning of Track adding processing -----
+DEBUG:root:----- End of Track adding processing -----
+DEBUG:root:#### End of HubArchiveCreator Debug Mode: Bye! ####
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 test-data/two_groups_no_track/myHub/Dbia3.html
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 test-data/two_groups_no_track/myHub/Dbia3/description.html
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 test-data/two_groups_no_track/myHub/genomes.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/two_groups_no_track/myHub/genomes.txt Tue Sep 26 16:44:58 2017 -0400
@@ -0,0 +1,10 @@
+genome Dbia3
+trackDb Dbia3/trackDb.txt
+groups Dbia3/groups.txt
+description Dbia3
+twoBitPath Dbia3/Dbia3.2bit
+organism Dbia3
+defaultPos contig25
+orderKey 4500
+scientificName Dbia3
+htmlPath Dbia3/description.html
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 test-data/two_groups_no_track/myHub/hub.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/two_groups_no_track/myHub/hub.txt Tue Sep 26 16:44:58 2017 -0400
@@ -0,0 +1,6 @@
+hub gonrampDbia3
+shortLabel Dbia3
+longLabel Dbia3
+genomesFile genomes.txt
+email gonramp@temporary.domain
+descriptionUrl Dbia3.html
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 test-data/two_groups_no_track/two_groups_no_track_trackhub.html
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/two_groups_no_track/two_groups_no_track_trackhub.html Tue Sep 26 16:44:58 2017 -0400
@@ -0,0 +1,54 @@
+
+
+
+
+ The following has been generated by Hub Archive Creator:
+
+
+
+ -
+ myHub
+
+
+ -
+ .
+
+
+
+
+
+
+
+
+
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 test-data/two_groups_one_track_both/__main__.log
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/two_groups_one_track_both/__main__.log Tue Sep 26 16:44:58 2017 -0400
@@ -0,0 +1,42 @@
+DEBUG:root:#### Welcome in HubArchiveCreator Debug Mode ####
+
+DEBUG:root:Calling faToTwoBit:
+DEBUG:root:---------
+DEBUG:root:
+DEBUG:root:Calling twoBitInfo:
+DEBUG:root:---------
+DEBUG:root:
+DEBUG:root:Calling sort:
+DEBUG:root:---------
+DEBUG:root:
+DEBUG:root:input_false_path: /home/galaxy/galaxy/database/datasets/000/dataset_157.dat
+DEBUG:root:data_value: {u'long_label': u'', u'name': u'RNA-Seq_Alignment_Coverage', u'database': u'', u'track_color': u'#000000', u'group_name': u'Default group', u'order_index': u'10'}
+DEBUG:root:input_false_path: /home/galaxy/galaxy/database/datasets/000/dataset_158.dat
+DEBUG:root:data_value: {u'long_label': u'', u'name': u'StringTie_Assembled_Transcripts', u'database': u'', u'track_color': u'#000000', u'group_name': u'Other group', u'order_index': u'20'}
+DEBUG:root:Calling gtfToGenePred:
+DEBUG:root:---------
+DEBUG:root:
+DEBUG:root:Calling genePredToBigGenePred:
+DEBUG:root:---------
+DEBUG:root:
+DEBUG:root:Calling sort:
+DEBUG:root:---------
+DEBUG:root:
+DEBUG:root:sorted_bed_file_name: /tmp/tmpnPwD96.sortedBed.bigGenePred
+DEBUG:root:chrom_sizes_file_name: /tmp/tmp1csS9Z.chrom.sizes
+DEBUG:root:big_bed_file_name: /home/galaxy/galaxy/database/jobs/000/186/dataset_211_files/myHub/Dbia3/tracks/StringTie_Assembled_Transcripts.bb
+DEBUG:root:typeOption: bed12+8
+DEBUG:root:autoSql: /home/galaxy/shed_tools/toolshed.g2.bx.psu.edu/repos/rmarenco/hubarchivecreator/6aa28a85cc38/hubarchivecreator/bigGenePred.as
+DEBUG:root:tab option: True
+DEBUG:root:Calling bedToBigBed:
+DEBUG:root:---------
+DEBUG:root:
+DEBUG:root:----- End of all_datatype_dictionary processing -----
+DEBUG:root:all_datatype_ordered_dictionary keys are: [, ]
+DEBUG:root:----- Beginning of Track adding processing -----
+DEBUG:root:We just added in /home/galaxy/galaxy/database/jobs/000/186/dataset_211_files/myHub/Dbia3/groups.txt the group Default group
+DEBUG:root:We just added track gonramp_RNA_Seq_Alignment_Coverage_bigwig (in group default_group)
+DEBUG:root:We just added in /home/galaxy/galaxy/database/jobs/000/186/dataset_211_files/myHub/Dbia3/groups.txt the group Other group
+DEBUG:root:We just added track gonramp_StringTie_Assembled_Transcripts_bb (in group other_group)
+DEBUG:root:----- End of Track adding processing -----
+DEBUG:root:#### End of HubArchiveCreator Debug Mode: Bye! ####
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 test-data/two_groups_one_track_both/myHub/Dbia3.html
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 test-data/two_groups_one_track_both/myHub/Dbia3/description.html
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 test-data/two_groups_one_track_both/myHub/Dbia3/groups.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/two_groups_one_track_both/myHub/Dbia3/groups.txt Tue Sep 26 16:44:58 2017 -0400
@@ -0,0 +1,10 @@
+name default_group
+label Default group
+priority 2
+defaultIsClosed 0
+
+name other_group
+label Other group
+priority 2
+defaultIsClosed 0
+
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 test-data/two_groups_one_track_both/myHub/Dbia3/trackDb.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/two_groups_one_track_both/myHub/Dbia3/trackDb.txt Tue Sep 26 16:44:58 2017 -0400
@@ -0,0 +1,26 @@
+
+track gonramp_RNA_Seq_Alignment_Coverage_bigwig
+longLabel RNA-Seq Alignment Coverage
+shortLabel RNA-Seq Alignment
+bigDataUrl tracks/RNA-Seq_Alignment_Coverage.bigwig
+visibility full
+priority 10
+color 0,0,0
+group default_group
+type bigWig 1.000000 39.000000
+autoScale on
+maxHeightPixels 100:32:8
+windowingFunction mean+whiskers
+
+
+track gonramp_StringTie_Assembled_Transcripts_bb
+longLabel StringTie Assembled Transcripts
+shortLabel StringTie Assembl
+bigDataUrl tracks/StringTie_Assembled_Transcripts.bb
+type bigGenePred
+visibility dense
+thickDrawItem off
+priority 20
+color 0,0,0
+group other_group
+searchIndex name
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 test-data/two_groups_one_track_both/myHub/Dbia3/tracks/RNA-Seq_Alignment_Coverage.bigwig
Binary file test-data/two_groups_one_track_both/myHub/Dbia3/tracks/RNA-Seq_Alignment_Coverage.bigwig has changed
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 test-data/two_groups_one_track_both/myHub/Dbia3/tracks/StringTie_Assembled_Transcripts.bb
Binary file test-data/two_groups_one_track_both/myHub/Dbia3/tracks/StringTie_Assembled_Transcripts.bb has changed
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 test-data/two_groups_one_track_both/myHub/genomes.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/two_groups_one_track_both/myHub/genomes.txt Tue Sep 26 16:44:58 2017 -0400
@@ -0,0 +1,10 @@
+genome Dbia3
+trackDb Dbia3/trackDb.txt
+groups Dbia3/groups.txt
+description Dbia3
+twoBitPath Dbia3/Dbia3.2bit
+organism Dbia3
+defaultPos contig25
+orderKey 4500
+scientificName Dbia3
+htmlPath Dbia3/description.html
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 test-data/two_groups_one_track_both/myHub/hub.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/two_groups_one_track_both/myHub/hub.txt Tue Sep 26 16:44:58 2017 -0400
@@ -0,0 +1,6 @@
+hub gonrampDbia3
+shortLabel Dbia3
+longLabel Dbia3
+genomesFile genomes.txt
+email gonramp@temporary.domain
+descriptionUrl Dbia3.html
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 test-data/two_groups_one_track_both/two_groups_one_track_both_trackhub.html
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/two_groups_one_track_both/two_groups_one_track_both_trackhub.html Tue Sep 26 16:44:58 2017 -0400
@@ -0,0 +1,73 @@
+
+
+
+
+ The following has been generated by Hub Archive Creator:
+
+
+
+ -
+ myHub
+
+
+ -
+ .
+
+
+
+
+
+
+
+
+
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 test-data/two_groups_one_track_first/__main__.log
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/two_groups_one_track_first/__main__.log Tue Sep 26 16:44:58 2017 -0400
@@ -0,0 +1,20 @@
+DEBUG:root:#### Welcome in HubArchiveCreator Debug Mode ####
+
+DEBUG:root:Calling faToTwoBit:
+DEBUG:root:---------
+DEBUG:root:
+DEBUG:root:Calling twoBitInfo:
+DEBUG:root:---------
+DEBUG:root:
+DEBUG:root:Calling sort:
+DEBUG:root:---------
+DEBUG:root:
+DEBUG:root:input_false_path: /home/galaxy/galaxy/database/datasets/000/dataset_157.dat
+DEBUG:root:data_value: {u'long_label': u'', u'name': u'RNA-Seq_Alignment_Coverage', u'database': u'', u'track_color': u'#000000', u'group_name': u'Default group', u'order_index': u'10'}
+DEBUG:root:----- End of all_datatype_dictionary processing -----
+DEBUG:root:all_datatype_ordered_dictionary keys are: []
+DEBUG:root:----- Beginning of Track adding processing -----
+DEBUG:root:We just added in /home/galaxy/galaxy/database/jobs/000/184/dataset_209_files/myHub/Dbia3/groups.txt the group Default group
+DEBUG:root:We just added track gonramp_RNA_Seq_Alignment_Coverage_bigwig (in group default_group)
+DEBUG:root:----- End of Track adding processing -----
+DEBUG:root:#### End of HubArchiveCreator Debug Mode: Bye! ####
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 test-data/two_groups_one_track_first/myHub/Dbia3.html
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 test-data/two_groups_one_track_first/myHub/Dbia3/description.html
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 test-data/two_groups_one_track_first/myHub/Dbia3/groups.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/two_groups_one_track_first/myHub/Dbia3/groups.txt Tue Sep 26 16:44:58 2017 -0400
@@ -0,0 +1,5 @@
+name default_group
+label Default group
+priority 2
+defaultIsClosed 0
+
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 test-data/two_groups_one_track_first/myHub/Dbia3/trackDb.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/two_groups_one_track_first/myHub/Dbia3/trackDb.txt Tue Sep 26 16:44:58 2017 -0400
@@ -0,0 +1,14 @@
+
+track gonramp_RNA_Seq_Alignment_Coverage_bigwig
+longLabel RNA-Seq Alignment Coverage
+shortLabel RNA-Seq Alignment
+bigDataUrl tracks/RNA-Seq_Alignment_Coverage.bigwig
+visibility full
+priority 10
+color 0,0,0
+group default_group
+type bigWig 1.000000 39.000000
+autoScale on
+maxHeightPixels 100:32:8
+windowingFunction mean+whiskers
+
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 test-data/two_groups_one_track_first/myHub/Dbia3/tracks/RNA-Seq_Alignment_Coverage.bigwig
Binary file test-data/two_groups_one_track_first/myHub/Dbia3/tracks/RNA-Seq_Alignment_Coverage.bigwig has changed
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 test-data/two_groups_one_track_first/myHub/genomes.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/two_groups_one_track_first/myHub/genomes.txt Tue Sep 26 16:44:58 2017 -0400
@@ -0,0 +1,10 @@
+genome Dbia3
+trackDb Dbia3/trackDb.txt
+groups Dbia3/groups.txt
+description Dbia3
+twoBitPath Dbia3/Dbia3.2bit
+organism Dbia3
+defaultPos contig25
+orderKey 4500
+scientificName Dbia3
+htmlPath Dbia3/description.html
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 test-data/two_groups_one_track_first/myHub/hub.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/two_groups_one_track_first/myHub/hub.txt Tue Sep 26 16:44:58 2017 -0400
@@ -0,0 +1,6 @@
+hub gonrampDbia3
+shortLabel Dbia3
+longLabel Dbia3
+genomesFile genomes.txt
+email gonramp@temporary.domain
+descriptionUrl Dbia3.html
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 test-data/two_groups_one_track_first/two_groups_one_track_first_trackhub.html
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/two_groups_one_track_first/two_groups_one_track_first_trackhub.html Tue Sep 26 16:44:58 2017 -0400
@@ -0,0 +1,70 @@
+
+
+
+
+ The following has been generated by Hub Archive Creator:
+
+
+
+ -
+ myHub
+
+
+ -
+ .
+
+
+
+
+
+
+
+
+
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 tool_dependencies.xml
--- a/tool_dependencies.xml Wed Aug 09 16:40:21 2017 -0400
+++ b/tool_dependencies.xml Tue Sep 26 16:44:58 2017 -0400
@@ -16,7 +16,7 @@
-
+
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 util/Fasta.py
--- a/util/Fasta.py Wed Aug 09 16:40:21 2017 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf8 -*-
-
-"""
-Class describing the Fasta format
-(As of the 07/20/2016, only used with the reference genome)
-"""
-
-class Fasta(object):
- def __init__(self, false_path, name, assembly_id):
- self.false_path = false_path
- self.name = name
-
- if not assembly_id:
- assembly_id = "unknown"
- self.assembly_id = assembly_id
\ No newline at end of file
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 util/Fasta.pyc
Binary file util/Fasta.pyc has changed
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 util/Filters.py
--- a/util/Filters.py Wed Aug 09 16:40:21 2017 -0400
+++ b/util/Filters.py Tue Sep 26 16:44:58 2017 -0400
@@ -7,3 +7,5 @@
if record.exc_text or record.exc_info:
s = record.message
return s
+
+
\ No newline at end of file
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 util/Filters.pyc
Binary file util/Filters.pyc has changed
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 util/Logger.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/util/Logger.py Tue Sep 26 16:44:58 2017 -0400
@@ -0,0 +1,38 @@
+import os
+import sys
+import json
+import logging
+import logging.config
+
+#from util.Filters import TraceBackFormatter
+
+class Logger(object):
+ def __init__(self, tool_directory, debug="False", extra_files_path=None):
+ self.tool_directory = tool_directory
+ self.default_level = logging.INFO
+ self.debug = debug
+ self.extra_files_path = extra_files_path
+
+ def setup_logging(self):
+ """Setup logging configuration
+ reference: https://fangpenlin.com/posts/2012/08/26/good-logging-practice-in-python/
+ """
+ config_path = os.path.join(self.tool_directory, 'logging.json')
+ default_level=logging.INFO
+ if self.debug.lower() == "true":
+ default_level=logging.DEBUG
+ if os.path.exists(config_path):
+ with open(config_path, 'rt') as f:
+ config = json.load(f)
+ config["root"]["level"] = default_level
+ if self.extra_files_path:
+ for i in config["handlers"]:
+ if "filename" in config["handlers"][i]:
+ config["handlers"][i]["filename"] = os.path.join(self.extra_files_path, config["handlers"][i]["filename"])
+ logging.config.dictConfig(config)
+ else:
+ logging.warn("Extra files path is not set. The log files will exist at current working directory instead of final output folder")
+ else:
+ logging.basicConfig(level=default_level)
+ logging.warn("Cannot find logging configuration file!\n")
+
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 util/Logger.pyc
Binary file util/Logger.pyc has changed
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 util/Reader.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/util/Reader.py Tue Sep 26 16:44:58 2017 -0400
@@ -0,0 +1,116 @@
+import json
+import logging
+import codecs
+
+
+# Internal dependencies
+from datatypes.binary.Bam import Bam
+from datatypes.binary.BigWig import BigWig
+from datatypes.binary.BigBed import BigBed
+from datatypes.interval.Bed import Bed
+from datatypes.interval.BedSimpleRepeats import BedSimpleRepeats
+from datatypes.interval.BedSpliceJunctions import BedSpliceJunctions
+from datatypes.interval.CytoBand import CytoBand
+from datatypes.interval.BedBlatAlignments import BedBlatAlignments
+from datatypes.interval.BedBlastAlignments import BedBlastAlignments
+from datatypes.interval.Gff3 import Gff3
+from datatypes.interval.Gtf import Gtf
+from datatypes.interval.Psl import Psl
+from datatypes.sequence.Fasta import Fasta
+from util import santitizer
+
+class Reader(object):
+
+ DATATYPE_CLASS = [Bam, BigWig, BigBed, Bed, BedSimpleRepeats, BedSpliceJunctions, CytoBand, BedBlatAlignments, BedBlastAlignments, Gff3, Gtf, Psl, Fasta]
+
+ def __init__(self, input_json_file):
+ self.inputFile = input_json_file
+ self.args = self.loadJson()
+
+
+ def loadJson(self):
+ try:
+ data_file = codecs.open(self.inputFile, 'r', 'utf-8')
+ return json.load(data_file)
+ except IOError:
+ print "Cannot find JSON file\n"
+ exit(1)
+
+ def getToolDir(self):
+ try:
+ return self.args["tool_directory"]
+ except KeyError:
+ print ("tool_directory is not defined in the input file!")
+ exit(1)
+
+ def getExtFilesPath(self):
+ try:
+ return self.args["extra_files_path"]
+ except KeyError:
+ print ("extra_files_path is not defined in the input file!")
+ exit(1)
+
+ def getUserEmail(self):
+ try:
+ return self.args["user_email"]
+ except KeyError:
+ print ("user_email is not defined in the input file!")
+ exit(1)
+
+ def getDebugMode(self):
+ try:
+ return self.args["debug_mode"]
+ except KeyError:
+ print ("debug_mode is not defined in the input file!")
+ exit(1)
+
+
+ def getRefGenome(self):
+ array_inputs_reference_genome = self.args["fasta"]
+ # TODO: Replace these with the object Fasta
+ input_fasta_file = array_inputs_reference_genome["false_path"]
+ input_fasta_file_name = santitizer.sanitize_name_input(array_inputs_reference_genome["name"])
+ genome_name = santitizer.sanitize_name_input(self.args["genome_name"])
+ reference_genome = Fasta(input_fasta_file,
+ input_fasta_file_name, genome_name)
+ return reference_genome
+
+
+ def getTracksData(self):
+ self.logger = logging.getLogger(__name__)
+ all_datatype_dictionary = dict()
+ for datatype in self.DATATYPE_CLASS:
+ class_name = datatype.__name__
+ array_inputs = self.args.get(str(class_name))
+ if array_inputs:
+ self.logger.debug("Create %s objects\n", class_name)
+ self.logger.debug("array_inputs: %s", array_inputs)
+ all_datatype_dictionary.update(self.create_ordered_datatype_objects(datatype, array_inputs))
+
+ return all_datatype_dictionary
+
+ def create_ordered_datatype_objects(self, ExtensionClass, array_inputs):
+ """
+ Function which executes the creation all the necessary files / folders for a special Datatype, for TrackHub
+ and update the dictionary of datatype
+
+ :param ExtensionClass:
+ :param array_inputs:
+ :type ExtensionClass: Datatype
+ :type array_inputs: list[string]
+ """
+
+ datatype_dictionary = {}
+
+ # TODO: Optimize this double loop
+ for input_data in array_inputs:
+ input_false_path = input_data["false_path"]
+ extensionObject = ExtensionClass(input_false_path, input_data)
+ extensionObject.generateCustomTrack()
+ datatype_dictionary.update({input_data["order_index"]: extensionObject})
+ return datatype_dictionary
+
+
+
+
+
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 util/Reader.pyc
Binary file util/Reader.pyc has changed
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 util/__init__.pyc
Binary file util/__init__.pyc has changed
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 util/index/DatabaseIndex.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/util/index/DatabaseIndex.py Tue Sep 26 16:44:58 2017 -0400
@@ -0,0 +1,44 @@
+#!/usr/bin/python
+
+import collections
+from ExternIndex import ExternIndex
+
+class DatabaseIndex(ExternIndex):
+ def __init__(self, database, **args):
+ self.database = database
+ self.seqType=args.get("seqType")
+ self.useIframe=args.get("useIframe")
+ self.iframeHeight=args.get("iframeHeight")
+ self.iframeWidth=args.get("iframeWidth")
+
+ def setExtLink(self):
+ return self.setDatabaseLink(self.database, self.seqType, self.useIframe, self.iframeHeight, self.iframeWidth)
+
+
+ def setDatabaseLink(self, database, seqType=None, useIframe=None, iframeHeight=None, iframeWidth=None):
+ database_settings = collections.OrderedDict()
+ if "NCBI" in database:
+ if not seqType:
+ database_settings["url"] = "https://www.ncbi.nlm.nih.gov/gquery/?term=$$"
+ elif seqType == 2:
+ database_settings["url"] = "https://www.ncbi.nlm.nih.gov/protein/$$"
+ elif seqType == 1:
+ database_settings["url"] = "https://www.ncbi.nlm.nih.gov/nuccore/$$"
+ else:
+ raise Exception("Sequence Type {0} is not valid, should be either protein (seqType==2) or nucleotide (seqType==1). Stopping the application".format(seqType))
+ elif "UniProt" in database:
+ database_settings["url"] = "http://www.uniprot.org/uniprot/$$"
+ elif "FlyBase" in database:
+ database_settings["url"] = "http://flybase.org/reports/$$"
+ else:
+ database_settings["url"] = "https://www.ncbi.nlm.nih.gov/gquery/?term=$$"
+ database_settings["urlLabel"] = database + " Details:"
+ if useIframe or useIframe is None:
+ database_settings["iframeUrl"] = database_settings["url"]
+ if not iframeHeight:
+ iframeHeight = "600"
+ if not iframeWidth:
+ iframeWidth = "800"
+ database_settings["iframeOptions"] = "height= %s width= %s" % (iframeHeight, iframeWidth)
+ return database_settings
+
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 util/index/DatabaseIndex.pyc
Binary file util/index/DatabaseIndex.pyc has changed
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 util/index/ExternIndex.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/util/index/ExternIndex.py Tue Sep 26 16:44:58 2017 -0400
@@ -0,0 +1,60 @@
+#!/usr/bin/python
+import collections
+import abc
+from abc import ABCMeta
+
+class ExternIndex(object):
+ __metaclass__ = ABCMeta
+
+ @abc.abstractmethod
+ def __init__(self):
+ """init"""
+
+ @abc.abstractmethod
+ def setExtLink(self):
+ """set external link"""
+
+
+
+
+ '''
+ @staticmethod
+ def setExtLink(database, inputFile, extra_settings, seqType=None, useIframe=True, iframeHeight=None, iframeWidth=None):
+ if "NCBI" in database:
+ if not seqType:
+ seqType = int(ExternIndex.getSeqType(inputFile))
+ else:
+ seqType = seqType
+ if seqType < 0:
+ print seqType
+ raise Exception("Sequence Type is not set for bigPsl. Stopping the application")
+ if seqType == 2:
+ extra_settings["url"] = "https://www.ncbi.nlm.nih.gov/protein/$$"
+ elif seqType == 1:
+ extra_settings["url"] = "https://www.ncbi.nlm.nih.gov/nuccore/$$"
+ else:
+ raise Exception("Sequence Type {0} is not valid for bigPsl. Stopping the application".format(seqType))
+ elif "UniProt" in database:
+ extra_settings["url"] = "http://www.uniprot.org/uniprot/$$"
+ elif "FlyBase" in database:
+ extra_settings["url"] = "http://flybase.org/reports/$$"
+ else:
+ extra_settings["url"] = "https://www.ncbi.nlm.nih.gov/gquery/?term=$$"
+ extra_settings["urlLabel"] = database + " Details:"
+ if useIframe:
+ extra_settings["iframeUrl"] = extra_settings["url"]
+ if not iframeHeight:
+ iframeHeight = "600"
+ if not iframeWidth:
+ iframeWidth = "800"
+ extra_settings["iframeOptions"] = "height= %s width= %s" % (iframeHeight, iframeWidth)
+
+ @staticmethod
+ def getSeqType(inputFile):
+ with open(inputFile, "r") as bigpsl:
+ sampleSeq = bigpsl.readline().split()
+ if len(sampleSeq) == 25:
+ return sampleSeq[-1]
+ else:
+ return "-1"
+ '''
\ No newline at end of file
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 util/index/ExternIndex.pyc
Binary file util/index/ExternIndex.pyc has changed
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 util/index/__init__.py
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 util/index/__init__.pyc
Binary file util/index/__init__.pyc has changed
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 util/log.pyc
Binary file util/log.pyc has changed
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 util/santitizer.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/util/santitizer.py Tue Sep 26 16:44:58 2017 -0400
@@ -0,0 +1,59 @@
+#!/usr/bin/python
+# -*- coding: utf8 -*-
+
+"""
+This class handles the subprocess calls of the different tools used
+in HubArchiveCreator
+"""
+
+import logging
+import os
+import subprocess
+import sys
+import string
+import tempfile
+
+
+def prefixTrackName(filename):
+ """
+ santitize trackName. Because track name must begin with a letter and
+ contain only the following chars: [a-zA-Z0-9_].
+ See the "track" Common settings at:
+ https://genome.ucsc.edu/goldenpath/help/trackDb/trackDbHub.html#bigPsl_-_Pairwise_Alignments
+ skip the santitization for cytoBandIdeo track
+ """
+ if filename == 'cytoBandIdeo':
+ return filename
+ valid_chars = "_%s%s" % (string.ascii_letters, string.digits)
+ sanitize_name = ''.join([c if c in valid_chars else '_' for c in filename])
+ sanitize_name = "gonramp_" + sanitize_name
+ return sanitize_name
+
+def sanitize_name_input(string_to_sanitize):
+ """
+ Sanitize the string passed in parameter by replacing '/' and ' ' by '_'
+
+ :param string_to_sanitize:
+ :return :
+
+ :Example:
+
+ >>> sanitize_name_input('this/is an//example')
+ this_is_an__example
+ """
+ return string_to_sanitize \
+ .replace("/", "_") \
+ .replace(" ", "_")
+
+
+def sanitize_name_inputs(inputs_data):
+ """
+ Sanitize value of the keys "name" of the dictionary passed in parameter.
+
+ Because sometimes output from Galaxy, or even just file name, from user inputs, have spaces.
+ Also, it can contain '/' character and could break the use of os.path function.
+
+ :param inputs_data: dict[string, dict[string, string]]
+ """
+ for key in inputs_data:
+ inputs_data[key]["name"] = sanitize_name_input(inputs_data[key]["name"])
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 util/santitizer.pyc
Binary file util/santitizer.pyc has changed
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 util/subtools.py
--- a/util/subtools.py Wed Aug 09 16:40:21 2017 -0400
+++ b/util/subtools.py Tue Sep 26 16:44:58 2017 -0400
@@ -13,6 +13,7 @@
import string
import tempfile
+
class PopenError(Exception):
def __init__(self, cmd, error, return_code):
self.cmd = cmd
@@ -20,10 +21,13 @@
self.return_code = return_code
def __str__(self):
- message = "The subprocess {0} has returned the error: {1}.".format(self.cmd, self.return_code)
- message = ','.join((message, "Its error message is: {0}".format(self.error)))
+ message = "The subprocess {0} has returned the error: {1}.".format(
+ self.cmd, self.return_code)
+ message = ','.join(
+ (message, "Its error message is: {0}".format(self.error)))
return repr(message)
+
def _handleExceptionAndCheckCall(array_call, **kwargs):
"""
This class handle exceptions and call the tool.
@@ -41,12 +45,13 @@
# TODO: Check the value of array_call and <=[0]
logging.debug("Calling {0}:".format(cmd))
-
+ logging.debug("%s", array_call)
logging.debug("---------")
# TODO: Use universal_newlines option from Popen?
try:
- p = subprocess.Popen(array_call, stdout=stdout, stderr=stderr, shell=shell)
+ p = subprocess.Popen(array_call, stdout=stdout,
+ stderr=stderr, shell=shell)
# TODO: Change this because of possible memory issues => https://docs.python.org/2/library/subprocess.html#subprocess.Popen.communicate
@@ -64,29 +69,35 @@
raise PopenError(cmd, error, p.returncode)
else:
# TODO: To Handle properly with a design behind, if we received a option as a file for the error
- raise Exception("Error when calling {0}. Error as been logged in your file {1}. Error code: {2}"\
+ raise Exception("Error when calling {0}. Error as been logged in your file {1}. Error code: {2}"
.format(cmd, stderr.name, p.returncode))
except OSError as e:
- message = "The subprocess {0} has encountered an OSError: {1}".format(cmd, e.strerror)
+ message = "The subprocess {0} has encountered an OSError: {1}".format(
+ cmd, e.strerror)
if e.filename:
- message = '\n'.join((message, ", against this file: {0}".format(e.filename)))
+ message = '\n'.join(
+ (message, ", against this file: {0}".format(e.filename)))
logging.error(message)
sys.exit(-1)
except PopenError as p:
- message = "The subprocess {0} has returned the error: {1}.".format(p.cmd, p.return_code)
- message = '\n'.join((message, "Its error message is: {0}".format(p.error)))
+ message = "The subprocess {0} has returned the error: {1}.".format(
+ p.cmd, p.return_code)
+ message = '\n'.join(
+ (message, "Its error message is: {0}".format(p.error)))
logging.exception(message)
sys.exit(p.return_code)
except Exception as e:
- message = "The subprocess {0} has encountered an unknown error: {1}".format(cmd, e)
+ message = "The subprocess {0} has encountered an unknown error: {1}".format(
+ cmd, e)
logging.exception(message)
sys.exit(-1)
return p
+
def twoBitInfo(two_bit_file_name, two_bit_info_file):
"""
Call twoBitInfo and write the result into twoBit_info_file
@@ -98,6 +109,7 @@
p = _handleExceptionAndCheckCall(array_call)
return p
+
def faToTwoBit(fasta_file_name, twoBitFile):
"""
This function call faToTwoBit UCSC tool, and return the twoBitFile
@@ -111,6 +123,7 @@
return twoBitFile
+
def gtfToGenePred(input_gtf_file_name, gene_pred_file_name):
"""
Call gtfToGenePred and write the result into gene_pred_file_name
@@ -122,6 +135,7 @@
p = _handleExceptionAndCheckCall(array_call)
return p
+
def gff3ToGenePred(input_gff3_file_name, gene_pred_file_name):
"""
Call gff3ToGenePred and write the result into gene_pred_file_name
@@ -129,12 +143,11 @@
:param gene_pred_file_name:
:return:
"""
- valid_gff3_file = tempfile.NamedTemporaryFile(bufsize=0, suffix=".gff3")
- validateGff(input_gff3_file_name, valid_gff3_file.name)
- array_call = ['gff3ToGenePred', valid_gff3_file.name, gene_pred_file_name]
+ array_call = ['gff3ToGenePred', input_gff3_file_name, gene_pred_file_name]
p = _handleExceptionAndCheckCall(array_call)
return p
+
def genePredToBigGenePred(gene_pred_file_name, unsorted_bigGenePred_file_name):
"""
Call genePredToBigGenePred and write the result into unsorted_bigGenePred_file_name
@@ -148,6 +161,7 @@
p = _handleExceptionAndCheckCall(array_call)
return p
+
def genePredToBed(gene_pred_file_name, unsorted_bed_file_name):
"""
Call genePredToBed and write the result into unsorted_bed_file_name
@@ -159,6 +173,7 @@
p = _handleExceptionAndCheckCall(array_call)
return p
+
def sort(unsorted_bed_file_name, sorted_bed_file_name):
"""
Call sort with -k1,1 -k2,2n on unsorted_bed_file_name and write the result into sorted_bed_file_name
@@ -166,10 +181,12 @@
:param sorted_bed_file_name:
:return:
"""
- array_call = ['sort', '-k', '1,1', '-k', '2,2n', unsorted_bed_file_name, '-o', sorted_bed_file_name]
+ array_call = ['sort', '-k', '1,1', '-k', '2,2n',
+ unsorted_bed_file_name, '-o', sorted_bed_file_name]
p = _handleExceptionAndCheckCall(array_call)
return p
+
def sortChromSizes(two_bit_info_file_name, chrom_sizes_file_name):
"""
Call sort with -k2rn on two_bit_info_file_name and write the result into chrom_sizes_file_name
@@ -177,12 +194,13 @@
:param chrom_sizes_file_name:
:return:
"""
- array_call = ['sort', '-k2rn', two_bit_info_file_name, '-o', chrom_sizes_file_name]
+ array_call = ['sort', '-k2rn', two_bit_info_file_name,
+ '-o', chrom_sizes_file_name]
p = _handleExceptionAndCheckCall(array_call)
return p
-def bedToBigBed(sorted_bed_file_name, chrom_sizes_file_name, big_bed_file_name,
- typeOption=None, autoSql=None, tab=False, extraIndex=None):
+
+def bedToBigBed(sorted_bed_file_name, chrom_sizes_file_name, big_bed_file_name, options=None):
"""
Call bedToBigBed on sorted_bed_file_name, using chrom_sizes_file_name and write the result into big_bed_file_name
:param sorted_bed_file_name:
@@ -191,28 +209,24 @@
:return:
"""
- # TODO: Move this into the _handleExceptionAndCheckCall function
- # Parse the array
- logging.debug("sorted_bed_file_name: {0}".format(sorted_bed_file_name))
- logging.debug("chrom_sizes_file_name: {0}".format(chrom_sizes_file_name))
- logging.debug("big_bed_file_name: {0}".format(big_bed_file_name))
- logging.debug("typeOption: {0}".format(typeOption))
- logging.debug("autoSql: {0}".format(autoSql))
- logging.debug("tab option: {0}".format(tab))
-
- array_call = ['bedToBigBed', sorted_bed_file_name, chrom_sizes_file_name, big_bed_file_name]
- if typeOption:
- typeOption = ''.join(['-type=', typeOption])
- array_call.append(typeOption)
- if autoSql:
- autoSql = ''.join(['-as=', autoSql])
- array_call.append(autoSql)
- if tab:
- array_call.append('-tab')
- if extraIndex:
- index = ''.join(['-extraIndex=', extraIndex])
- array_call.append(index)
-
+ array_call = ['bedToBigBed', sorted_bed_file_name,
+ chrom_sizes_file_name, big_bed_file_name]
+ if options:
+ typeOption = options.get("typeOption")
+ autoSql = options.get("autoSql")
+ tab = options.get("tab")
+ extraIndex = options.get("extraIndex")
+ if typeOption:
+ typeOption = ''.join(['-type=', typeOption])
+ array_call.append(typeOption)
+ if autoSql:
+ autoSql = ''.join(['-as=', autoSql])
+ array_call.append(autoSql)
+ if tab:
+ array_call.append('-tab')
+ if extraIndex:
+ index = ''.join(['-extraIndex=', extraIndex])
+ array_call.append(index)
p = _handleExceptionAndCheckCall(array_call)
return p
@@ -223,10 +237,12 @@
:param output_sorted_bam_name:
:return:
"""
- array_call = ['samtools', 'sort', input_bam_file_name, '-o', output_sorted_bam_name]
+ array_call = ['samtools', 'sort',
+ input_bam_file_name, '-o', output_sorted_bam_name]
p = _handleExceptionAndCheckCall(array_call)
return p
+
def createBamIndex(input_sorted_bam_file_name, output_name_index_name):
"""
Call `samtools index` on imput_sorted_bam_file_name and output the result in output_name_index_name
@@ -234,10 +250,12 @@
:param output_name_index_name:
:return:
"""
- array_call = ['samtools', 'index', input_sorted_bam_file_name, output_name_index_name]
+ array_call = ['samtools', 'index',
+ input_sorted_bam_file_name, output_name_index_name]
p = _handleExceptionAndCheckCall(array_call)
return p
+
def pslToBigPsl(input_psl_file_name, output_bed12_file_name):
"""
Call `pslToBigPsl` on input_psl_file_name and output the result in output_bed12_file_name
@@ -251,30 +269,44 @@
p = _handleExceptionAndCheckCall(array_call)
return p
-#santitize trackName. Because track name must begin with a letter and
+# santitize trackName. Because track name must begin with a letter and
# contain only the following chars: [a-zA-Z0-9_].
# See the "track" Common settings at:
-#https://genome.ucsc.edu/goldenpath/help/trackDb/trackDbHub.html#bigPsl_-_Pairwise_Alignments
-def fixName(filename):
- if filename == 'cytoBandIdeo':
- return filename
- valid_chars = "_%s%s" % (string.ascii_letters, string.digits)
- sanitize_name = ''.join([c if c in valid_chars else '_' for c in filename])
- sanitize_name = "gonramp_" + sanitize_name
- return sanitize_name
+# https://genome.ucsc.edu/goldenpath/help/trackDb/trackDbHub.html#bigPsl_-_Pairwise_Alignments
-def validateGff(orig_gff3, valid_gff3):
+def validateFiles(input_file, chrom_sizes_file_name, file_type, options=None):
+ """
+ Call validateFiles on input_file, using chrom_sizes_file_name and file_type
+ :param input_file:
+ :param chrom_sizes_file_name:
+ :param file_type:
+ :return:
"""
- Remove extra meta line: ##gff-version 3
+
+ array_call = ['validateFiles', '-chromInfo=' + chrom_sizes_file_name, '-type='+ file_type, input_file]
+ if options:
+ tab = options.get("tab")
+ autoSql = options.get("autoSql")
+ logging.debug("tab: {0}".format(tab))
+ logging.debug("autoSql: {0}".format(autoSql))
+ if autoSql:
+ autoSql = ''.join(['-as=', autoSql])
+ array_call.append(autoSql)
+ if tab:
+ array_call.append('-tab')
+ p = _handleExceptionAndCheckCall(array_call)
+ return p
+
+def pslCheck(input_file, options=None):
"""
- valid = open(valid_gff3, 'w')
- num = 0
- with open(orig_gff3, 'r') as f:
- for line in f:
- if '##gff-version 3' in line:
- if num == 0:
- num += 1
- else:
- continue
- valid.write(line)
-
+ Call pslCheck on input_file
+ :param input_file:
+ :return:
+ """
+
+ array_call = ['pslCheck', input_file]
+ p = _handleExceptionAndCheckCall(array_call)
+ return p
+
+
+
diff -r 5a4206366b41 -r 4ca7cbf2d9b8 util/subtools.pyc
Binary file util/subtools.pyc has changed