Use sam_fa_indexes tool data table instead of searching the dbkey in sam_fa_indices.loc also in Cufflinks wrappers

This commit is contained in:
Nicola Soranzo
2013-06-24 14:17:42 +02:00
parent 9019b1c68b
commit 6001e2549e
8 changed files with 68 additions and 128 deletions
+5 -25
View File
@@ -8,20 +8,6 @@ def stop_err( msg ):
sys.stderr.write( '%s\n' % msg )
sys.exit()
# Copied from sam_to_bam.py:
def check_seq_file( dbkey, cached_seqs_pointer_file ):
seq_path = ''
for line in open( cached_seqs_pointer_file ):
line = line.rstrip( '\r\n' )
if line and not line.startswith( '#' ) and line.startswith( 'index' ):
fields = line.split( '\t' )
if len( fields ) < 3:
continue
if fields[1] == dbkey:
seq_path = fields[2].strip()
break
return seq_path
def __main__():
#Parse Command Line
parser = optparse.OptionParser()
@@ -30,8 +16,7 @@ def __main__():
parser.add_option( '-s', dest='use_seq_data', action="store_true", help='Causes cuffcompare to look into for fasta files with the underlying genomic sequences (one file per contig) against which your reads were aligned for some optional classification functions. For example, Cufflinks transcripts consisting mostly of lower-case bases are classified as repeats. Note that <seq_dir> must contain one fasta file per reference chromosome, and each file must be named after the chromosome, and have a .fa or .fasta extension.')
# Wrapper / Galaxy options.
parser.add_option( '', '--dbkey', dest='dbkey', help='The build of the reference dataset' )
parser.add_option( '', '--index_dir', dest='index_dir', help='GALAXY_DATA_INDEX_DIR' )
parser.add_option( '', '--index', dest='index', help='The path of the reference genome' )
parser.add_option( '', '--ref_file', dest='ref_file', help='The reference dataset from the history' )
# Outputs.
@@ -60,21 +45,16 @@ def __main__():
# Set/link to sequence file.
if options.use_seq_data:
if options.ref_file != 'None':
if options.ref_file:
# Sequence data from history.
# Create symbolic link to ref_file so that index will be created in working directory.
seq_path = "ref.fa"
os.symlink( options.ref_file, seq_path )
else:
# Sequence data from loc file.
cached_seqs_pointer_file = os.path.join( options.index_dir, 'sam_fa_indices.loc' )
if not os.path.exists( cached_seqs_pointer_file ):
stop_err( 'The required file (%s) does not exist.' % cached_seqs_pointer_file )
# If found for the dbkey, seq_path will look something like /galaxy/data/equCab2/sam_index/equCab2.fa,
# and the equCab2.fa file will contain fasta sequences.
seq_path = check_seq_file( options.dbkey, cached_seqs_pointer_file )
if seq_path == '':
stop_err( 'No sequence data found for dbkey %s, so sequence data cannot be used.' % options.dbkey )
if not os.path.exists( options.index ):
stop_err( 'Reference genome %s not present, request it by reporting this error.' % options.index )
seq_path = options.index
# Build command.
+11 -6
View File
@@ -1,4 +1,4 @@
<tool id="cuffcompare" name="Cuffcompare" version="0.0.5">
<tool id="cuffcompare" name="Cuffcompare" version="0.0.6">
<!-- Wrapper supports Cuffcompare versions v1.3.0 and newer -->
<description>compare assembled transcripts to a reference annotation and track Cufflinks transcripts across multiple experiments</description>
<requirements>
@@ -17,14 +17,12 @@
## Use sequence data?
#if $seq_data.use_seq_data == "Yes":
-s
-s
#if $seq_data.seq_source.index_source == "history":
--ref_file=$seq_data.seq_source.ref_file
#else:
--ref_file="None"
--index=${seq_data.seq_source.index.fields.path}
#end if
--dbkey=${first_input.metadata.dbkey}
--index_dir=${GALAXY_DATA_INDEX_DIR}
#end if
## Outputs.
@@ -66,7 +64,14 @@
<option value="cached">Locally cached</option>
<option value="history">History</option>
</param>
<when value="cached"></when>
<when value="cached">
<param name="index" type="select" label="Using reference genome">
<options from_data_table="sam_fa_indexes">
<filter type="data_meta" ref="first_input" key="dbkey" column="1" />
<validator type="no_options" message="No reference genome is available for the build associated with the selected input dataset" />
</options>
</param>
</when>
<when value="history">
<param name="ref_file" type="data" format="fasta" label="Using reference file" />
</when>
+5 -25
View File
@@ -35,20 +35,6 @@ def stop_err( msg ):
sys.stderr.write( "%s\n" % msg )
sys.exit()
# Copied from sam_to_bam.py:
def check_seq_file( dbkey, cached_seqs_pointer_file ):
seq_path = ''
for line in open( cached_seqs_pointer_file ):
line = line.rstrip( '\r\n' )
if line and not line.startswith( '#' ) and line.startswith( 'index' ):
fields = line.split( '\t' )
if len( fields ) < 3:
continue
if fields[1] == dbkey:
seq_path = fields[2].strip()
break
return seq_path
def __main__():
#Parse Command Line
parser = optparse.OptionParser()
@@ -83,8 +69,7 @@ def __main__():
# Bias correction options.
parser.add_option( '-b', dest='do_bias_correction', action="store_true", help='Providing Cufflinks with a multifasta file via this option instructs it to run our new bias detection and correction algorithm which can significantly improve accuracy of transcript abundance estimates.')
parser.add_option( '', '--dbkey', dest='dbkey', help='The build of the reference dataset' )
parser.add_option( '', '--index_dir', dest='index_dir', help='GALAXY_DATA_INDEX_DIR' )
parser.add_option( '', '--index', dest='index', help='The path of the reference genome' )
parser.add_option( '', '--ref_file', dest='ref_file', help='The reference dataset from the history' )
# Outputs.
@@ -123,21 +108,16 @@ def __main__():
# If doing bias correction, set/link to sequence file.
if options.do_bias_correction:
if options.ref_file != 'None':
if options.ref_file:
# Sequence data from history.
# Create symbolic link to ref_file so that index will be created in working directory.
seq_path = "ref.fa"
os.symlink( options.ref_file, seq_path )
else:
# Sequence data from loc file.
cached_seqs_pointer_file = os.path.join( options.index_dir, 'sam_fa_indices.loc' )
if not os.path.exists( cached_seqs_pointer_file ):
stop_err( 'The required file (%s) does not exist.' % cached_seqs_pointer_file )
# If found for the dbkey, seq_path will look something like /galaxy/data/equCab2/sam_index/equCab2.fa,
# and the equCab2.fa file will contain fasta sequences.
seq_path = check_seq_file( options.dbkey, cached_seqs_pointer_file )
if seq_path == '':
stop_err( 'No sequence data found for dbkey %s, so bias correction cannot be used.' % options.dbkey )
if not os.path.exists( options.index ):
stop_err( 'Reference genome %s not present, request it by reporting this error.' % options.index )
seq_path = options.index
# Build command.
+11 -6
View File
@@ -1,4 +1,4 @@
<tool id="cuffdiff" name="Cuffdiff" version="0.0.5">
<tool id="cuffdiff" name="Cuffdiff" version="0.0.6">
<!-- Wrapper supports Cuffdiff versions 2.1.0-2.1.1 -->
<description>find significant changes in transcript expression, splicing, and promoter use</description>
<requirements>
@@ -42,14 +42,12 @@
## Bias correction?
#if $bias_correction.do_bias_correction == "Yes":
-b
-b
#if $bias_correction.seq_source.index_source == "history":
--ref_file=$bias_correction.seq_source.ref_file
#else:
--ref_file="None"
--index=${bias_correction.seq_source.index.fields.path}
#end if
--dbkey=${gtf_input.metadata.dbkey}
--index_dir=${GALAXY_DATA_INDEX_DIR}
#end if
## Inputs.
@@ -131,7 +129,14 @@
<option value="cached">Locally cached</option>
<option value="history">History</option>
</param>
<when value="cached"></when>
<when value="cached">
<param name="index" type="select" label="Using reference genome">
<options from_data_table="sam_fa_indexes">
<filter type="data_meta" ref="gtf_input" key="dbkey" column="1" />
<validator type="no_options" message="No reference genome is available for the build associated with the selected input dataset" />
</options>
</param>
</when>
<when value="history">
<param name="ref_file" type="data" format="fasta" label="Using reference file" />
</when>
+5 -25
View File
@@ -10,20 +10,6 @@ def stop_err( msg ):
sys.stderr.write( "%s\n" % msg )
sys.exit()
# Copied from sam_to_bam.py:
def check_seq_file( dbkey, cached_seqs_pointer_file ):
seq_path = ''
for line in open( cached_seqs_pointer_file ):
line = line.rstrip( '\r\n' )
if line and not line.startswith( '#' ) and line.startswith( 'index' ):
fields = line.split( '\t' )
if len( fields ) < 3:
continue
if fields[1] == dbkey:
seq_path = fields[2].strip()
break
return seq_path
def __main__():
#Parse Command Line
parser = optparse.OptionParser()
@@ -52,8 +38,7 @@ def __main__():
# Bias correction options.
parser.add_option( '-b', dest='do_bias_correction', action="store_true", help='Providing Cufflinks with a multifasta file via this option instructs it to run our new bias detection and correction algorithm which can significantly improve accuracy of transcript abundance estimates.')
parser.add_option( '', '--dbkey', dest='dbkey', help='The build of the reference dataset' )
parser.add_option( '', '--index_dir', dest='index_dir', help='GALAXY_DATA_INDEX_DIR' )
parser.add_option( '', '--index', dest='index', help='The path of the reference genome' )
parser.add_option( '', '--ref_file', dest='ref_file', help='The reference dataset from the history' )
# Global model.
@@ -82,21 +67,16 @@ def __main__():
# If doing bias correction, set/link to sequence file.
if options.do_bias_correction:
if options.ref_file != 'None':
if options.ref_file:
# Sequence data from history.
# Create symbolic link to ref_file so that index will be created in working directory.
seq_path = "ref.fa"
os.symlink( options.ref_file, seq_path )
else:
# Sequence data from loc file.
cached_seqs_pointer_file = os.path.join( options.index_dir, 'sam_fa_indices.loc' )
if not os.path.exists( cached_seqs_pointer_file ):
stop_err( 'The required file (%s) does not exist.' % cached_seqs_pointer_file )
# If found for the dbkey, seq_path will look something like /galaxy/data/equCab2/sam_index/equCab2.fa,
# and the equCab2.fa file will contain fasta sequences.
seq_path = check_seq_file( options.dbkey, cached_seqs_pointer_file )
if seq_path == '':
stop_err( 'No sequence data found for dbkey %s, so bias correction cannot be used.' % options.dbkey )
if not os.path.exists( options.index ):
stop_err( 'Reference genome %s not present, request it by reporting this error.' % options.index )
seq_path = options.index
# Build command.
+15 -10
View File
@@ -1,4 +1,4 @@
<tool id="cufflinks" name="Cufflinks" version="0.0.5">
<tool id="cufflinks" name="Cufflinks" version="0.0.6">
<!-- Wrapper supports Cufflinks versions v1.3.0 and newer -->
<description>transcript assembly and FPKM (RPKM) estimates for RNA-Seq data</description>
<requirements>
@@ -28,14 +28,12 @@
## Bias correction?
#if $bias_correction.do_bias_correction == "Yes":
-b
-b
#if $bias_correction.seq_source.index_source == "history":
--ref_file=$bias_correction.seq_source.ref_file
#else:
--ref_file="None"
--index=${bias_correction.seq_source.index.fields.path}
#end if
--dbkey=${input.metadata.dbkey}
--index_dir=${GALAXY_DATA_INDEX_DIR}
#end if
## Multi-read correct?
@@ -66,15 +64,15 @@
<when value="No"></when>
<when value="Use reference annotation">
<param format="gff3,gtf" name="reference_annotation_file" type="data" label="Reference Annotation" help="Gene annotation dataset in GTF or GFF3 format."/>
</when>
<when value="Use reference annotation guide">
</when>
<when value="Use reference annotation guide">
<param format="gff3,gtf" name="reference_annotation_guide_file" type="data" label="Reference Annotation" help="Gene annotation dataset in GTF or GFF3 format."/>
</when>
</when>
</conditional>
<conditional name="bias_correction">
<param name="do_bias_correction" type="select" label="Perform Bias Correction" help="Bias detection and correction can significantly improve accuracy of transcript abundance estimates.">
<option value="No" selected="true">No</option>
<option value="Yes">Yes</option>
<option value="Yes">Yes</option>
</param>
<when value="Yes">
<conditional name="seq_source">
@@ -82,7 +80,14 @@
<option value="cached" selected="true">Locally cached</option>
<option value="history">History</option>
</param>
<when value="cached"></when>
<when value="cached">
<param name="index" type="select" label="Using reference genome">
<options from_data_table="sam_fa_indexes">
<filter type="data_meta" ref="input" key="dbkey" column="1" />
<validator type="no_options" message="No reference genome is available for the build associated with the selected input dataset" />
</options>
</param>
</when>
<when value="history">
<param name="ref_file" type="data" format="fasta" label="Using reference file" />
</when>
+5 -25
View File
@@ -8,20 +8,6 @@ def stop_err( msg ):
sys.stderr.write( '%s\n' % msg )
sys.exit()
# Copied from sam_to_bam.py:
def check_seq_file( dbkey, cached_seqs_pointer_file ):
seq_path = ''
for line in open( cached_seqs_pointer_file ):
line = line.rstrip( '\r\n' )
if line and not line.startswith( '#' ) and line.startswith( 'index' ):
fields = line.split( '\t' )
if len( fields ) < 3:
continue
if fields[1] == dbkey:
seq_path = fields[2].strip()
break
return seq_path
def __main__():
#Parse Command Line
parser = optparse.OptionParser()
@@ -31,8 +17,7 @@ def __main__():
# Wrapper / Galaxy options.
parser.add_option( '', '--dbkey', dest='dbkey', help='The build of the reference dataset' )
parser.add_option( '', '--index_dir', dest='index_dir', help='GALAXY_DATA_INDEX_DIR' )
parser.add_option( '', '--index', dest='index', help='The path of the reference genome' )
parser.add_option( '', '--ref_file', dest='ref_file', help='The reference dataset from the history' )
# Outputs.
@@ -61,21 +46,16 @@ def __main__():
# Set/link to sequence file.
if options.use_seq_data:
if options.ref_file != 'None':
if options.ref_file:
# Sequence data from history.
# Create symbolic link to ref_file so that index will be created in working directory.
seq_path = "ref.fa"
os.symlink( options.ref_file, seq_path )
else:
# Sequence data from loc file.
cached_seqs_pointer_file = os.path.join( options.index_dir, 'sam_fa_indices.loc' )
if not os.path.exists( cached_seqs_pointer_file ):
stop_err( 'The required file (%s) does not exist.' % cached_seqs_pointer_file )
# If found for the dbkey, seq_path will look something like /galaxy/data/equCab2/sam_index/equCab2.fa,
# and the equCab2.fa file will contain fasta sequences.
seq_path = check_seq_file( options.dbkey, cached_seqs_pointer_file )
if seq_path == '':
stop_err( 'No sequence data found for dbkey %s, so sequence data cannot be used.' % options.dbkey )
if not os.path.exists( options.index ):
stop_err( 'Reference genome %s not present, request it by reporting this error.' % options.index )
seq_path = options.index
# Build command.
+11 -6
View File
@@ -1,4 +1,4 @@
<tool id="cuffmerge" name="Cuffmerge" version="0.0.5">
<tool id="cuffmerge" name="Cuffmerge" version="0.0.6">
<!-- Wrapper supports Cuffmerge versions 1.3 and newer -->
<description>merge together several Cufflinks assemblies</description>
<requirements>
@@ -16,14 +16,12 @@
## Use sequence data?
#if $seq_data.use_seq_data == "Yes":
-s
-s
#if $seq_data.seq_source.index_source == "history":
--ref_file=$seq_data.seq_source.ref_file
#else:
--ref_file="None"
--index=${seq_data.seq_source.index.fields.path}
#end if
--dbkey=${first_input.metadata.dbkey}
--index_dir=${GALAXY_DATA_INDEX_DIR}
#end if
## Outputs.
@@ -64,7 +62,14 @@
<option value="cached">Locally cached</option>
<option value="history">History</option>
</param>
<when value="cached"></when>
<when value="cached">
<param name="index" type="select" label="Using reference genome">
<options from_data_table="sam_fa_indexes">
<filter type="data_meta" ref="first_input" key="dbkey" column="1" />
<validator type="no_options" message="No reference genome is available for the build associated with the selected input dataset" />
</options>
</param>
</when>
<when value="history">
<param name="ref_file" type="data" format="fasta" label="Using reference file" />
</when>