<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pise PUBLIC "pise2.dtd" "pise2.dtd" >
<pise>
    <head>
      <title>Process Radtags on XSEDE</title>
      <version>1.44</version>
      <description>Checks that the barcode and the RAD cut site are intact, and then demultiplexes the data. Make sure barcode files have LINUX line endings - upload barcode files.</description>
      <authors>Catchen, J., Hohenlohe, P. A., Bassham, S., Amores, A., and Cresko, W. A.</authors>
      <reference>Catchen, J., Hohenlohe, P. A., Bassham, S., Amores, A., and Cresko, W. A. (2013) Stacks: an analysis tool set for population genomics. Molecular ecology 22, 3124-3140</reference>
      <category>Phylogeny/Alignment</category>
      <doclink>http://catchenlab.life.illinois.edu/stacks/manual/</doclink>
      <doclink></doclink>
  </head>

	<command>stacks_xsede</command>
	
<!-- **********************************  created 2/13/2017 or thereabouts by mamiller ****************************************************************
 From ignazio
 
process_radtags -r -P -o flavus -1 PCR2_Idx_3_S3_R1.fastq.gz -2 PCR2_Idx_3_S3_R2.fastq.gz -b barcodefile.data -*inline_null -i gzfastq -E phred33 -*renz_1 mspI -*renz_2 mluCI -q no 

 -->

<parameters> 

<!-- hidden parameters -->      
    
    <parameter issimple="1" isinput="1" type="Sequence">
          <name>inputfile1_fastq</name>
          <attributes>
          <prompt>First fastq file</prompt>
			<filenames>inputfastq1.zip</filenames>
			<format>
				<language>perl</language>
				<code>"-1 inputfastq1.zip"</code>
			</format>
			<group>4</group>
        </attributes>
        </parameter>  
        
        <parameter ishidden="1" type="String">
			<name>stacks_scheduler</name>
				<attributes>
					<paramfile>scheduler.conf</paramfile>
					<format>
						<language>perl</language>
							<code>
									"threads_per_process=1\\n" .
									"node_exclusive=0\\n" .
									"nodes=1\\n"
								</code>
					</format>
					<group>0</group>
				</attributes>
		</parameter>  
        
    <parameter ishidden="1" ismandatory="1" type="String">
      <name>invocation</name>
      <attributes>
      <format>
      		<language>perl</language>
        	<code>"/projects/ps-ngbt/opt/comet/stacks/1.44/process_radtags -r "</code>
      	</format>
      	<group>1</group>
      </attributes>
    </parameter>
          
<!-- end of hidden parameters -->
	
<!-- Visible parameters -->
<!-- Parameters with visible controls start here -->
		<parameter type="Float" issimple="1" ismandatory="1">
			<name>runtime</name>
			<attributes>
				<group>1</group>
				<paramfile>scheduler.conf</paramfile>
				<prompt>Maximum Hours to Run (click here for help setting this correctly)</prompt>
				<vdef>
					<value>0.25</value>
				</vdef>
				<comment>
<value>Estimate the maximum time your job will need to run. We recommend testing initially with a &lt; 0.5hr test run because Jobs set for 0.5 h or less depedendably run immediately in the "debug" queue. 
Once you are sure the configuration is correct, you then increase the time. The reason is that jobs &gt; 0.5 h are submitted to the "normal" queue, where jobs configured for 1 or a few hours times may
run sooner than jobs configured for the full 168 hours. 
</value>
				</comment>
				<ctrls>
					<ctrl>
						<message>Maximum Hours to Run must be less than 168</message>
						<language>perl</language>
						<code>$runtime &gt; 168.0</code>
					</ctrl>
					<ctrl>
						<message>Maximum Hours to Run must be greater than 0.1 </message>
						<language>perl</language>
						<code>$runtime &lt; 0.1</code>
					</ctrl>
				</ctrls>
				<warns>
					<warn>
						<message>The job will run on 1 processor as configured. If it runs for the entire configured time, it will consume 1 x $runtime cpu hours</message>
						<language>perl</language>
						<code>$runtime ne 0 </code>
					</warn>
				</warns>
				<format>
					<language>perl</language>
					<code>"runhours=$value\\n"</code>
				</format>
			</attributes>
		</parameter>
     	
<!-- Begin input section -->    
    
    <parameter type="Switch">
       <name>paired_end</name>
       <attributes>
       		<prompt>Files are paired( -P ).</prompt>
        	<format>
				<language>perl</language>
				<code>($value) ? "-P": ""</code>
			</format>
          	<vdef>
            	<value>0</value>
          	</vdef>
          	<group>3</group>
		</attributes>
    </parameter>
    
    <parameter issimple="1" ismandatory="1"  type="InFile">
          <name>inputfastq2</name>
          <attributes>
          <prompt>Input fastq file2</prompt>
			<filenames>inputfastq2.zip</filenames>
			<precond>
				<language>perl</language>
				<code>$paired_end</code>
			</precond>
			<format>
				<language>perl</language>
				<code>"-2 inputfastq2.zip"</code>
			</format>
			<ctrls>
          		<ctrl>
          			<message>Please select the second fastq file</message>
          			<language>perl</language>
          			<code>$paired_end &amp;&amp; !defined $inputfastq2</code>
          		</ctrl>
          	</ctrls>
          	<group>5</group>
        </attributes>
        </parameter>  
        
<parameter type="Paragraph">
      <paragraph>
      <name>general</name>
      <prompt>Program Settings</prompt>
      <parameters>
<!-- barcode file -->
        <parameter issimple="1" ismandatory="1" type="InFile">
        	<name>barcode_file</name>
				<attributes>
					<prompt>Input barcode file</prompt>
					<filenames>barcode.data</filenames>
					<format>
						<language>perl</language>
						<code>"-b barcode.data"</code>
					</format>
			<ctrls>
          		<ctrl>
          			<message>Please select the barcode file</message>
          			<language>perl</language>
          			<code>!defined $barcode_file</code>
          		</ctrl>
          	</ctrls>
          	<group>7</group>
        </attributes>
        </parameter>  

        <parameter type="Excl">
          <name>barcode_options</name>
          <attributes>
          <prompt>Barcode options:</prompt>
          <vlist>
              <value></value>
              <label>none</label>
              <value>--inline_null</value>
              <label>inline_null</label>
              <value>--index_null</value>
              <label>index_null</label>
              <value>--inline_inline</value>
              <label>inline_inline</label>
              <value>--index_index</value>
              <label>index_index</label>
              <value>--inline_index</value>
              <label>inline_index</label>
              <value>--index_inline</value>
              <label>index_inline</label>
          </vlist>
          <vdef>
            <value>--inline_null</value>
          </vdef>
          <format>
          	<language>perl</language>
            <code>$value</code>
          </format>
          <group>8</group>
          </attributes>
        </parameter>
        
        <parameter ismandatory="1" type="Excl">
          <name>inputfiletype</name>
          <attributes>
          <prompt>Specify the input file type (-i)</prompt>
<!--  — input file type, either 'bustard' for the Illumina BUSTARD format, 'bam', 'fastq' (default), or 'gzfastq' for gzipped FASTQ. -->
          <vlist>
              <value>bustard</value>
              <label>Illumina BUSTARD</label>
              <value>bam</value>
              <label>BAM</label>
              <value>fastq</value>
              <label>Fastq</label>
              <value>gzfastq</value>
              <label>gzipped Fastq</label>
          </vlist>
          <vdef>
            <value>gzfastq</value>
          </vdef>
          <format>
          	<language>perl</language>
            <code>"-i $value"</code>
          </format>
          <group>9</group>
          </attributes>
        </parameter>
        
        <parameter type="Excl">
          <name>scoring</name>
          <attributes>
          <prompt>Specify how quality scores are encoded. (-E)</prompt>
          <vlist>
              <value>phred33</value>
              <label>phred33</label>
              <value>phred64</value>
              <label>phred64</label>
          </vlist>
          <vdef>
            <value>phred33</value>
          </vdef>
          <format>
          	<language>perl</language>
            <code>" -E $value"</code>
          </format>
          <group>10</group>
          </attributes>
        </parameter>
        
        <parameter ismandatory="1" type="Excl">
          <name>restr_enzyme1</name>
          <attributes>
          <prompt>Provide the restriction enzyme used (cut site occurs on single-end read).(--renz1)</prompt>
          <vlist>
              <value>apeKI</value>
              <label>apeKI</label>
              <value>bamHI</value>
              <label>bamHI</label>
              <value>dpnII</value>
              <label>dpnII</label>
              <value>ecoRI</value>
              <label>ecoRI</label>
              <value>ecoT22I</value>
              <label>ecoT22I</label>
              <value>hindIII</value>
              <label>hindIII</label>
              <value>mluCI</value>
              <label>mluCI</label>
              <value>mseI</value>
              <label>mseI</label>
              <value>mspI</value>
              <label>mspI</label>
              <value>ndeI</value>
              <label>ndeI</label>
              <value>nlaIII</value>
              <label>nlaIII</label>
              <value>notI</value>
              <label>notI</label>
              <value>nsiI</value>
              <label>nsiI</label>
              <value>pstI</value>
              <label>pstI</label>
              <value>sau3AI</value>
              <label>sau3AI</label>
              <value>sbfI</value>
              <label>sbfI</label>
              <value>sexAI</value>
              <label>sexAI</label>
              <value>sgrAI</value>
              <label>sgrAI</label>
              <value>sphI</value>
              <label>sphI</label>
              <value>xbaI</value>
              <label>xbaI</label>
          </vlist>
          <vdef>
            <value>mspI</value>
          </vdef>
          <format>
            <language>perl</language>
            <code>" --renz_1 $value"</code>
          </format>
          <group>11</group>
          </attributes>
        </parameter>
        
 <!-- input second restriction enzyme -->
        <parameter type="Excl">
          <name>restr_enzyme2</name>
          <attributes>
          <prompt>If a double digest was used, provide the second restriction enzyme used (cut site occurs on the paired-end read).(--renz2)</prompt>
          <vlist>
              <value>notset</value>
              <label>not set</label>
              <value>apeKI</value>
              <label>apeKI</label>
              <value>bamHI</value>
              <label>bamHI</label>
              <value>dpnII</value>
              <label>dpnII</label>
              <value>ecoRI</value>
              <label>ecoRI</label>
              <value>ecoT22I</value>
              <label>ecoT22I</label>
              <value>hindIII</value>
              <label>hindIII</label>
              <value>mluCI</value>
              <label>mluCI</label>
              <value>mseI</value>
              <label>mseI</label>
              <value>mspI</value>
              <label>mspI</label>
              <value>ndeI</value>
              <label>ndeI</label>
              <value>nlaIII</value>
              <label>nlaIII</label>
              <value>notI</value>
              <label>notI</label>
              <value>nsiI</value>
              <label>nsiI</label>
              <value>pstI</value>
              <label>pstI</label>
              <value>sau3AI</value>
              <label>sau3AI</label>
              <value>sbfI</value>
              <label>sbfI</label>
              <value>sexAI</value>
              <label>sexAI</label>
              <value>sgrAI</value>
              <label>sgrAI</label>
              <value>sphI</value>
              <label>sphI</label>
              <value>xbaI</value>
              <label>xbaI</label>
          </vlist>
          <format>
          	<language>perl</language>
            <code>defined $value ? "--renz_2 $value":""</code>
          </format>
          <group>12</group>
          </attributes>
        </parameter>
        
        <parameter type="String">
          <name>adaptersequence1</name>
          <attributes>
          <prompt>Adaptor sequence that may occur on the single-end read for filtering.(--adapter_1)</prompt>
          <format>
          	<language>perl</language>
            <code>defined $value "--adapter_1 $value"</code>
          </format>
          <group>13</group>
          </attributes>
        </parameter>
        
        <parameter type="String">
          <name>adaptersequence2</name>
          <attributes>
          <prompt>Adaptor sequence that may occur on the paired-read for filtering.(--adapter_2)</prompt>
          <format>
            <language>perl</language>
            <code>defined $value "--adapter_2 $value"</code>
          </format>
          <group>14</group>
          </attributes>
        </parameter>
        
        <parameter type="Integer">
          <name>mismatches</name>
          <attributes>
          <prompt>Number of mismatches allowed in the adapter sequence (--adapter_mm)</prompt>
          <format>
          	<language>perl</language>
            <code>defined $value "--adapter_mm $value"</code>
          </format>
          <group>15</group>
          </attributes>
        </parameter>
        
        <parameter type="Switch">
          <name>low_qual</name>
          <attributes>
          <prompt>Discard low quality reads. (-q)</prompt>
          <format>
            <language>perl</language>
            <code>($value) ? " -q " : "" </code>
          </format>
          <group>16</group>
          </attributes>
        </parameter>
        
        <parameter type="Integer">
          <name>trim_read</name>
          <attributes>
          <prompt>Trim reads to length (-t)</prompt>
          <format>
            <language>perl</language>
            <code>(defined $value) ? "-t $value" : ""</code>
          </format>
          <group>17</group>
          </attributes>
        </parameter>

        <parameter ishidden="1" type="String">
          <name>commandend3</name>
          <attributes>
          <prompt>commandend</prompt>
          <format>
           	<language>perl</language>
            <code>" % cp inputstrainfile.data strainfile.txt"</code>
          </format>
          <group>50</group>
          </attributes>
        </parameter>
        
        <parameter type="OutFile">
          <name>strainfile</name>
          <attributes>
          <prompt>strainfile</prompt>
          <filenames>strainfile.txt</filenames>
          </attributes>
        </parameter>
        
        <parameter type="OutFile">
          <name>logfile</name>
          <attributes>
          <prompt>log file</prompt>
          <filenames>std.err</filenames>
          </attributes>
        </parameter>
        
      </parameters>
    </paragraph>  
</parameter>     
    
  <parameter ismandatory="1" issimple="1" type="String">
          <name>output_name</name>
          <attributes>
          	<prompt>Name for your output</prompt>
          	<vdef>
          		<value>output</value>
          	</vdef>
          	<ctrls>
          		<ctrl>
          			<message>Please enter a value for the output file name</message>
          			<language>perl</language>
          			<code>!defined $output_name</code>
          		</ctrl>
          	</ctrls>
          </attributes>
    </parameter> 
     	
	 	<parameter type="Results">
				<name>all_outputfiles</name>
				<attributes>
					<filenames>*</filenames>
				</attributes>
			</parameter>	
			
</parameters>
</pise>