Merge pull request #1148 from markiskander/bcfgz_to_bcf_converter

Bcf.gz to bcf (and reverse) converters + bcf_bgzip data type
This commit is contained in:
Björn Grüning
2016-01-06 11:48:33 +01:00
6 changed files with 94 additions and 3 deletions
+6 -1
View File
@@ -247,7 +247,12 @@
<display file="igv/vcf.xml" />
<display file="rviewer/vcf.xml" inherit="True"/>
</datatype>
<datatype extension="bcf" type="galaxy.datatypes.binary:Bcf" mimetype="application/octet-stream" display_in_upload="True"/>
<datatype extension="bcf" type="galaxy.datatypes.binary:Bcf" mimetype="application/octet-stream" display_in_upload="True">
<converter file="bcf_to_bcf_bgzip_converter.xml" target_datatype="bcf_bgzip"/>
</datatype>
<datatype extension="bcf_bgzip" type="galaxy.datatypes.binary:Binary" mimetype="application/octet-stream" subclass="True">
<converter file="bcf_bgzip_to_bcf_converter.xml" target_datatype="bcf"/>
</datatype>
<datatype extension="velvet" type="galaxy.datatypes.assembly:Velvet" display_in_upload="false"/>
<datatype extension="wig" type="galaxy.datatypes.interval:Wiggle" display_in_upload="true" description="The wiggle format is line-oriented. Wiggle data is preceded by a track definition line, which adds a number of options for controlling the default display of this track." description_url="https://wiki.galaxyproject.org/Learn/Datatypes#Wig">
<converter file="wig_to_bigwig_converter.xml" target_datatype="bigwig"/>
+16 -2
View File
@@ -225,6 +225,22 @@ galaxy.datatypes.converters.vcf_to_vcf_bgzip module
:undoc-members:
:show-inheritance:
galaxy.datatypes.converters.bcf_bgzip_to_bcf module
---------------------------------------------------
.. automodule:: galaxy.datatypes.converters.bcf_bgzip_to_bcf
:members:
:undoc-members:
:show-inheritance:
galaxy.datatypes.converters.bcf_to_bcf_bgzip module
---------------------------------------------------
.. automodule:: galaxy.datatypes.converters.bcf_to_bcf_bgzip
:members:
:undoc-members:
:show-inheritance:
galaxy.datatypes.converters.wiggle_to_array_tree_converter module
-----------------------------------------------------------------
@@ -240,5 +256,3 @@ galaxy.datatypes.converters.wiggle_to_simple_converter module
:members:
:undoc-members:
:show-inheritance:
@@ -0,0 +1,22 @@
#!/usr/bin/env python
"""
Uses bcftools to extract a bcf from a bcf.gz
usage: %prog in_file out_file
"""
import optparse
import subprocess
def main():
# Read options, args.
parser = optparse.OptionParser()
(options, args) = parser.parse_args()
input_fname, output_fname = args
subprocess.call(["bcftools", "view", input_fname, "-o", output_fname, "-O", "u"])
if __name__ == "__main__":
main()
@@ -0,0 +1,14 @@
<tool id="CONVERTER_bcf_bgzip_to_bcf" name="Convert BCF_BGZIP to BCF" version="0.0.1" hidden="false">
<!-- <description>__NOT_USED_CURRENTLY_FOR_CONVERTERS__</description> -->
<command interpreter="python">bcf_bgzip_to_bcf_converter.py '$input1' '$output1'</command>
<inputs>
<page>
<param format="bcf_bgzip" name="input1" type="data" label="Choose bcf_bgzip file"/>
</page>
</inputs>
<outputs>
<data format="bcf" name="output1"/>
</outputs>
<help>
</help>
</tool>
@@ -0,0 +1,22 @@
#!/usr/bin/env python
"""
Uses bcftools to compress a bcf into a bcf.gz
usage: %prog in_file out_file
"""
import optparse
import subprocess
def main():
# Read options, args.
parser = optparse.OptionParser()
(options, args) = parser.parse_args()
input_fname, output_fname = args
subprocess.call(["bcftools", "view", input_fname, "-o", output_fname, "-O", "b"])
if __name__ == "__main__":
main()
@@ -0,0 +1,14 @@
<tool id="CONVERTER_bcf_to_bcf_bgzip" name="Convert BCF to BCF_BGZIP" version="0.0.1" hidden="false">
<!-- <description>__NOT_USED_CURRENTLY_FOR_CONVERTERS__</description> -->
<command interpreter="python">bcf_to_bcf_bgzip_converter.py '$input1' '$output1'</command>
<inputs>
<page>
<param format="bcf" name="input1" type="data" label="Choose bcf file"/>
</page>
</inputs>
<outputs>
<data format="bcf_bgzip" name="output1"/>
</outputs>
<help>
</help>
</tool>