Skip to content
Snippets Groups Projects
Commit 1bbb3b84 authored by christine.tranchant_ird.fr's avatar christine.tranchant_ird.fr
Browse files

integrating bam stats

parent 09f5d72b
No related branches found
No related tags found
No related merge requests found
......@@ -194,8 +194,8 @@ def dashboard_group(df):
# show the dashboard with the data embedded ,
# (for using in an html download of the notebook so that
# no 'callback' is required from the browser to get the data)
dashboard.embed()
#display(dashboard)
#dashboard.embed()
display(dashboard)
def dashboard_fastq(csv, total_size, group_file, output_dir):
......@@ -275,10 +275,8 @@ def dashboard_fastq(csv, total_size, group_file, output_dir):
plt.savefig(os.path.join(output_dir,f"sample_reads_base_ratio.png"))
plt.close()
def dashboard_flagstat(stat_file, group_file, output_png):
def dashboard_flagstat(stat_file, df_group, output_png):
id_dict,df_group = frangiPANe.read_group_file(group_file)
df_bam_stat = pd.read_csv(stat_file, index_col=False, sep=",")
df_bam_stat.sort_values(by=['sample'], inplace=True)
......
Source diff could not be displayed: it is too large. Options to address this: view the blob.
......@@ -3,7 +3,9 @@ rule generate_jupyter_book:
jb_file=f"{ frangipane_obj.install_path }/report/frangiPANe_report.ipynb",
ref_png=f"{frangipane_obj.path_stat_plot}/00_ref.png",
ref_csv = f"{frangipane_obj.path_stat_sum}/00_ref.txt",
fastqstat_csv = rules.merge_fastq_stats.output.stat_file
fastqstat_csv = rules.merge_fastq_stats.output.stat_file,
bamstat_csv = rules.plot_mapping.input.csv,
bam_png = rules.plot_mapping.output.png_mapping
output:
jb_file=f"{ frangipane_obj.path_output }/report/frangiPANe_stats.ipynb"
params:
......
......@@ -34,7 +34,7 @@ rule merge_flagstat:
for line in stat:
line = line.rstrip()
if 'mapped (' in line or 'paired (' in line or 'singleton' in line:
if 'mapped (' in line or 'paired (' in line and not 'primary' in line or 'singleton' in line:
# print(line.split('(')[1].split('%')[0])
newLine += f",{line.split('(')[1].split('%')[0]}"
......
......@@ -16,7 +16,9 @@ dico = {
"ref_png" : snakemake.input.ref_png,
"ref_csv" : snakemake.input.ref_csv,
"stat_file" : snakemake.input.fastq_csv,
"fastqstat_csv" : snakemake.input.fastqstat_csv
"fastqstat_csv" : snakemake.input.fastqstat_csv,
"bamstat_csv" : snakemake.input.bamstat.csv,
"bam_png" : snakemake.input.bam_png
}
with open(jb_input, "r", encoding="utf-8") as notebook_file:
......
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