Commit 9d16df4c authored by Jan Hoeckesfeld's avatar Jan Hoeckesfeld
Browse files

added iterset option to rule calcLikelihoods

parent 43c43755
......@@ -89,6 +89,8 @@ deviationCutoff : 2.5
#This applies to the methods: COV and EUC, the method GEN is unaffected by this
skipMapping: False
plot_top3_fit : False
#choose the iterationset either O, V, OuV (O union V) or OnV (O intersect V)
itersetType : O
###Blast Parameter
blast_word_size : 4
......@@ -96,6 +98,3 @@ blast_word_size_hypProtA : 11
blast_e_value : 1.0e-40
blast_e_value_hypProtA : 1.0e-50
### Choose Iterationset to determine likelihoods
iterationset : observation
......@@ -7,15 +7,6 @@ def determineKmerCoverageEstimateFile():
elif config['kmerCoverageEstimationMethod'] == 'countPoisson':
return 'data/auxiliary/'+config['input_folder']+'/kmers/{kmer}/{id}/coverage_estimate_kmercountbased.txt'
# TODO: will need arg spatyp later
def determineIterationset():
if config['iterationset'] == 'observation':
return 'data/auxiliary/'+config['input_folder']+'/kmers/{kmer}/{id}/alignment.counts.json'
elif config['iterationset'] == 'spatype':
return '?'
elif config['iterationset'] == 'database':
return '?'
# Returns the corresponding ground truth spa-type for a given file (sample) id
def getGroundTruthType(fid):
with open('data/input/groundTruth.tsv','r') as gtfile:
......
......@@ -64,7 +64,6 @@ rule calcLikelihoods:
input:
expected = 'data/auxiliary/'+config['input_folder']+'/kmers/{kmer}/{id}/expected_counts.json',
observed = 'data/auxiliary/'+config['input_folder']+'/kmers/{kmer}/{id}/alignment.counts.json',
#iterationset = determineIterationset({id}}),
kmerError = 'data/auxiliary/'+config['input_folder']+'/kmers/{kmer}/{id}/kmer_error.txt',
kmerCoverageEstimate = determineKmerCoverageEstimateFile()
output:
......@@ -78,6 +77,7 @@ rule calcLikelihoods:
params:
e = (lambda wildcards,input : extractTsvValue(input.kmerError,0)),
deviationCutoff = (lambda wildcards,input : round(config['deviationCutoff']*extractCoverageEstimateFile(input.kmerCoverageEstimate,config))),
itersetType = config['itersetType'],
#cluster exectuion
cpus = '1',
mem = '4G',
......@@ -86,7 +86,7 @@ rule calcLikelihoods:
singularity:
'docker://phspo/ckmertools:latest'
shell:
'c_kmertools --e {input.expected} --c {params.cpus} --m 0 --o {input.observed} --kmererror {params.e} --d {params.deviationCutoff} --target {output.likelihoods} --unexpected {output.unexpectedLikelihoods} --log {log}'
'c_kmertools --e {input.expected} --c {params.cpus} --m 0 --o {input.observed} --kmererror {params.e} --d {params.deviationCutoff} --target {output.likelihoods} --unexpected {output.unexpectedLikelihoods} --log {log} --itersetType {params.itersetType}'
rule calcLikelihoods_Generative:
......
Supports Markdown
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