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

correction de bug: single ne marche pas

parent 7aa11e5f
No related branches found
No related tags found
No related merge requests found
......@@ -13,7 +13,7 @@ MODE:
HISAT2_HTSEQCOUNT: false
STARmap_STARcount: false
STARmap_HTSEQCOUNT: false
STARmap_STRINGTIE: false
STARmap_STRINGTIE: true
PARAMS:
HISAT2:
......
......@@ -10,9 +10,9 @@ DATA:
MODE:
HISAT2_STRINGTIE: true
HISAT2_HTSEQCOUNT: true
STARmap_STARcount: true
STARmap_HTSEQCOUNT: true
HISAT2_HTSEQCOUNT: false
STARmap_STARcount: false
STARmap_HTSEQCOUNT: false
STARmap_STRINGTIE: true
PARAMS:
......@@ -25,6 +25,6 @@ PARAMS:
mapping:
params: "--readFilesCommand zcat" # --outFilterMismatchNoverLmax 0.03
STRINGTIE:
discovery_mode : false
discovery_mode : true
HTSEQCOUNT:
params: "-s reverse -m union -t gene "
......@@ -38,7 +38,7 @@ workdir: output_dir
if config["DATA"]["PAIRED"]:
SAMPLE_NAME, = glob_wildcards(f"{fastq_dir}/{{fastq}}_R1{RNAja_obj.fastq_files_ext}")
else:
SAMPLE_NAME, = glob_wildcards(f"{fastq_dir}/{{fastq}}{RNAja_obj.fastq_files_ext}")
SAMPLE_NAME, = glob_wildcards(f"{fastq_dir}/{{fastq}}_R1{RNAja_obj.fastq_files_ext}")
MAPPERS = []
COUNTERS = []
......@@ -99,12 +99,13 @@ def get_threads(rule, default):
#*###############################################################################
def final_return(wildcards):
dico_final = {
"multiqc" : expand(f"{output_dir}/MULTIQC/multiqc.html"),
#"multiqc" : expand(f"{output_dir}/MULTIQC/multiqc.html"),
#"mapping" : expand(f"{output_dir}/MAPPING/{{mappers}}/{{fastq}}.bam", mappers = MAPPERS, fastq = SAMPLE_NAME),
#"STRINGTIE" : expand(f'{output_dir}/COUNT/STRINGTIE/{{fastq}}.gtf', fastq = SAMPLE_NAME),
#"STRINGTIE_list" : f'{output_dir}/COUNT/STRINGTIE/HISAT_Stringtie_list.txt',
#"gffcompare_stat" : f'{output_dir}/COUNT/STRINGTIE/merged.stats',
"gene_count" : expand(f'{output_dir}/COUNT/{{counters}}/{{mappers}}_{{counters}}_gene_count_matrix.csv', zip, mappers = MAPPERS, counters = COUNTERS),
#"gtf_out" : expand(f'{output_dir}/COUNT/STRINGTIE/{{mappers}}/{{mappers}}_gtf_list.txt', mappers = MAPPERS),
"gene_count" : expand(f'{output_dir}/COUNT/{{counters}}/{{mappers}}/{{mappers}}_{{counters}}_gene_count_matrix.csv', zip, mappers = MAPPERS, counters = COUNTERS),
#"tcsv_hisat" : f'{output_dir}/COUNT/STRINGTIE/HISAT_transcript_count_matrix.csv',
#"RNA_diff_exp" : f"{output_dir}/4_DE_analysis/diane_Counts.csv",
#"htseqcount" : expand(f'{output_dir}/COUNT/HTSEQCOUNT/{{mappers}}/{{fastq}}_gene_count.csv',mappers=MAPPERS, fastq = SAMPLE_NAME)
......@@ -295,6 +296,7 @@ rule star_map_count:
Input :
- Reference : {input.reference}
- R1: {input.R1}
- R2: {params.R2}
Ouput :
- bam file : {output.bam}
""" + "*" *100
......@@ -420,8 +422,8 @@ rule stringtie_discovery :
bam = rules.samtools_stats.input.sorted_bam_file,
gtf = annotation_path
output:
gtf= f'{output_dir}/COUNT/STRINGTIE/{{mappers}}_{{fastq}}_DIS.gtf',
tsv=f'{output_dir}/COUNT/STRINGTIE/{{mappers}}_{{fastq}}_DIS.tsv'
gtf= f'{output_dir}/COUNT/STRINGTIE/{{mappers}}/{{mappers}}_{{fastq}}_DIS.gtf',
tsv=f'{output_dir}/COUNT/STRINGTIE/{{mappers}}/{{mappers}}_{{fastq}}_DIS.tsv'
message:
f"""
Execute {{rule}}
......@@ -441,9 +443,9 @@ rule stringtie_discovery :
rule stringtie_gtf_list_discovery:
threads : 1
input:
list_gtf = expand(rules.stringtie_discovery.output.gtf, fastq = SAMPLE_NAME, mappers=MAPPERS),
list_gtf = expand(f"{output_dir}"+"/COUNT/STRINGTIE/"+"{{mappers}}"+"/"+"{{mappers}}"+"_"+"{fastq}"+"_DIS.gtf", fastq = SAMPLE_NAME),
output :
gtf_out = f'{output_dir}/COUNT/STRINGTIE/{{mappers}}_gtf_list_DIS.txt',
gtf_out = f'{output_dir}/COUNT/STRINGTIE/{{mappers}}/{{mappers}}_gtf_list_DIS.txt',
shell:
"""
find {input.list_gtf} >> {output.gtf_out}
......@@ -456,7 +458,7 @@ rule merge_stringtie_gtf_discovery:
gtf_ref = annotation_path,
list_gtf = rules.stringtie_gtf_list_discovery.output.gtf_out,
output:
gtf_merged = f'{output_dir}/COUNT/STRINGTIE/{{mappers}}_stringtie_merged_DIS.gtf',
gtf_merged = f'{output_dir}/COUNT/STRINGTIE/{{mappers}}/{{mappers}}_stringtie_merged_DIS.gtf',
message:
"""
Execute {rule}
......@@ -478,8 +480,8 @@ rule stringtie :
bam = rules.samtools_stats.input.sorted_bam_file,
gtf = f"{rules.merge_stringtie_gtf_discovery.output.gtf_merged}" if config["PARAMS"]["STRINGTIE"]["discovery_mode"] else f'{annotation_path}'
output:
gtf= f'{output_dir}/COUNT/STRINGTIE/{{mappers}}_{{fastq}}.gtf',
tsv = f'{output_dir}/COUNT/STRINGTIE/{{mappers}}_{{fastq}}.tsv'
gtf= f'{output_dir}/COUNT/STRINGTIE/{{mappers}}/{{mappers}}_{{fastq}}.gtf',
tsv = f'{output_dir}/COUNT/STRINGTIE/{{mappers}}/{{mappers}}_{{fastq}}.tsv'
message:
"""
Execute {rule}
......@@ -496,9 +498,9 @@ rule stringtie :
rule stringtie_gtf_list:
threads : 1
input:
list_gtf = expand(f'{output_dir}/COUNT/STRINGTIE/{{mappers}}_{{fastq}}.gtf', fastq = SAMPLE_NAME, mappers=MAPPERS),
list_gtf = expand(f"{output_dir}"+"/COUNT/STRINGTIE/"+"{{mappers}}"+"/"+"{{mappers}}"+"_"+"{fastq}"+".gtf", fastq = SAMPLE_NAME),
output :
gtf_out = f'{output_dir}/COUNT/STRINGTIE/{{mappers}}_gtf_list.txt',
gtf_out = f'{output_dir}/COUNT/STRINGTIE/{{mappers}}/{{mappers}}_gtf_list.txt',
shell:
"""
find {input.list_gtf} >> {output.gtf_out}
......@@ -511,7 +513,7 @@ rule merge_stringtie_gtf:
gtf_ref = annotation_path,
list_gtf = rules.stringtie_gtf_list.output.gtf_out,
output:
gtf_merged = f'{output_dir}/COUNT/STRINGTIE/{{mappers}}_stringtie_merged.gtf',
gtf_merged = f'{output_dir}/COUNT/STRINGTIE/{{mappers}}/{{mappers}}_stringtie_merged.gtf',
message:
"""
Execute {rule}
......@@ -526,16 +528,14 @@ rule merge_stringtie_gtf:
# Create a list with the ID sample and the path of the stringtie GTF
rule list_for_prepDE:
input:
gtf = expand(rules.stringtie_gtf_list.output.gtf_out, mappers=MAPPERS)
gtf = rules.stringtie_gtf_list.output.gtf_out
output:
list= f'{output_dir}/COUNT/STRINGTIE/{{mappers}}_Stringtie_list.txt'
list= f'{output_dir}/COUNT/STRINGTIE/{{mappers}}/{{mappers}}_Stringtie_list.txt'
run:
for mapper in MAPPERS:
list_name_reads= open(f'{output_dir}/COUNT/STRINGTIE/{mapper}_Stringtie_list.txt', "w")
gtf = open(f'{output_dir}/COUNT/STRINGTIE/{mapper}_gtf_list.txt', "r")
for i in range(len(SAMPLE_NAME)):
name=SAMPLE_NAME[i]
list_name_reads.write(name + " " + gtf.readline())
gtf = open(input.gtf,"r")
list_name_reads= open(output.list, "w")
for i in SAMPLE_NAME:
list_name_reads.write(i + " " + gtf.readline())
# Convert the stringtie GTF to a count table
......@@ -544,8 +544,8 @@ rule prepDE_stringtie_table:
input :
mergelist = rules.list_for_prepDE.output.list,
output :
gcsv = f'{output_dir}/COUNT/STRINGTIE/{{mappers}}_STRINGTIE_gene_count_matrix.csv',
tcsv = f'{output_dir}/COUNT/STRINGTIE/{{mappers}}_STRINGTIE_transcript_count_matrix.csv',
gcsv = f'{output_dir}/COUNT/STRINGTIE/{{mappers}}/{{mappers}}_STRINGTIE_gene_count_matrix.csv',
tcsv = f'{output_dir}/COUNT/STRINGTIE/{{mappers}}/{{mappers}}_STRINGTIE_transcript_count_matrix.csv',
singularity:
tools_config["SINGULARITY"]["TOOLS"]
shell:
......
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