Skip to content
Snippets Groups Projects
Commit b1569a3f authored by aurore.comte_ird.fr's avatar aurore.comte_ird.fr
Browse files

bug correction in rule star_to_diffex

parent 4e2be497
No related branches found
No related tags found
1 merge request!4Integration of STAR as mapper.
......@@ -267,7 +267,7 @@ rule star_map_count:
other = config['PARAMS']['STAR']['mapping']["params"],
R2= f"{fastq_dir}/{{fastq}}_R2{RNAja_obj.fastq_files_ext}" if config['DATA']['PAIRED'] else '',
output:
bam = f"{output_dir}/COUNT/STAR/{{fastq}}Aligned.out.sam",
bam = f"{output_dir}/COUNT/STAR/{{fastq}}Aligned.out.bam",
genecount= f"{output_dir}/COUNT/STAR/{{fastq}}ReadsPerGene.out.tab",
bam_sort= f"{output_dir}/MAPPING/STAR/{{fastq}}.bam",
log :
......@@ -333,10 +333,10 @@ rule star_to_diffex:
"""
(
# retrieve the 4th column of each "ReadsPerGene.out.tab" file + the first column that contains the gene IDs
paste {input.countsfiles} | grep -v "_" | awk '{{printf "%s\t", $1}}{{for (i=4;i<=NF;i+=4) printf "%s\t", $i; printf "\n" }}' > {output.intermediate_result}
paste {input.countsfiles} | grep -v '_' | awk '{{printf "%s\\t", $1}}{{for (i=4;i<=NF;i+=4) printf "%s\\t", $i; printf "\\n" }}' > {output.intermediate_result}
# add header: "gene_name" + the name of each of the counts file
sed -e "1igene_name\t$(ls {input.countsfiles} | tr '\n' '\t' | sed 's/ReadsPerGene.out.tab//g')" tmp | cut -f1-7 > {output.stargenecount}
sed -e "1igene_name\\t$(ls {input.countsfiles} | tr '\\n' '\\t' | sed 's/ReadsPerGene.out.tab//g')" {output.intermediate_result} | cut -f1-7 > {output.stargenecount}
) 1>{log.output} 2>{log.error}
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment