mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Changes to liftOver tool: Modified the liftOver.loc file and changed the script files as required.
This commit is contained in:
@@ -17,28 +17,17 @@ infile = sys.argv[1]
|
||||
outfile1 = sys.argv[2]
|
||||
outfile2 = sys.argv[3]
|
||||
in_dbkey = sys.argv[4]
|
||||
out_dbkey = sys.argv[5]
|
||||
mapfilepath = sys.argv[5]
|
||||
|
||||
#ensure dbkeys are set
|
||||
#ensure dbkey is set
|
||||
if in_dbkey == "?":
|
||||
stop_err( "Input dataset genome build unspecified, click the pencil icon in hte history item to specify it." )
|
||||
if out_dbkey == "?":
|
||||
stop_err( "No build selected for conversion." )
|
||||
|
||||
#Check if the Mapping file exists
|
||||
#example file path: hg18ToHg17.over.chain
|
||||
mapfilename = in_dbkey + "To" + out_dbkey.capitalize() + ".over.chain"
|
||||
# TODO: Ticket # 167 - These hard-coded paths need to be removed
|
||||
mapfilepath = "/depot/data2/galaxy/" + in_dbkey + "/liftOver/" + mapfilename
|
||||
cmd_line = "liftOver " + infile + " " + mapfilepath + " " + outfile1 + " " + outfile2 + " > /dev/null 2>&1"
|
||||
|
||||
if not os.path.isfile( mapfilepath ):
|
||||
stop_err( "Mapping information from %s to %s is not currently available." % ( in_dbkey, out_dbkey ) )
|
||||
stop_err( "%s mapping is not currently available." % ( mapfilepath.split('/')[-1].split('.')[0] ) )
|
||||
try:
|
||||
os.system( cmd_line )
|
||||
except Exception, exc:
|
||||
stop_err( "Exception caught attempting conversion: %s" % str( exc ) )
|
||||
|
||||
print "%s converted to %s" % ( in_dbkey, out_dbkey )
|
||||
|
||||
|
||||
stop_err( "Exception caught attempting conversion: %s" % str( exc ) )
|
||||
@@ -6,7 +6,7 @@
|
||||
<validator type="unspecified_build" />
|
||||
</param>
|
||||
<param name="to_dbkey" type="select" label="To">
|
||||
<options from_file="/depot/data2/galaxy/liftOver.loc" name_col="1" value_col="1">
|
||||
<options from_file="/depot/data2/galaxy/liftOver.loc" name_col="1" value_col="2">
|
||||
<filter type="data_meta" data_ref="input" meta_key="dbkey" meta_key_col="0"/>
|
||||
</options>
|
||||
</param>
|
||||
@@ -19,7 +19,7 @@
|
||||
<tests>
|
||||
<test>
|
||||
<param name="input" value="5.bed" dbkey="hg18" ftype="bed" />
|
||||
<param name="to_dbkey" value="panTro2" />
|
||||
<param name="to_dbkey" value="/depot/data2/galaxy/hg18/liftOver/hg18ToPanTro2.over.chain" />
|
||||
<output name="out_file1" file="5_liftover_mapped.bed"/>
|
||||
<output name="out_file2" file="5_liftover_unmapped.bed"/>
|
||||
</test>
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
def exec_before_job(app, inp_data, out_data, param_dict, tool):
|
||||
out_data['out_file1'].set_dbkey(param_dict['to_dbkey'])
|
||||
out_data['out_file2'].set_dbkey(param_dict['to_dbkey'])
|
||||
#Assuming the path of the form liftOverDirectory/hg18ToHg17.over.chain (This is how the mapping chain files from UCSC look.)
|
||||
to_dbkey = param_dict['to_dbkey'].split('.')[0].split('To')[1]
|
||||
to_dbkey = to_dbkey[0].lower()+to_dbkey[1:]
|
||||
out_data['out_file1'].set_dbkey(to_dbkey)
|
||||
out_data['out_file2'].set_dbkey(to_dbkey)
|
||||
out_data['out_file1'].name = out_data['out_file1'].name + " [ MAPPED COORDINATES ]"
|
||||
out_data['out_file2'].name = out_data['out_file2'].name + " [ UNMAPPED COORDINATES ]"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user