Mapping_Denovo.snake 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. Data_Dir = config["Data_Dir"]
  2. Mapping_Dir = config["Mapping_Dir"]
  3. transcripts = config["transcripts"]
  4. gene_trans_map = config["gene_trans_map"]
  5. rule trans_build:
  6. input:
  7. transcripts
  8. output:
  9. expand(transcripts + ".{index}.bt2", index=range(1, 5)),
  10. expand(transcripts + ".rev.{index}.bt2", index=range(1,3))
  11. shell:
  12. "rsem-prepare-reference --transcript-to-gene-map {gene_trans_map} --bowtie2 {transcripts} {transcripts}"
  13. rule bowtie2:
  14. input:
  15. transcripts,
  16. expand(transcripts + ".{index}.bt2", index=range(1, 5)),
  17. expand(transcripts + ".rev.{index}.bt2", index=range(1,3)),
  18. left = Data_Dir + "/{sample}_1.fq.gz",
  19. right = Data_Dir + "/{sample}_2.fq.gz"
  20. output:
  21. Mapping_Dir + "/{sample}/bowtie2.bam"
  22. threads: 4
  23. shell:
  24. "bowtie2 --no-mixed --no-discordant --gbar 1000 --end-to-end -k 200"
  25. " -x {transcripts} -1 {input.left} -2 {input.right}"
  26. " -p {threads}"
  27. " 2> {Mapping_Dir}/{wildcards.sample}.log | "
  28. " samtools view -F 4 -S -b | "
  29. " samtools sort -n -o {Mapping_Dir}/{wildcards.sample}/bowtie2.bam"