Commit 36f91741 authored by Gervaise Henry's avatar Gervaise Henry 🤠

Merge branch '8-CountDesignFile' into 'develop'

Create Design file for count with 1 bcl input

Closes #8

See merge request !38
parents 0131bd60 6dcc8372
Pipeline #4266 passed with stages
in 1 minute and 59 seconds
......@@ -13,6 +13,9 @@ params.references = "$baseDir/../docs/references.md"
// Define List of Files
tarList = Channel.fromPath( params.bcl )
bclCount = Channel
.fromPath( params.bcl )
.count()
// Define regular variables
name = params.name
......@@ -33,6 +36,7 @@ process checkDesignFile {
output:
file("design.checked.csv") into designPaths
file("design.checked.csv") into designCount
script:
"""
......@@ -74,6 +78,7 @@ process mkfastq {
output:
file("**/outs/**/*.fastq.gz") into fastqPaths
file("**/outs/**/*.fastq.gz") into cellrangerCount
file("**/outs/fastq_path/Stats/Stats.json") into bqcPaths
val "${bcl.baseName}" into bclName
......@@ -85,6 +90,25 @@ process mkfastq {
"""
}
if (bclCount.value == 1) {
process countDesign {
tag "$name"
publishDir "$outDir/misc/${task.process}/$name", mode: 'copy'
input:
file fastqs from cellrangerCount.collect()
file design from designCount
output:
file("Cellranger_Count_Design.csv") into CountDesign
script:
"""
bash "$baseDir/scripts/countDesign.sh"
"""
}
}
process fastqc {
tag "$bclName"
queue 'super'
......
#!/bin/bash
#countDesign.sh
fastqs=`ls *.fastq.gz`;
design=`ls *.csv`;
sample=`cat $design | tail -n +2 | cut -d ',' -f2`;
for i in ${fastqs};
do
if [[ ${i} == *_S0_* ]];
then
continue;
elif [[ ${i} == *_I* ]];
then
continue;
else
good=( "${good[@]}" "${i}" );
fi;
done
echo "Sample,fastq_R1,fastq_R2" > Cellranger_Count_Design.csv;
echo "${sample},${good[0]},${good[1]}" >> Cellranger_Count_Design.csv;
Markdown is supported
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