bam_prep.smk 1.14 KB
Newer Older
1
2
3
4
5
6
7
rule illumina_bams:
  input:
    fasta = "data_prep/unpaired.{divider}.{offset}.fastq",
    genome = ASSEMBLY,
  output:
    "data_prep_bams/illumina.{divider,[0-9]+}.{offset,[0-9]+}.bam"
  shadow: "shallow"
8
  conda: "../envs/nextflow.yml"
9
10
11
12
13
14
15
16
17
18
19
20
21
22
  threads: 16
  shell:
    """
    bwa index -p index {input.genome}
    bwa mem -t {threads} -a -c 10000 index {input.fasta} | samtools view -1 -b - > {output}
    """
    
rule pacbio_bams:
  input:
    fasta = "data_prep/pacbio.{divider}.{offset}.fastq",
    genome = ASSEMBLY,
  output:
    "data_prep_bams/pacbio.{divider,[0-9]+}.{offset,[0-9]+}.pb.bam"
  shadow: "shallow"
23
  conda: "../envs/nextflow.yml"
24
25
26
27
28
29
30
31
32
33
34
35
36
  threads: 16
  shell:
    """
      minimap2 -H -x map-pb -a -t {threads} {input.genome} {input.fasta}  | samtools view -1 -b - > {output}
    """
    
rule nanopore_bams:
  input:
    fasta = "data_prep/nanopore.sim.{num}.fastq",
    genome = ASSEMBLY,
  output:
    "data_prep_bams/nanopore.{num,[0-9]+}.ont.bam"
  shadow: "shallow"
37
  conda: "../envs/nextflow.yml"
38
39
40
41
42
43
  threads: 16
  shell:
    """
      minimap2 -x map-ont -a -t {threads} {input.genome} {input.fasta}  | samtools view -1 -b - > {output}
    """