Commit 6c2870fd authored by Maria Bernard's avatar Maria Bernard
Browse files

ustakcs dev

parent 3af9948e
......@@ -32,11 +32,17 @@ from ng6.utils import Utils
class Ustacks (Analysis):
def define_parameters(self, read1_files, min_cov=3, primary_mismatch=2, secondary_mismatch=4):
def define_parameters(self, read1_files, min_cov=3, primary_mismatch=2, secondary_mismatch=4, max_locus=4, model_type="snp", alpha=0.05, bound_low=0, bound_high=1, bc_err_freq):
self.read1_files = InputFileList(read1_files, Formats.FASTQ)
self.min_cov = min_cov
self.primary_mismatch = primary_mismatch
self.secondary_mismatch = secondary_mismatch
self.max_locus = max_locus
self.model_type = model_type
self.alpha = alpha
self.bound_low = bound_low
self.bound_high = bound_high
self.bc_err_freq = bc_err_freq
self.tags = OutputFileList(self.get_outputs('{basename_woext}.tags.tsv', self.read1_files))
self.alleles = OutputFileList(self.get_outputs('{basename_woext}.alleles.tsv', self.read1_files))
self.snps = OutputFileList(self.get_outputs('{basename_woext}.snps.tsv', self.read1_files))
......@@ -46,8 +52,19 @@ class Ustacks (Analysis):
self.name = "ustacks"
self.description = "Locus prediction per individus"
self.software = "ustacks"
self.options = "-m " + str(self.min_cov) + " -M " + str(self.primary_mismatch) + " -N " + str(self.secondary_mismatch)
self.options = "-m " + str(self.min_cov) + " -M " + str(self.primary_mismatch) + " -N " + str(self.secondary_mismatch) + \
" --max_locus_stacks " + str(self.max_locus) + " -r -d -t gzfastq --model_type " + self.model_type
if self.model_type=="snp" or self.model_type=="bounded" :
self.options+= " --alpha " + self.alpha
if self.model_type == "bounded" :
self.options+= " --bound_low " + self.bound_low + " --bound_high " + self.bound_high
if self.model_type == "fixed" :
self.options+= " --bc_err_freq " + self.bc_err_freq
def post_process(self):
# Parse stderr
nb_tot, nb_used = 0, 0
......@@ -136,6 +153,10 @@ class Ustacks (Analysis):
def process(self):
for i, input in enumerate(self.read1_files):
indiv = os.path.splitext(os.path.basename(input))[0] if os.path.splitext(os.path.basename(input))[1] != ".gz" else os.path.splitext(os.path.splitext(os.path.basename(input))[0])[0]
### comment on accede au paramtre de
id=self.indiv_id_dic[indiv]
ustacks = ShellFunction(self.get_exec_path("ustacks") + " -t fastq -f $1 -d -r -o " + self.output_directory + " -i " + str(i) + \
" -m " + str(self.min_cov) + " -M " + str(self.primary_mismatch) + " -N " + str(self.secondary_mismatch) + \
" 2> $2", cmd_format='{EXE} {IN} {OUT}')
......
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