mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Added a new option to specify minimum match value in the liftOver tool.
This commit is contained in:
@@ -12,20 +12,24 @@ def stop_err(msg):
|
||||
sys.stderr.write(msg)
|
||||
sys.exit()
|
||||
|
||||
if len( sys.argv ) != 6:
|
||||
stop_err( "USAGE: prog input out_file1 out_file2 input_dbkey output_dbkey" )
|
||||
if len( sys.argv ) != 7:
|
||||
stop_err( "USAGE: prog input out_file1 out_file2 input_dbkey output_dbkey minMatch" )
|
||||
|
||||
infile = sys.argv[1]
|
||||
outfile1 = sys.argv[2]
|
||||
outfile2 = sys.argv[3]
|
||||
in_dbkey = sys.argv[4]
|
||||
mapfilepath = sys.argv[5]
|
||||
|
||||
minMatch = sys.argv[6]
|
||||
try:
|
||||
assert float(minMatch)
|
||||
except:
|
||||
minMatch = 0.1
|
||||
#ensure dbkey is set
|
||||
if in_dbkey == "?":
|
||||
stop_err( "Input dataset genome build unspecified, click the pencil icon in the history item to specify it." )
|
||||
|
||||
cmd_line = "liftOver " + infile + " " + mapfilepath + " " + outfile1 + " " + outfile2 + " > /dev/null 2>&1"
|
||||
cmd_line = "liftOver -minMatch=" + minMatch + " " + infile + " " + mapfilepath + " " + outfile1 + " " + outfile2 + " > /dev/null 2>&1"
|
||||
|
||||
if not os.path.isfile( mapfilepath ):
|
||||
stop_err( "%s mapping is not currently available." % ( mapfilepath.split('/')[-1].split('.')[0] ) )
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<tool id="liftOver1" name="Convert genome coordinates">
|
||||
<description> between assemblies and genomes</description>
|
||||
<command interpreter="python">liftOver_wrapper.py $input "$out_file1" "$out_file2" $dbkey $to_dbkey</command>
|
||||
<command interpreter="python">liftOver_wrapper.py $input "$out_file1" "$out_file2" $dbkey $to_dbkey $minMatch</command>
|
||||
<inputs>
|
||||
<param format="interval" name="input" type="data" label="Convert coordinates of">
|
||||
<validator type="unspecified_build" />
|
||||
<validator type="dataset_metadata_in_file" filename="liftOver.loc" metadata_name="dbkey" metadata_column="0" message="Liftover mappings are currently not available for the specified build." />
|
||||
</param>
|
||||
</param>
|
||||
<param name="to_dbkey" type="select" label="To">
|
||||
<options from_file="liftOver.loc">
|
||||
<column name="name" index="1"/>
|
||||
@@ -13,7 +13,8 @@
|
||||
<column name="dbkey" index="0"/>
|
||||
<filter type="data_meta" ref="input" key="dbkey" column="0" />
|
||||
</options>
|
||||
</param>
|
||||
</param>
|
||||
<param name="minMatch" size="10" type="float" value="0.10" label="Minimum ratio of bases that must remap" />
|
||||
</inputs>
|
||||
<outputs>
|
||||
<data format="input" name="out_file1" />
|
||||
@@ -26,7 +27,8 @@
|
||||
<tests>
|
||||
<test>
|
||||
<param name="input" value="5.bed" dbkey="hg18" ftype="bed" />
|
||||
<param name="to_dbkey" value="/depot/data2/galaxy/hg18/liftOver/hg18ToPanTro2.over.chain" />
|
||||
<param name="to_dbkey" value="/depot/data2/galaxy/hg18/liftOver/hg18ToPanTro2.over.chain" />
|
||||
<param name="misMatch" value="0.95" />
|
||||
<output name="out_file1" file="5_liftover_mapped.bed"/>
|
||||
<output name="out_file2" file="5_liftover_unmapped.bed"/>
|
||||
</test>
|
||||
|
||||
Reference in New Issue
Block a user