Commit ea4a6e80 authored by Philippe BORDRON's avatar Philippe BORDRON
Browse files

Merge branch 'fix-evolution_nbreads' into 'master'

dirty fix for evolution_nbreads.py

Closes #39

See merge request !12
parents 17f641e4 abfd153a
Pipeline #31828 failed with stages
in 29 minutes and 54 seconds
......@@ -17,7 +17,7 @@ with open(CONFIG) as json_file:
stats = pd.read_csv(OUTDIR + "/import/summary/per-sample-fastq-counts.tsv", sep="\t", index_col=0)
stats = pd.DataFrame(stats.iloc[:, 0])
stats.columns = ["input"]
stats.index = stats.index.astype(str) # Force index as string in order to avoid empty join with dada2 stats
################################################################
# If cutadapt was run, get number of reads after its execution #
......@@ -27,6 +27,7 @@ try:
df = pd.read_csv(OUTDIR + "/cutadapt/summary/per-sample-fastq-counts.tsv", sep="\t", index_col=0)
df = pd.DataFrame(df.iloc[:, 0])
df.columns = ["cutadapt"]
df.index = df.index.astype(str) # Force index as string in order to avoid empty join with dada2 stats
stats = pd.merge(stats, df, left_index=True, right_index=True)
except FileNotFoundError:
......@@ -43,6 +44,7 @@ try:
sep="\t", index_col=0)
df = pd.DataFrame(df.iloc[:, 0])
df.columns = ["reference_based_filtering"]
df.index = df.index.astype(str) # Force index as string in order to avoid empty join with dada2 stats
stats = pd.merge(stats, df, left_index=True, right_index=True)
except (KeyError, FileNotFoundError):
......@@ -54,10 +56,9 @@ try:
dada2_stats = pd.read_csv(OUTDIR + "/dada2/stats/stats.csv", sep="\t", index_col=0)
dada2_stats.drop("#q2:types", inplace=True)
df.index = df.index.astype(str) # Force index as string even if "#q2:types" is missing
stats = pd.merge(stats, dada2_stats[["filtered", "denoised", "merged",
"non-chimeric"]], left_index=True, right_index=True)
stats = stats.astype(int)
except FileNotFoundError:
......
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