Commit 85b68b5a authored by peguerin's avatar peguerin
Browse files

debig

parent 44ec4874
......@@ -16,67 +16,5 @@ rule all:
expand('../99-log/01-assembly/03-assign_sequences/{run}.log',run=config["fastqFiles"]),
expand('../99-log/01-assembly/04-split_sequences/{run}.log',run=config["fastqFiles"]),
#include: "../00-rules/assembly.smk"
#include: "../00-rules/demultiplex.smk"
### Paired end alignment then keep reads with quality > 40
rule illuminapairedend:
input:
R1=config['fastqFolderPath']+'{run}_R1.fastq.gz',
R2=config['fastqFolderPath']+'{run}_R2.fastq.gz'
output:
fq='01-illuminapairedend/{run}.fastq'
singularity:
config["container"]
log:
'../99-log/01-assembly/01-illuminapairedend/{run}.log'
params:
s_min=config["illuminapairedend"]["s_min"]
shell:
'''illuminapairedend -r {input.R2} {input.R1} --score-min={params.s_min} > {output.fq} 2> {log}'''
### Remove unaligned sequence records
rule remove_unaligned:
input:
fq='01-illuminapairedend/{run}.fastq'
output:
ali='02-remove_unaligned/{run}.ali.fastq'
singularity:
config["container"]
log:
'../99-log/01-assembly/02-remove_unaligned/{run}.log'
shell:
'''obigrep -p 'mode!=\"joined\"' {input.fq} > {output.ali} 2> {log}'''
### Assign each sequence record to the corresponding sample/marker combination
rule assign_sequences:
input:
'01-assembly/{run}/{run}.ali.fastq',
output:
assign='01-assembly/{run}/{run}.ali.assigned.fastq',
unid='01-assembly/{run}/{run}.unidentified.fastq'
singularity:
config["container"]
params:
barcodeFile=lambda wcs: config["barcodeFiles"][wcs.run],
barcodeFolder=config['fastqFolderPath']
log:
'99-log/assign_sequences/{run}.log'
shell:
'''ngsfilter -t {params.barcodeFolder}{params.barcodeFile} -u {output.unid} {input} --fasta-output > {output.assign} 2> {log}'''
### Split the input sequence file in a set of subfiles according to the values of attribute `sample`
rule split_sequences:
input:
'01-assembly/{run}/{run}.ali.assigned.fastq'
params:
'02-demultiplex/02-01-raw/{run}_sample_'
singularity:
config["container"]
log:
'99-log/split_sequences/{run}.log'
shell:
'''obisplit -p "{params}" -t sample --fasta {input} 2> {log}'''
include: "../00-rules/assembly.smk"
include: "../00-rules/demultiplex.smk"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment