polish: change / to buildPath for RGBEPP_refmix

This commit is contained in:
kuoi 2025-02-09 18:11:05 +11:00
parent 5137357012
commit a09fd55086

View file

@ -288,7 +288,7 @@ void processMapping(string[] ARG_L, string ARG_R, int ARG_T, string DirQcTrim, s
// Prepare directory // Prepare directory
createDir(DirMap); createDir(DirMap);
createDir(DirMap ~ "/index"); createDir(buildPath(DirMap, "index"));
string PathBowtie2_build = PathBowtie2 ~ "-build"; string PathBowtie2_build = PathBowtie2 ~ "-build";
string[] Refs = getRef(ARG_R, DirMap); string[] Refs = getRef(ARG_R, DirMap);
string ARG_R_index = Refs[0]; // bt2_index_base string ARG_R_index = Refs[0]; // bt2_index_base
@ -301,9 +301,9 @@ void processMapping(string[] ARG_L, string ARG_R, int ARG_T, string DirQcTrim, s
foreach (string file; ARG_L) { foreach (string file; ARG_L) {
string baseName = baseName(file, ".fastq.gz"); string baseName = baseName(file, ".fastq.gz");
string outputBam = DirMap ~ "/" ~ baseName ~ ".bam"; string outputBam = buildPath(DirMap, baseName ~ ".bam");
string inputFileR1 = DirQcTrim ~ "/" ~ baseName ~ "_R1.fastq.gz"; string inputFileR1 = buildPath(DirQcTrim, baseName ~ "_R1.fastq.gz");
string inputFileR2 = DirQcTrim ~ "/" ~ baseName ~ "_R2.fastq.gz"; string inputFileR2 = buildPath(DirQcTrim, baseName ~ "_R2.fastq.gz");
// Perform mapping using Bowtie2 and converted to Bam using samtools // Perform mapping using Bowtie2 and converted to Bam using samtools
string[] cmdMap = [PathBowtie2, "-x", ARG_R_index, "-1", inputFileR1, "-2", inputFileR2, string[] cmdMap = [PathBowtie2, "-x", ARG_R_index, "-1", inputFileR1, "-2", inputFileR2,
@ -390,8 +390,8 @@ void processVarCall(string[] ARG_L, string ARG_R, int ARG_T, string DirMap, stri
foreach (string file; parallel(ARG_L, 1)) { foreach (string file; parallel(ARG_L, 1)) {
string baseName = getBaseName(file); string baseName = getBaseName(file);
string inputBam = DirBam ~ "/" ~ baseName ~ ".bam"; string inputBam = buildPath(DirBam, baseName ~ ".bam");
string outputVcf = DirVcf ~ "/" ~ baseName ~ ".vcf.gz"; string outputVcf = buildPath(DirVcf, baseName ~ ".vcf.gz");
// Variant calling using bcftools // Variant calling using bcftools
string[] cmdPileup = [PathBcftools, "mpileup", "-Oz", "--threads", ARG_T.to!string, "-f", ARG_R_refer, inputBam]; string[] cmdPileup = [PathBcftools, "mpileup", "-Oz", "--threads", ARG_T.to!string, "-f", ARG_R_refer, inputBam];
@ -431,7 +431,7 @@ void processVarCallDenovo(string[] ARG_L, int ARG_T, string DirAssembly, string
void processCon(string[] ARG_G, string[] ARG_L, string ARG_R, int ARG_T, string DirMap, string DirVcf, string DirConsensus, string PathBcftools) { void processCon(string[] ARG_G, string[] ARG_L, string ARG_R, int ARG_T, string DirMap, string DirVcf, string DirConsensus, string PathBcftools) {
createDir(DirConsensus); createDir(DirConsensus);
string DirConTaxa = DirConsensus ~ "/" ~ "taxa"; string DirConTaxa = buildPath(DirConsensus, "taxa");
createDir(DirConTaxa); createDir(DirConTaxa);
@ -442,8 +442,8 @@ void processCon(string[] ARG_G, string[] ARG_L, string ARG_R, int ARG_T, string
// Extract fasta from vcf file // Extract fasta from vcf file
foreach (string file; ARG_L) { foreach (string file; ARG_L) {
string baseName = getBaseName(file); string baseName = getBaseName(file);
string inputVcf = DirVcf ~ "/" ~ baseName ~ ".vcf.gz"; string inputVcf = buildPath(DirVcf, baseName ~ ".vcf.gz");
string outputFasta = DirConTaxa ~ "/" ~ baseName ~ ".fasta"; string outputFasta = buildPath(DirConTaxa, baseName ~ ".fasta");
// index vcf.gz // index vcf.gz
string[] cmdIndexVcf = [PathBcftools, "index", inputVcf]; string[] cmdIndexVcf = [PathBcftools, "index", inputVcf];