From 8912e43c46f4bdccd316f3b72ac2799557311596 Mon Sep 17 00:00:00 2001 From: Thomas Krannich <krannich479@googlemail.com> Date: Thu, 10 Mar 2022 12:22:17 +0100 Subject: [PATCH] crop-unmapped with even more flexibility of the input parameters, se, pe1, pe2 --- Makefile | 2 +- src/argument_parsing.h | 22 ++++++++++++++++++++++ src/popins2_crop_unmapped.h | 9 ++++++--- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 218f6c5..b5e8591 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,7 @@ TOOLS=-DSAMTOOLS=\"$(SAMTOOLS)\" -DBWA=\"$(BWA)\" -DSICKLE=\"$(SICKLE)\" -DVELVE # Date and version number from git DATE := on $(shell git log --pretty=format:"%cd" --date=iso | cut -f 1,2 -d " " | head -n 1) -VERSION := 0.0.3-snake-$(shell git log --pretty=format:"%h" --date=iso | head -n 1) +VERSION := 0.0.4-snake-$(shell git log --pretty=format:"%h" --date=iso | head -n 1) CXXFLAGS += -DDATE=\""$(DATE)"\" -DVERSION=\""$(VERSION)"\" # Compiler flags diff --git a/src/argument_parsing.h b/src/argument_parsing.h index 87a38d7..e03cf5d 100644 --- a/src/argument_parsing.h +++ b/src/argument_parsing.h @@ -58,6 +58,9 @@ struct AssemblyOptions { struct CropUnmappedOptions { CharString outputFile; + CharString pe1; + CharString pe2; + CharString se; CharString mappingFile; CharString matepairFile; @@ -79,6 +82,9 @@ struct CropUnmappedOptions { CropUnmappedOptions () : outputFile("mates.bam"), + pe1("paired.1.fastq"), + pe2("paired.2.fastq"), + se("single.fastq"), matepairFile(""), referenceFile(""), prefix("."), @@ -366,6 +372,13 @@ bool getOptionValues(CropUnmappedOptions & options, ArgumentParser const & parse if (isSet(parser, "output")) getOptionValue(options.outputFile, parser, "output"); + if (isSet(parser, "paired1")) + getOptionValue(options.pe1, parser, "paired1"); + if (isSet(parser, "paired2")) + getOptionValue(options.pe2, parser, "paired2"); + if (isSet(parser, "single")) + getOptionValue(options.se, parser, "single"); + if (isSet(parser, "prefix")) getOptionValue(options.prefix, parser, "prefix"); if (isSet(parser, "sample")) @@ -828,6 +841,9 @@ void setupParser(ArgumentParser & parser, CropUnmappedOptions & options){ // Setup the options. addSection(parser, "Input/output options"); addOption(parser, ArgParseOption("o", "output", "File name for the output BAM file.", ArgParseArgument::OUTPUT_FILE, "BAM FILE")); + addOption(parser, ArgParseOption("pe1", "paired1", "File name for the first reads file.", ArgParseArgument::INPUT_FILE, "FASTQ FILE")); + addOption(parser, ArgParseOption("pe2", "paired2", "File name for the second reads file.", ArgParseArgument::INPUT_FILE, "FASTQ FILE")); + addOption(parser, ArgParseOption("se", "single", "File name for the single reads file.", ArgParseArgument::INPUT_FILE, "FASTQ FILE")); addOption(parser, ArgParseOption("p", "prefix", "Path to the sample directories.", ArgParseArgument::STRING, "PATH")); addOption(parser, ArgParseOption("s", "sample", "An ID for the sample.", ArgParseArgument::STRING, "SAMPLE_ID")); addOption(parser, ArgParseOption("mp", "matePair", "(Currently only available for Velvet.)", ArgParseArgument::INPUT_FILE, "BAM FILE")); @@ -848,6 +864,12 @@ void setupParser(ArgumentParser & parser, CropUnmappedOptions & options){ setValidValues(parser, "adapters", "HiSeq HiSeqX"); setValidValues(parser, "reference", "fa fna fasta gz"); setDefaultValue(parser, "output", options.outputFile); + setDefaultValue(parser, "paired1", options.pe1); + setValidValues(parser, "paired1", "fq fastq gz"); + setDefaultValue(parser, "paired2", options.pe2); + setValidValues(parser, "paired2", "fq fastq gz"); + setDefaultValue(parser, "single", options.se); + setValidValues(parser, "single", "fq fastq gz"); setDefaultValue(parser, "prefix", "\'.\'"); setDefaultValue(parser, "sample", "retrieval from BAM file header"); setDefaultValue(parser, "kmerLength", options.kmerLength); diff --git a/src/popins2_crop_unmapped.h b/src/popins2_crop_unmapped.h index 7c7a940..c972551 100644 --- a/src/popins2_crop_unmapped.h +++ b/src/popins2_crop_unmapped.h @@ -75,9 +75,12 @@ int popins2_crop_unmapped(int argc, char const ** argv){ //CharString matesBam = getFileName(workingDirectory, "mates.bam"); CharString matesBam = getFileName(workingDirectory, options.outputFile); - CharString fastqFirst = getFileName(workingDirectory, "paired.1.fastq"); - CharString fastqSecond = getFileName(workingDirectory, "paired.2.fastq"); - CharString fastqSingle = getFileName(workingDirectory, "single.fastq"); + //CharString fastqFirst = getFileName(workingDirectory, "paired.1.fastq"); + //CharString fastqSecond = getFileName(workingDirectory, "paired.2.fastq"); + //CharString fastqSingle = getFileName(workingDirectory, "single.fastq"); + CharString fastqFirst = getFileName(workingDirectory, options.pe1); + CharString fastqSecond = getFileName(workingDirectory, options.pe2); + CharString fastqSingle = getFileName(workingDirectory, options.se); Triple<CharString> fastqFiles = Triple<CharString>(fastqFirst, fastqSecond, fastqSingle); -- GitLab