title: output of one rule as input of another
body: <p>I am new to snakemake and I'm trying to write a complex pipeline with many steps and branching points. One of the earlier steps is a STAR alignment. </p>
  
  <p>Here I want to use the genome alignment for some stuff and the transcriptome aligment for others. I'm outputting two output files and I want to use each of these as inputs for other rules in snakemake. </p>
  
  <p>If possible I want to avoid using actual filenames and I want snakemake to deal with it for me. </p>
  
  <pre class="lang-py prettyprint-override"><code>rule star:
      input:
          reads=samples.iloc[0,1].split(",")
      output:
          tx_align=temp("/".join([output_directory, "star", samplename+"Aligned.toTranscriptome.out.bam"])),
          genome_align="/".join([output_directory, "star", samplename+"Aligned.sortedByCoord.out.bam"])
      params:
          index=config["resources"]["star_index"],
          gtf=config["resources"]["gtf"],
          prefix="/".join([output_directory, "star", samplename])
      log: config["root_dir"]+"/"+str{samples["samplename"]}+"star.log"
      threads: 10
      shell:
          """
          STAR --runMode alignReads \
          --runThreadN {threads} \
          --readFilesCommand zcat \
          --readFilesIn {reads} \
          --genomeDir {params.index} \
          --outFileNamePrefix {params.prefix} \
          --twopassMode Basic \
          --sjdbGTFfile {params.gtf} \
          --outFilterType BySJout \
          --limitSjdbInsertNsj 1200000 \
          --outSAMstrandField intronMotif \
          --outFilterIntronMotifs None \
          --alignSoftClipAtReferenceEnds Yes \
          --quantMode TranscriptomeSAM GeneCounts \
          --outSAMtype BAM SortedByCoordinate \
          --outSAMattrRGline ID:{samplename}, SM:sm1 \
          --outSAMattributes All \
          --outSAMunmapped Within \
          --outSAMprimaryFlag AllBestScore \
          --chimSegmentMin 15 \
          --chimJunctionOverhangMin 15 \
          --chimOutType Junctions \
          --chimMainSegmentMultNmax 1 \
          --genomeLoad NoSharedMemory
          """
  </code></pre>
  
  <p>So then I wan to use something like</p>
  
  <pre class="lang-py prettyprint-override"><code>rule rsem:
      input:
          rules.star.ouput[0]
      output:
          somefile
      run:
         etc
  </code></pre>
  
  <p>I'm not even sure if this is possible. </p>