Skip to content
Snippets Groups Projects
Commit 767f84e9 authored by Floreal Cabanettes's avatar Floreal Cabanettes
Browse files

Add threads for pirs

parent f030a6d0
No related branches found
No related tags found
No related merge requests found
......@@ -38,6 +38,7 @@ def parse_args():
type=int, default=30)
parser.add_argument("-q", "--quiet", help="Don't ask anything, choose default answer instead", action="store_const",
const=True, default=False)
parser.add_argument("-t", "--threads", help="Number of threads", default=4)
args = parser.parse_args()
return args
......@@ -260,7 +261,7 @@ def build_fastas_chromosomes(reference, genotypes_for_inds, haploid, output_dir)
def generate_samples_fastq(haploid, nb_inds, output_dir, coverage, read_len, insert_len_mean, insert_len_sd,
prg_path):
prg_path, threads):
print("GENERATE RANDOM READS FOR EACH INDIVIDUAL FROM GENOME...\n")
......@@ -268,21 +269,21 @@ def generate_samples_fastq(haploid, nb_inds, output_dir, coverage, read_len, ins
if not haploid:
cmd = str("{4}pirs/pirs simulate -z -x {3} -d -B {4}pirs/Profiles/Base-Calling_Profiles/humNew.PE100.matrix.gz "
"-I {4}pirs/Profiles/InDel_Profiles/phixv2.InDel.matrix -l {5} -m {6} -v {7} "
"-G {4}pirs/Profiles/GC-depth_Profiles/humNew.gcdep_100.dat -o {0} {1} {2}")
"-G {4}pirs/Profiles/GC-depth_Profiles/humNew.gcdep_100.dat -o {0} -t {8} {1} {2}")
else:
cmd = str("{4}pirs/pirs simulate -z -x {3} -B {4}pirs/Profiles/Base-Calling_Profiles/humNew.PE100.matrix.gz "
"-I {4}pirs/Profiles/InDel_Profiles/phixv2.InDel.matrix -l {5} -m {6} -v {7} "
"-G {4}pirs/Profiles/GC-depth_Profiles/humNew.gcdep_100.dat -o {0} {1}")
"-G {4}pirs/Profiles/GC-depth_Profiles/humNew.gcdep_100.dat -o {0} -t {8} {1}")
for i in range(1, nb_inds+1):
prefix = os.path.join(output_dir, "INDIV_" + str(i))
chr0 = prefix + "_chr_0.fasta"
chr1 = prefix + "_chr_1.fasta"
if not haploid:
os.system(cmd.format(prefix, chr0, chr1, coverage, prg_path + os.path.sep, read_len,
insert_len_mean, insert_len_sd))
insert_len_mean, insert_len_sd, threads))
else:
os.system(cmd.format(prefix, chr0, "", coverage, prg_path + os.path.sep, read_len,
insert_len_mean, insert_len_sd))
insert_len_mean, insert_len_sd, threads))
def confirm(deletions: dict):
......@@ -336,7 +337,7 @@ def main():
tmp_dir, prg_path)
build_fastas_chromosomes(reference, genotypes_for_inds, haploid, output_dir)
generate_samples_fastq(haploid, nb_inds, output_dir, args.coverage, args.read_len, args.insert_len_mean,
args.insert_len_sd, prg_path)
args.insert_len_sd, prg_path, args.threads)
print("DONE!\n")
else:
print("Aborted!\n")
......
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