Commit aaa5c701 authored by peguerin's avatar peguerin
Browse files

fix custombdr config

parent fd71f81a
......@@ -274,13 +274,13 @@ else:
dfpmr['fasta'] = dfpmr['marker'].map(config["assign_taxon"]["fasta"])
## also perform taxonomic assignment with custom reference database
if config['custom_bdr']['status']:
if config['custom_baseref']:
print("also perform taxonomic assignment with custom reference database")
for crmarker in config['custom_bdr']['bdr'].keys():
for crmarker in config['assign_customtax']['bdr'].keys():
print(crmarker)
df_crmarker = dfpmr[(dfpmr.marker == crmarker)].copy()
df_crmarker['bdr'] = config['custom_bdr']['bdr'][crmarker]
df_crmarker['fasta'] = config['custom_bdr']['fasta'][crmarker]
df_crmarker['bdr'] = config['assign_customtax']['bdr'][crmarker]
df_crmarker['fasta'] = config['assign_customtax']['fasta'][crmarker]
df_crmarker['projmarkrun'] = df_crmarker['projmarkrun'].astype(str) + '_custom'
dfpmr = pandas.concat([dfpmr, df_crmarker], ignore_index=True)
customprojmarkrun = dfpmr[dfpmr['projmarkrun'].str.contains('_custom')]['projmarkrun']
......@@ -371,7 +371,7 @@ rule flag_filtering_done:
touch('results/00_flags/filtering.flag')
if config['custom_bdr']['status']:
if config['custom_baseref']:
rule custom_bdr_cat_samples_into_runs:
input:
'results/00_flags/filtering.flag'
......@@ -396,7 +396,7 @@ else:
'''
include: "rules/dereplicate_runs.smk"
if config['custom_bdr']['status']:
if config['custom_baseref']:
include: "rules/custom_taxonomic_assignment.smk"
else:
include: "rules/taxonomic_assignment.smk"
......@@ -418,7 +418,10 @@ rule flag_table_assigned_sequences:
thisMarker = pmr.split('/')[1]
thisRun = pmr.split('/')[2]
tableNameFile = "results/18_table_assigned_sequences/"+pmr+".csv"
newTableNameFile = "results/"+thisProjet+"_"+thisMarker+"_"+thisRun+"_ecotag_ncbi.csv"
if "custom" in thisRun:
newTableNameFile = "results/"+thisProjet+"_"+thisMarker+"_"+thisRun+"_ecotag.csv"
else:
newTableNameFile = "results/"+thisProjet+"_"+thisMarker+"_"+thisRun+"_ncbi_ecotag.csv"
print(thisProjet+"_"+thisMarker+"_"+thisRun+", ", end='')
os.system("cp {0} {1}".format(tableNameFile, newTableNameFile))
print("done")
......
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