11######
22######
3- ###### C- modifications of reads with isnertions
3+ ###### Base modifications of reads with isnertions
44######
55######
66
@@ -11,9 +11,9 @@ rule readnames_final:
1111 input :
1212 final_insertions = f"{ outdir } /final/localization/ExactInsertions_{{sample}}.bed"
1313 log :
14- log = f"{ outdir } /intermediate/log/cmod /readnames_final/{{sample}}.log"
14+ log = f"{ outdir } /intermediate/log/base_modifications /readnames_final/{{sample}}.log"
1515 output :
16- readnames = f"{ outdir } /intermediate/cmod /final_insertion_readnames_{{sample}}.txt"
16+ readnames = temp ( f"{ outdir } /intermediate/base_modifications /final_insertion_readnames_{{sample}}.txt" )
1717 conda :
1818 "../envs/VIS_dummy_env.yml"
1919 shell :
@@ -23,15 +23,14 @@ rule readnames_final:
2323 ) > {log.log} 2>&1
2424 """
2525
26-
27- rule only_keep_valid_insertions :
26+ rule only_keep_filtered_insertions :
2827 input :
2928 isobam = f"{ outdir } /intermediate/mapping/Precut_{{sample}}_sorted.bam" ,
3029 readnames = f"{ outdir } /intermediate/cmod/final_insertion_readnames_{{sample}}.txt"
3130 log :
32- log = f"{ outdir } /intermediate/log/cmod/filter /{{sample}}.log"
31+ log = f"{ outdir } /intermediate/log/base_modifications/only_keep_filtered_insertions /{{sample}}.log"
3332 output :
34- bam = f"{ outdir } /intermediate/cmod /Final_Isolated_Reads_{{sample}}.bam"
33+ bam = f"{ outdir } /intermediate/base_modifications /Final_Isolated_Reads_{{sample}}.bam"
3534 conda :
3635 "../envs/VIS_samtools_env.yml"
3736 shell :
@@ -42,40 +41,40 @@ rule only_keep_valid_insertions:
4241 ) > {log.log} 2>&1
4342 """
4443
45-
4644rule modkit :
4745 input :
48- isobam = f"{ outdir } /intermediate/cmod /Final_Isolated_Reads_{{sample}}.bam"
46+ isobam = f"{ outdir } /intermediate/base_modifications /Final_Isolated_Reads_{{sample}}.bam"
4947 log :
50- log = f"{ outdir } /intermediate/log/cmod /modkit/{{sample}}.log"
48+ log = f"{ outdir } /intermediate/log/base_modifications /modkit/{{sample}}.log"
5149 output :
52- tsv = f"{ outdir } /intermediate/cmod /Isolated_Reads_{{sample}}.tsv"
50+ tsv = f"{ outdir } /final/base_modifications /Isolated_Reads_{{sample}}.tsv"
5351 conda :
5452 "../envs/VIS_modkit_env.yml"
53+ threads : config ["threads" ]
5554 shell :
5655 """
5756 (
58- modkit extract full -t 20 {input.isobam} {output.tsv}
57+ modkit extract full -t {threads} {input.isobam} {output.tsv}
5958 ) > {log.log} 2>&1
6059 """
6160
6261rule call_modkit :
6362 input :
64- isobam = f"{ outdir } /intermediate/cmod /Final_Isolated_Reads_{{sample}}.bam"
63+ isobam = f"{ outdir } /intermediate/base_modifications /Final_Isolated_Reads_{{sample}}.bam"
6564 log :
66- log = f"{ outdir } /intermediate/log/cmod/Calls_modkit /{{sample}}.log"
65+ log = f"{ outdir } /intermediate/log/base_modifications/call_modkit /{{sample}}.log"
6766 output :
68- tsv = f"{ outdir } /intermediate/cmod /Calls_Isolated_Reads_{{sample}}.tsv"
67+ tsv = f"{ outdir } /final/base_modifications /Calls_Isolated_Reads_{{sample}}.tsv"
6968 conda :
7069 "../envs/VIS_modkit_env.yml"
70+ threads : config ["threads" ]
7171 shell :
7272 """
7373 (
74- modkit extract calls -t 20 {input.isobam} {output.tsv}
74+ modkit extract calls -t {threads} {input.isobam} {output.tsv}
7575 ) > {log.log} 2>&1
7676 """
7777
78-
7978'''
8079rule specific_methylartist:
8180 input:
@@ -93,7 +92,7 @@ rule specific_methylartist:
9392 methylartist locus -b {input.bam} -i chr17:31124037-31180287 -n C -r {input.ref} -l 31154037-31159287 -o {output.plot}
9493 ) > {log.log} 2>&1
9594 """
96- '''
95+
9796
9897rule inserted_seq:
9998 input:
@@ -109,3 +108,4 @@ rule inserted_seq:
109108 except Exception as e:
110109 with open(log.log, "a") as log_file:
111110 log_file.write(f"Error: {str(e)}\n ")
111+ '''
0 commit comments