Skip to content
Snippets Groups Projects
Commit 43b4c8be authored by valegale's avatar valegale
Browse files

adding longQC rule

parent 4be61c7b
No related branches found
No related tags found
2 merge requests!5fixing longqc and nanoplot, making longqc optional, adding a parameter to...,!4fixing longqc and nanoplot, making longqc optional, adding a parameter to...
......@@ -4,6 +4,7 @@
buscoLineage/
buscoLineage
tools/LongQC/
#ignoring the new logs
slurm_logs/
......
......@@ -138,8 +138,11 @@ elif set(['sample', 'hifi_reads', 'meryl_kmer_size','trimSMRTbell', 'fastQC']).i
samples=samples.set_index(['sample','readCounter'])
ruleAllQCFiles=[]
longqc_dir = "tools/LongQC"
ruleAllQCFiles=[]
### TODO change this column in a generic QC analysis. (both nanoplot and and longqc running)
if samples['fastQC'].str.contains('True').any():
ruleAllQCFiles=[expand(os.path.join(config['Results'],"0_buildDatabases/{sample}/hifiReads/QC/multiqc/{sample}.multiqcReport.html"), sample=key) for key, [value1, value2] in testDictQC.items()]
ruleAll=[expand(os.path.join(config['Results'],"0_buildDatabases/{sample}/hifiReads/merylDb/complete_hifi.{sample}.{kmer}.meryl"), sample=key, kmer=value1) for key, [value1, value2] in dictSamples.items()]
......
- add nanoplot DONE
- remove cutadapter
- change hifi to long reads or something similar
- add longqc (optional)
- add longqc DONE
- add a column for pacbio/ont
......@@ -167,6 +167,11 @@ nanoplot_hifi:
time: "12:00:00"
threads: 2
longQC_hifi:
mem_mb: 12000
time: "12:00:00"
threads: 4
multiQC_hifi:
mem_mb: 4000
time: "06:00:00"
......
channels:
- anaconda
- conda-forge
- bioconda
dependencies:
- matplotlib=3.10.0
- scikit-learn=1.6.1
- pandas=2.2.3
- jinja2=3.1.5
- h5py=3.12.1
- pysam=0.23.0
- edlib=1.2.3
- python-edlib=1.3.9.post1
\ No newline at end of file
......@@ -113,7 +113,8 @@ rule fastQC_hifi:
rule multiQC_hifi:
input:
lambda wildcards: expand(os.path.join(config['Results'],"0_buildDatabases/{sample}/hifiReads/QC/fastqc/{readCounter}.{smrtornot}_fastqc.html"), sample=wildcards.sample, readCounter=dictReadCounter[wildcards.sample], smrtornot=dictSamples[wildcards.sample][1]),
os.path.join(config['Results'],"0_buildDatabases/{sample}/hifiReads/QC/nanoplot/NanoPlot-report.html")
os.path.join(config['Results'],"0_buildDatabases/{sample}/hifiReads/QC/nanoplot/NanoPlot-report.html"),
os.path.join(config['Results'],"0_buildDatabases/{sample}/hifiReads/QC/longQC/results/web_summary.html")
params:
folder2qc=os.path.join(config['Results'],"0_buildDatabases/{sample}/hifiReads/QC/fastqc/"),
folder2qc2=os.path.join(config['Results'],"0_buildDatabases/{sample}/hifiReads/QC/nanoplot/"),
......@@ -199,3 +200,37 @@ rule NanoPlot:
"""
(NanoPlot -t {threads} -o {params.folder2out} --fastq {input} --plots kde dot) &> {log}
"""
rule longQC:
input:
fastq = lambda wildcards: expand(os.path.join(config['Results'],"0_buildDatabases/{sample}/hifiReads/temp_trimReads/{readCounter}.{smrtornot}.fastq"), sample=wildcards.sample, readCounter=dictReadCounter[wildcards.sample], smrtornot=dictSamples[wildcards.sample][1]),
path_lonqqc = os.path.join(longqc_dir,"longQC.py")
params:
folder2out=os.path.join(config['Results'],"0_buildDatabases/{sample}/hifiReads/QC/longQC/")
output:
os.path.join(config['Results'],"0_buildDatabases/{sample}/hifiReads/QC/longQC/results/web_summary.html")
threads:
resource['longQC_hifi']['threads']
resources:
mem_mb=resource['longQC_hifi']['mem_mb'],
time=resource['longQC_hifi']['time'],
log:
os.path.join(config['Results'], "0_buildDatabases/{sample}/hifiReads/logs/longQC.log")
conda:
os.path.join(workflow.basedir, "envs/LONGQC.yaml")
shell:
"""
## TODO making either pacbio or nanopore for -x
(python tools/LongQC/longQC.py sampleqc -x ont-rapid -o {params.folder2out}/results {input.fastq}) &> {log}
"""
rule install_longqc:
output:
os.path.join(longqc_dir,"longQC.py")
shell:
"""
mkdir -p tools
cd tools
git clone https://github.com/yfukasawa/LongQC.git
cd LongQC/minimap2-coverage && make
"""
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment