1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/0509a6aa2a78/ changeset: 0509a6aa2a78 user: dan date: 2011-10-24 22:11:20 summary: Add Picard tools FASTQ to SAM (makes BAM) tool. Add Picard tools SAM to FASTQ tool. affected #: 5 files diff -r 32af86dbaf9a962eaea12a04df817c6f282331df -r 0509a6aa2a7876648811b5b445ab7fcbbe982d32 test-data/picard_fastq_to_sam_out1.bam Binary file test-data/picard_fastq_to_sam_out1.bam has changed diff -r 32af86dbaf9a962eaea12a04df817c6f282331df -r 0509a6aa2a7876648811b5b445ab7fcbbe982d32 test-data/picard_fastq_to_sam_out2.bam Binary file test-data/picard_fastq_to_sam_out2.bam has changed diff -r 32af86dbaf9a962eaea12a04df817c6f282331df -r 0509a6aa2a7876648811b5b445ab7fcbbe982d32 tool_conf.xml.sample --- a/tool_conf.xml.sample +++ b/tool_conf.xml.sample @@ -295,6 +295,9 @@ <tool file="fastx_toolkit/fastx_trimmer.xml" /></section><section name="NGS: Picard (beta)" id="picard_beta"> + <label text="Conversion" id="picard_conversion"/> + <tool file="picard/picard_FastqToSam.xml" /> + <tool file="picard/picard_SamToFastq.xml" /><label text="QC/Metrics for sam/bam" id="qcsambam"/><tool file="picard/picard_BamIndexStats.xml" /> @@ -390,7 +393,6 @@ <label text="Filtration" id="gatk_filtration" /><tool file="gatk/variant_filtration.xml" /> - <tool file="gatk/variant_filtration.xml" /><label text="Variant Quality Score Recalibration" id="gatk_variant_quality_score_recalibration" /><tool file="gatk/variant_recalibrator.xml" /> diff -r 32af86dbaf9a962eaea12a04df817c6f282331df -r 0509a6aa2a7876648811b5b445ab7fcbbe982d32 tools/picard/picard_FastqToSam.xml --- /dev/null +++ b/tools/picard/picard_FastqToSam.xml @@ -0,0 +1,143 @@ +<tool id="picard_FastqToSam" name="FASTQ to BAM" version="0.0.1"> + <description>creates an unaligned BAM file</description> + <command>java -XX:DefaultMaxRAMFraction=1 -XX:+UseParallelGC + -jar "${GALAXY_DATA_INDEX_DIR}/shared/jars/picard/FastqToSam.jar" + FASTQ="${input_fastq1}" + #if str( $input_fastq2) != "None": + FASTQ2="${input_fastq2}" + #end if + QUALITY_FORMAT="${ dict( fastqsanger='Standard', fastqcssanger='Standard', fastqillumina='Illumina', fastqsolexa='Solexa' )[ $input_fastq1.ext ] }" ##Solexa, Illumina, Standard + OUTPUT="${output_bam}" + READ_GROUP_NAME="${read_group_name}" + SAMPLE_NAME="${sample_name}" + #if $param_type.param_type_selector == "advanced": + #if str( $param_type.library_name ) != "": + LIBRARY_NAME="${param_type.library_name}" + #end if + #if str( $param_type.platform_unit ) != "": + PLATFORM_UNIT="${param_type.platform_unit}" + #end if + #if str( $param_type.platform ) != "": + PLATFORM="${param_type.platform}" + #end if + #if str( $param_type.sequencing_center ) != "": + SEQUENCING_CENTER="${param_type.sequencing_center}" + #end if + #if str( $param_type.predicted_insert_size ) != "": + PREDICTED_INSERT_SIZE="${param_type.predicted_insert_size}" + #end if + #if str( $param_type.description.value ) != "": + DESCRIPTION="${param_type.description}" + #end if + #if str( $param_type.run_date ) != "": + RUN_DATE="${param_type.run_date}" + #end if + #if str( $param_type.min_q ) != "": + MIN_Q="${param_type.min_q}" + #end if + #if str( $param_type.min_q ) != "": + MAX_Q="${param_type.max_q}" + #end if + SORT_ORDER="${param_type.sort_order}" + #else: + SORT_ORDER=coordinate ##unsorted, queryname, coordinate; always use coordinate + #end if + 2>&1 + || echo "Error running Picard FastqToSAM" >&2 + </command> + <inputs> + <param name="input_fastq1" type="data" format="fastqsanger,fastqillumina,fastqsolexa,fastqcssanger" label="FASTQ file" /><!-- confirm that fastqcssanger also works --> + <param name="input_fastq2" type="data" format="fastqsanger,fastqillumina,fastqsolexa,fastqcssanger" optional="True" label="Second FASTQ of paired end data" help="Only needed when using paired end data." > + <options options_filter_attribute="ext" from_parameter="tool.app.datatypes_registry.datatypes_by_extension" transform_lines="obj.keys()"> + <column name="name" index="0"/> + <column name="value" index="0"/> + <filter type="param_value" ref="input_fastq1" ref_attribute="ext" column="0"/> + </options> + </param> + <param name="read_group_name" type="text" value="A" label="Read Group Name" /> + <param name="sample_name" type="text" value="unknown sample" label="Sample Name" /> + <conditional name="param_type"> + <param name="param_type_selector" type="select" label="Basic or Advanced options"> + <option value="basic" selected="True">Basic</option> + <option value="advanced">Advanced</option> + </param> + <when value="basic"> + <!-- Do nothing here --> + </when> + <when value="advanced"> + <param name="library_name" type="text" value="" label="Library Name" /> + <param name="platform_unit" type="text" value="" label="Platform Unit" /> + <param name="platform" type="text" value="" label="Platform" /> + <param name="sequencing_center" type="text" value="" label="Sequencing Center" /> + <param name="predicted_insert_size" type="integer" value="" optional="True" label="Predicted Insert Size" /> + <param name="description" type="text" value="" label="Description" /> + <param name="run_date" type="text" value="" label="Run Date" /> + <param name="min_q" type="integer" optional="True" value="0" label="Min Q" /> + <param name="max_q" type="integer" optional="True" value="93" label="Max Q" /> + <param name="sort_order" type="select" label="Sort order"> + <option value="coordinate" selected="True">coordinate</option> + <option value="queryname">queryname</option> + <option value="unsorted">unsorted</option> + </param> + </when> + </conditional> + </inputs> + <outputs> + <data format="bam" name="output_bam" /> + </outputs> + <tests> + <test> + <param name="input_fastq1" value="bwa_wrapper_in2.fastqsanger" ftype="fastqsanger" /> + <param name="input_fastq2" /> + <param name="read_group_name" value="A" /> + <param name="sample_name" value="unknown sample" /> + <param name="param_type_selector" value="basic" /> + <output name="output_bam" file="picard_fastq_to_sam_out1.bam" ftype="bam"/> + </test> + <test> + <param name="input_fastq1" value="bwa_wrapper_in2.fastqsanger" ftype="fastqsanger" /> + <param name="input_fastq2" value="bwa_wrapper_in3.fastqsanger" ftype="fastqsanger" /> + <param name="read_group_name" value="A" /> + <param name="sample_name" value="unknown sample" /> + <param name="param_type_selector" value="basic" /> + <output name="output_bam" file="picard_fastq_to_sam_out2.bam" ftype="bam"/> + </test> + </tests> + <help> +**What it does** + +Picard: FastqToSam converts FASTQ files to unaligned BAM files. + +------ + +Please cite the website "http://picard.sourceforge.net". + +------ + + +**Input formats** + +FastqToSam accepts FASTQ input files. If using paired-end data, you should select two FASTQ files. + +------ + +**Outputs** + +The output is in BAM format, see http://samtools.sourceforge.net for more details. + +------- + +**FastqToSam settings** + +This is list of FastqToSam options:: + + READ_GROUP_NAME=String Read group name Default value: A. This option can be set to 'null' to clear the default value. + SAMPLE_NAME=String Sample name to insert into the read group header Required. + LIBRARY_NAME=String The library name to place into the LB attribute in the read group header Default value: null. + PLATFORM_UNIT=String The platform unit (often run_barcode.lane) to insert into the read group header Default value: null. + PLATFORM=String The platform type (e.g. illumina, solid) to insert into the read group header Default value: null. + SEQUENCING_CENTER=String The sequencing center from which the data originated Default value: null. + PREDICTED_INSERT_SIZE=Integer Predicted median insert size, to insert into the read group header Default value: null. + DESCRIPTION=String Inserted into the read group header Default value: null. + </help> +</tool> diff -r 32af86dbaf9a962eaea12a04df817c6f282331df -r 0509a6aa2a7876648811b5b445ab7fcbbe982d32 tools/picard/picard_SamToFastq.xml --- /dev/null +++ b/tools/picard/picard_SamToFastq.xml @@ -0,0 +1,160 @@ +<tool id="picard_SamToFastq" name="SAM to FASTQ" version="0.0.1"> + <description>creates a FASTQ file</description> + <command>java -XX:DefaultMaxRAMFraction=1 -XX:+UseParallelGC + -jar "${GALAXY_DATA_INDEX_DIR}/shared/jars/picard/SamToFastq.jar" + INPUT="${input_sam}" + RE_REVERSE=${re_reverse} + INCLUDE_NON_PF_READS=${include_non_pf_reads} + #if str( $clipping_attribute ): + CLIPPING_ATTRIBUTE="${clipping_attribute}" + #end if + #if str( $clipping_action ): + CLIPPING_ACTION="${clipping_action}" + #end if + #if str( $read1_trim ): + READ1_TRIM="${read1_trim}" + #end if + #if str( $read1_max_bases_to_write ): + READ1_MAX_BASES_TO_WRITE="${read1_max_bases_to_write}" + #end if + INCLUDE_NON_PRIMARY_ALIGNMENTS=${include_non_primary_alignments} + + #if str( $output_per_read_group.output_per_read_group_selector ) == 'per_sam_file': + ##OUTPUT_PER_RG=false + FASTQ="${output_fastq1}" + + #if str( $output_per_read_group.single_paired_end_type.single_paired_end_type_selector ) == 'paired': + SECOND_END_FASTQ="${output_fastq2}" + #if str( $output_per_read_group.single_paired_end_type.read2_trim ): + READ2_TRIM="${output_per_read_group.single_paired_end_type.read2_trim}" + #end if + #if str( $output_per_read_group.single_paired_end_type.read2_max_bases_to_write ): + READ2_MAX_BASES_TO_WRITE="${output_per_read_group.single_paired_end_type.read2_max_bases_to_write}" + #end if + #end if + #else: + #raise Exception( 'Per Read Group not yet supported.' ) + OUTPUT_PER_RG=true + OUTPUT_DIR="./picard_sam_to_fastq_tmp_dir/" + #end if + 2>&1 + || echo "Error running SamToFastq" >&2 + ##&& echo "die die die" >&2 + </command> + <inputs> + <param name="input_sam" type="data" format="sam" label="SAM file" /> + <param name="read1_trim" type="integer" value="" optional="True" label="The number of bases to trim from the beginning of read 1." /> + <param name="read1_max_bases_to_write" type="integer" optional="True" value="" label="The maximum number of bases to write from read 1 after trimming." /> + <conditional name="output_per_read_group"> + <param name="output_per_read_group_selector" type="select" label="Output per read group"> + <option value="per_sam_file" selected="True">Per SAM file</option> + <option value="per_read_group">Per Read Group</option> + <validator type="expression" message="Per Read Group selection is not yet implemented">value == 'per_sam_file'</validator> + </param> + <when value="per_sam_file"> + <conditional name="single_paired_end_type"> + <param name="single_paired_end_type_selector" type="select" label="Single or Paired end"> + <option value="single" selected="True">Single</option> + <option value="paired">Paired end</option> + </param> + <when value="single"> + <!-- nothing yet --> + </when> + <when value="paired"> + <param name="read2_trim" type="integer" value="" optional="True" label="The number of bases to trim from the beginning of read 2." /> + <param name="read2_max_bases_to_write" type="integer" optional="True" value="" label="The maximum number of bases to write from read 2 after trimming." /> + </when> + </conditional> + </when> + <when value="per_read_group"> + <!-- Fix me --> + </when> + </conditional> + <param name="re_reverse" type="boolean" truevalue="true" falsevalue="false" checked="True" label="Re-reverse bases and qualities of reads on negative strand"/> + <param name="include_non_pf_reads" type="boolean" truevalue="true" falsevalue="false" checked="False" label="Include non-PF reads from the SAM file into the output FASTQ files."/> + <param name="clipping_attribute" type="text" value="" label="The attribute that stores the position at which the SAM record should be clipped" help="Leave blank for null" /> + <param name="clipping_action" type="text" value="" label="The action that should be taken with clipped reads" help="'X' means the reads and qualities should be trimmed at the clipped position; 'N' means the bases should be changed to Ns in the clipped region; and any integer means that the base qualities should be set to that value in the clipped region. Leave blank for null" /> + <param name="include_non_primary_alignments" type="boolean" truevalue="true" falsevalue="false" checked="False" label="If true, include non-primary alignments in the output." help="Support of non-primary alignments in SamToFastq is not comprehensive, so there may be exceptions if this is set to true and there are paired reads with non-primary alignments."/> + + </inputs> + <outputs> + <data format="fastqsanger" name="output_fastq1" label="${tool.name} on ${on_string}: FASTQ 1" /> + <data format="fastqsanger" name="output_fastq2" label="${tool.name} on ${on_string}: FASTQ 2" > + <filter>output_per_read_group['single_paired_end_type']['single_paired_end_type_selector'] == 'paired'</filter> + </data> + </outputs> + <tests> + <test> + <param name="input_sam" value="bfast_out1.sam" ftype="sam" /> + <param name="output_per_read_group_selector" value="per_sam_file" /> + <param name="single_paired_end_type_selector" value="single" /> + <param name="read1_trim" value="" /> + <param name="read1_max_bases_to_write" value="" /> + <param name="re_reverse" value="True" /> + <param name="include_non_pf_reads" value="False" /> + <param name="clipping_attribute" value="" /> + <param name="include_non_primary_alignments" value="False" /> + <output name="output_fastq1" file="random_phiX_1.fastqsanger"/> + </test> + <test> + <param name="input_sam" value="bwa_wrapper_out3.sam" ftype="sam" /> + <param name="output_per_read_group_selector" value="per_sam_file" /> + <param name="single_paired_end_type_selector" value="paired" /> + <param name="read1_trim" value="" /> + <param name="read1_max_bases_to_write" value="" /> + <param name="read2_trim" value="" /> + <param name="read2_max_bases_to_write" value="" /> + <param name="re_reverse" value="True" /> + <param name="include_non_pf_reads" value="False" /> + <param name="clipping_attribute" value="" /> + <param name="include_non_primary_alignments" value="False" /> + <output name="output_fastq1" file="bwa_wrapper_in2.fastqsanger" lines_diff="64"/><!-- 16 unaligned fastq blocks not present in original sam file --> + <output name="output_fastq2" file="bwa_wrapper_in3.fastqsanger" lines_diff="64"/><!-- 16 unaligned fastq blocks not present in original sam file --> + </test> + </tests> + <help> +**What it does** + +Picard: SamToFastq converts SAM files to FASTQ files. + +Extracts read sequences and qualities from the input SAM/BAM file and writes them into the output file in Sanger fastq format. In the RC mode (default is True), if the read is aligned and the alignment is to the reverse strand on the genome, the read's sequence from input SAM file will be reverse-complemented prior to writing it to fastq in order restore correctly the original read sequence as it was generated by the sequencer. + +------ + +Please cite the website "http://picard.sourceforge.net". + +------ + + +**Input formats** + +FastqToSam accepts SAM input files, see http://samtools.sourceforge.net for more details. + +------ + +**Outputs** + +The output is in FASTQ format. If using Paired end data, 2 fastq files are created. + +------- + +**FastqToSam settings** + +This is list of SamToFastq options:: + +NPUT=File Input SAM/BAM file to extract reads from Required. +FASTQ=File Output fastq file (single-end fastq or, if paired, first end of the pair fastq). Required. Cannot be used in conjuction with option(s) OUTPUT_PER_RG (OPRG) +SECOND_END_FASTQ=File Output fastq file (if paired, second end of the pair fastq). Default value: null. Cannot be used in conjuction with option(s) OUTPUT_PER_RG (OPRG) +OUTPUT_PER_RG=Boolean Output a fastq file per read group (two fastq files per read group if the group is paired). Default value: false. This option can be set to 'null' to clear the default value. Possible values: {true, false} Cannot be used in conjuction with option(s) SECOND_END_FASTQ (F2) FASTQ (F) +OUTPUT_DIR=File Directory in which to output the fastq file(s). Used only when OUTPUT_PER_RG is true. Default value: null. +RE_REVERSE=Boolean Re-reverse bases and qualities of reads with negative strand flag set before writing them to fastq Default value: true. This option can be set to 'null' to clear the default value. Possible values: {true, false} +INCLUDE_NON_PF_READS=Boolean Include non-PF reads from the SAM file into the output FASTQ files. Default value: false. This option can be set to 'null' to clear the default value. Possible values: {true, false} +CLIPPING_ATTRIBUTE=String The attribute that stores the position at which the SAM record should be clipped Default value: null. +CLIPPING_ACTION=String The action that should be taken with clipped reads: 'X' means the reads and qualities should be trimmed at the clipped position; 'N' means the bases should be changed to Ns in the clipped region; and any integer means that the base qualities should be set to that value in the clipped region. Default value: null. +READ1_TRIM=Integer The number of bases to trim from the beginning of read 1. Default value: 0. This option can be set to 'null' to clear the default value. +READ1_MAX_BASES_TO_WRITE=Integer The maximum number of bases to write from read 1 after trimming. If there are fewer than this many bases left after trimming, all will be written. If this value is null then all bases left after trimming will be written. Default value: null. +READ2_TRIM=Integer The number of bases to trim from the beginning of read 2. Default value: 0. This option can be set to 'null' to clear the default value. +READ2_MAX_BASES_TO_WRITE=Integer The maximum number of bases to write from read 2 after trimming. If there are fewer than this many bases left after trimming, all will be written. If this value is null then all bases left after trimming will be written. Default value: null. +INCLUDE_NON_PRIMARY_ALIGNMENTS=Boolean If true, include non-primary alignments in the output. Support of non-primary alignments in SamToFastq is not comprehensive, so there may be exceptions if this is set to true and there are paired reads with non-primary alignments. Default value: false. This option can be set to 'null' to clear the default value. Possible values: {true, false} + </help> +</tool> Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.