diff --git a/.travis.yml b/.travis.yml old mode 100644 new mode 100755 index 1adc3dd..68ac479 --- a/.travis.yml +++ b/.travis.yml @@ -12,5 +12,5 @@ deploy: file: build/libs/DamageProfiler-0.3.11.jar skip_cleanup: true on: - all_branches: true + branch: master repo: Integrative-Transcriptomics/DamageProfiler diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 index 65e4861..5ba763e --- a/README.md +++ b/README.md @@ -39,15 +39,14 @@ Shows this help page.\ The input sam/bam file.\ \ **-o,--output **\ -The output folder\ +The output folder.\ \ - Options **-l,--length **\ Number of bases which are computations.\ \ -**-mapped,--all_mapped_reads**\ -Use all mapped reads to calculate damage plots. Default: false.\ +**-merged,--all_mapped_and_merged_reads**\ +Use all mapped and merged reads to calculate damage plot instead of using all mapped reads. The SAM/BAM entry must start with 'M_', otherwise it will be skipped. Default: false\ \ **-r,--reference **\ The reference file\ diff --git a/arch-pkgbuild/PKGBUILD b/arch-pkgbuild/PKGBUILD old mode 100644 new mode 100755 diff --git a/arch-pkgbuild/starter.sh b/arch-pkgbuild/starter.sh old mode 100644 new mode 100755 diff --git a/arch-pkgbuild/updatePKGBuild.sh b/arch-pkgbuild/updatePKGBuild.sh old mode 100644 new mode 100755 diff --git a/build.gradle b/build.gradle old mode 100644 new mode 100755 index 066870e..971394b --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ group 'com.uni-tuebingen.de.it.eager.damageprofiler' -version '0.3.14' +version '0.4.5' buildscript { repositories { diff --git a/docs/Makefile b/docs/Makefile old mode 100644 new mode 100755 diff --git a/docs/conf.py b/docs/conf.py old mode 100644 new mode 100755 diff --git a/docs/contents/generalUsage.rst b/docs/contents/generalUsage.rst old mode 100644 new mode 100755 index a3c4d6a..101745b --- a/docs/contents/generalUsage.rst +++ b/docs/contents/generalUsage.rst @@ -18,7 +18,6 @@ How to run ---------- .. code-block:: bash - java -jar DamageProfiler-VERSION.jar [options] @@ -32,7 +31,7 @@ Options: * **-l,--length ** : Number of bases which are computations. * **-mapped,--all_mapped_reads** : Use all mapped reads to calculate damage plots. Default: false. - * **-r,--reference ** : The reference file. + * **-r,--reference ** : The reference file. The reference is only needed if the mapping file doesn't have MD tags. * **-s,--specie ** : RefSeq ID of the reference genome. This will just use the reads mapping to the specific reference for creating the damage profile. It can for example be used for MALT output files. In this case, please make sure that you run MALT without *--sparseSAM* option. This would create a sam file with is not readable. Example: -s NC_022116.1 * **-sf,--specieslist file ** : List with species (RefSeq IDs) for which damage profile has to be calculated. One species per line, given as text file (.txt). Species must have the same format like *-s* parameter. * **-t,--threshold ** : Number of bases which are considered for plotting nucleotide misincorporations. diff --git a/docs/contents/installation.rst b/docs/contents/installation.rst old mode 100644 new mode 100755 diff --git a/docs/index.rst b/docs/index.rst old mode 100644 new mode 100755 diff --git a/settings.gradle b/settings.gradle old mode 100644 new mode 100755 diff --git a/src/main/java/GUI/BamFileChooserFX.java b/src/main/java/GUI/BamFileChooserFX.java old mode 100644 new mode 100755 diff --git a/src/main/java/GUI/CopyTask.java b/src/main/java/GUI/CopyTask.java old mode 100644 new mode 100755 diff --git a/src/main/java/GUI/MainGuiFX.java b/src/main/java/GUI/MainGuiFX.java old mode 100644 new mode 100755 diff --git a/src/main/java/GUI/OutputDirChooserFX.java b/src/main/java/GUI/OutputDirChooserFX.java old mode 100644 new mode 100755 diff --git a/src/main/java/GUI/Progress.java b/src/main/java/GUI/Progress.java old mode 100644 new mode 100755 diff --git a/src/main/java/GUI/ReferenceFileChooserFX.java b/src/main/java/GUI/ReferenceFileChooserFX.java old mode 100644 new mode 100755 diff --git a/src/main/java/GUI/RescaleAdvanced.form b/src/main/java/GUI/RescaleAdvanced.form old mode 100644 new mode 100755 diff --git a/src/main/java/GUI/RescaleAdvanced.java b/src/main/java/GUI/RescaleAdvanced.java old mode 100644 new mode 100755 diff --git a/src/main/java/GUI/SpeciesListFileChooser.java b/src/main/java/GUI/SpeciesListFileChooser.java old mode 100644 new mode 100755 diff --git a/src/main/java/IO/Communicator.java b/src/main/java/IO/Communicator.java old mode 100644 new mode 100755 index 232a33f..cd40741 --- a/src/main/java/IO/Communicator.java +++ b/src/main/java/IO/Communicator.java @@ -13,9 +13,11 @@ public class Communicator { // damage calculation private int threshold = 25; + private double yAxis; private int length = 100; - private boolean use_merged_and_mapped_reads = true; + private boolean use_merged_and_mapped_reads = false; + private boolean use_all_reads = false; // specie filtering private String species_ref_identifier = null; @@ -24,26 +26,6 @@ public class Communicator { private String title_plots; -// -// // options recsaling -// private boolean perform_rescaling = false; -// -// private int rand = 30; // Number of random starting points for the likelihood optimization -// private int burn = 10000; // Number of burnin iterations -// private int adjust = 10; // Number of adjust proposal variance parameters iterations -// private int iter = 50000; // Number of final MCMC iterations -// private boolean forward = false; // Using only the 5' end of the seqs -// private boolean reverse = false; // Using only the 3' end of the seqs -// private boolean var_disp = false; // Variable dispersion in the overhangs -// private boolean jukes_cantor = false; // Use Jukes Cantor instead of HKY85 -// private boolean diff_hangs = false; // The overhangs are different for 5' and 3' -// private int nu_samples = 0; -// private boolean fix_nicks = false; // Fix the nick frequency vector (Only C.T from the 5' end and G.A from the 3' end) -// private boolean use_raw_nick_freq = false; // Use the raw nick frequency vector without smoothing -// private boolean single_stranded = false; // Single stranded protocol -// private int seq_length = 12; // how long sequence to use from each side -// private int minQual = 0; - public Communicator(){ @@ -105,6 +87,14 @@ public void setUse_merged_and_mapped_reads(boolean use_merged_and_mapped_reads) this.use_merged_and_mapped_reads = use_merged_and_mapped_reads; } + public boolean isUse_all_reads() { + return use_all_reads; + } + + public void setUse_all_reads(boolean use_all_reads) { + this.use_all_reads = use_all_reads; + } + public void setyAxis(double yAxis) { this.yAxis = yAxis; } @@ -130,134 +120,5 @@ public void setSpecieslist_filepath(String specieslist_filepath) { } -// public boolean isPerform_rescaling() { -// return perform_rescaling; -// } -// -// public void setPerform_rescaling(boolean perform_rescaling) { -// this.perform_rescaling = perform_rescaling; -// } -// -// -// public int getRand() { -// return rand; -// } -// -// public void setRand(int rand) { -// this.rand = rand; -// } -// -// public int getBurn() { -// return burn; -// } -// -// public void setBurn(int burn) { -// this.burn = burn; -// } -// -// public int getAdjust() { -// return adjust; -// } -// -// public void setAdjust(int adjust) { -// this.adjust = adjust; -// } -// -// public int getIter() { -// return iter; -// } -// -// public void setIter(int iter) { -// this.iter = iter; -// } -// -// public boolean isForward() { -// return forward; -// } -// -// public void setForward(boolean forward) { -// this.forward = forward; -// } -// -// public boolean isReverse() { -// return reverse; -// } -// -// public void setReverse(boolean reverse) { -// this.reverse = reverse; -// } -// -// public boolean isVar_disp() { -// return var_disp; -// } -// -// public void setVar_disp(boolean var_disp) { -// this.var_disp = var_disp; -// } -// -// public boolean isJukes_cantor() { -// return jukes_cantor; -// } -// -// public void setJukes_cantor(boolean jukes_cantor) { -// this.jukes_cantor = jukes_cantor; -// } -// -// public boolean isDiff_hangs() { -// return diff_hangs; -// } -// -// public void setDiff_hangs(boolean diff_hangs) { -// this.diff_hangs = diff_hangs; -// } -// -// public int getNu_samples() { -// return nu_samples; -// } -// -// public void setNu_samples(int nu_samples) { -// this.nu_samples = nu_samples; -// } -// -// public boolean isFix_nicks() { -// return fix_nicks; -// } -// -// public void setFix_nicks(boolean fix_nicks) { -// this.fix_nicks = fix_nicks; -// } -// -// public boolean isUse_raw_nick_freq() { -// return use_raw_nick_freq; -// } -// -// public void setUse_raw_nick_freq(boolean use_raw_nick_freq) { -// this.use_raw_nick_freq = use_raw_nick_freq; -// } -// -// public boolean isSingle_stranded() { -// return single_stranded; -// } -// -// public void setSingle_stranded(boolean single_stranded) { -// this.single_stranded = single_stranded; -// } -// -// public int getSeq_length() { -// return seq_length; -// } -// -// public void setSeq_length(int seq_length) { -// this.seq_length = seq_length; -// } -// -// public int getMinQual() { -// return minQual; -// } -// -// public void setMinQual(int minQual) { -// this.minQual = minQual; -// } - } diff --git a/src/main/java/IO/DOMParser.java b/src/main/java/IO/DOMParser.java old mode 100644 new mode 100755 diff --git a/src/main/java/IO/FastACacher.java b/src/main/java/IO/FastACacher.java old mode 100644 new mode 100755 diff --git a/src/main/java/IO/Histogram.java b/src/main/java/IO/Histogram.java old mode 100644 new mode 100755 diff --git a/src/main/java/IO/LinePlot.java b/src/main/java/IO/LinePlot.java old mode 100644 new mode 100755 diff --git a/src/main/java/IO/LogClass.java b/src/main/java/IO/LogClass.java old mode 100644 new mode 100755 diff --git a/src/main/java/IO/OutputGenerator.java b/src/main/java/IO/OutputGenerator.java old mode 100644 new mode 100755 diff --git a/src/main/java/IO/SpeciesListParser.java b/src/main/java/IO/SpeciesListParser.java old mode 100644 new mode 100755 diff --git a/src/main/java/IO/Unzip.java b/src/main/java/IO/Unzip.java old mode 100644 new mode 100755 diff --git a/src/main/java/IO/UserOptionsParser.java b/src/main/java/IO/UserOptionsParser.java old mode 100644 new mode 100755 index 2c9f6e9..f043805 --- a/src/main/java/IO/UserOptionsParser.java +++ b/src/main/java/IO/UserOptionsParser.java @@ -76,78 +76,14 @@ private void parse(){ .create("yaxis")); - Option mapped_and_merged = new Option("mapped", "all_mapped_reads", false, - "Use all mapped reads to calculate damage plots. Default: false "); + Option mapped_and_merged = new Option("merged", "all_mapped_and_merged_reads", false, + "Use all mapped and merged reads to calculate damage plot instead of using all mapped reads. The SAM/BAM entry must start with 'M_', otherwise " + + " it will be skipped. Default: false "); options.addOption(mapped_and_merged); - -// // recsaling options -// Option rescaling = new Option("rescale", "Rescaling_misincorporations", false, -// "Correct the damaged bases and generate new BAM file."); -// options.addOption(rescaling); -// options.addOption(OptionBuilder.withLongOpt("rand") -// .withArgName("RAND") -// .withDescription("Number of random starting points for the likelihood optimization") -// .hasArg() -// .create("rand")); -// options.addOption(OptionBuilder.withLongOpt("burn") -// .withArgName("BURN") -// .withDescription("Number of burnin iterations ") -// .hasArg() -// .create("burn")); -// options.addOption(OptionBuilder.withLongOpt("adjust") -// .withArgName("ADJUST") -// .withDescription("Number of adjust proposal variance parameters iterations.") -// .hasArg() -// .create("adjust")); -// options.addOption(OptionBuilder.withLongOpt("iter") -// .withArgName("Iterations") -// .withDescription("Number of final MCMC iterations") -// .hasArg() -// .create("iter")); -// options.addOption(OptionBuilder.withLongOpt("Q") -// .withArgName("MINQUALITY") -// .withDescription("Minimal base quality Phred score considered") -// .hasArg() -// .create("Q")); -// options.addOption(OptionBuilder.withLongOpt("seq_length") -// .withArgName("SEQ_LENGTH") -// .withDescription("How long sequence to use from each side by considering the damage probabilities. Default: 12") -// .hasArg() -// .create("seq_length")); -// -// Option only_forward = new Option("forward", "only_forward", false, -// "Using only forward reads (5' end). Default: false"); -// options.addOption(only_forward); -// -// Option only_reverse = new Option("reverse", "only_reverse", false, -// "Using only reverse reads (3' end). Default: false"); -// options.addOption(only_reverse); -// -// Option var_disp_opt = new Option("var_disp", "var_disp", false, -// "Variable dispersion in the overhangs . Default: false"); -// options.addOption(var_disp_opt); -// -// Option jukes_cantor_opt = new Option("jukes_cantor", "jukes_cantor", false, -// "Use Jukes Cantor transition matrix instead of HKY85. Default: false"); -// options.addOption(jukes_cantor_opt); -// -// Option diff_hangs_opt = new Option("diff_hangs", "diff_hangs", false, -// "The overhangs are different for 5' and 3'. Default: false"); -// options.addOption(diff_hangs_opt); -// -// Option fix_nicks_opt = new Option("fix_nicks", "fix_nicks", false, -// "Fix the nick frequency vector (Only C>T from the 5' end and G>A from the 3' end). Default: false"); -// options.addOption(fix_nicks_opt); -// -// Option use_raw_nick_freq_opt = new Option("use_raw_nick_freq", "use_raw_nick_freq", false, -// "Use the raw nick frequency vector without smoothing. Default: false"); -// options.addOption(use_raw_nick_freq_opt); -// -// Option single_stranded_opt = new Option("single_stranded", "single_stranded", false, -// "Use Single stranded protocol. Default: false"); -// options.addOption(single_stranded_opt); -// + Option use_all_reads = new Option("useall", "use_all_reads", false, + "Use all reads (mapped and unmapped) to calculate damage plot. Default: false "); + options.addOption(use_all_reads); HelpFormatter helpformatter = new HelpFormatter(); @@ -194,8 +130,12 @@ private void parse(){ if (cmd.hasOption('l')) { communicator.setLength(Integer.parseInt(cmd.getOptionValue('l'))); } - if(cmd.hasOption("all_mapped_reads")) { - communicator.setUse_merged_and_mapped_reads(false); + if(cmd.hasOption("all_mapped_and_merged_reads")) { + communicator.setUse_merged_and_mapped_reads(true); + } + + if(cmd.hasOption("use_all_reads")) { + communicator.setUse_all_reads(false); } // Plotting @@ -212,56 +152,6 @@ private void parse(){ communicator.setThreshold(Integer.parseInt(cmd.getOptionValue('t'))); } -// -// // options for rescaling -// -// if(cmd.hasOption("Rescaling_misincorporations")) { -// communicator.setPerform_rescaling(true); -// } -// -// if(cmd.hasOption("rand")) { -// communicator.setRand(Integer.parseInt(cmd.getOptionValue("rand"))); -// } -// if(cmd.hasOption("burn")) { -// communicator.setBurn(Integer.parseInt(cmd.getOptionValue("burn"))); -// } -// if(cmd.hasOption("adjust")) { -// communicator.setAdjust(Integer.parseInt(cmd.getOptionValue("adjust"))); -// } -// if(cmd.hasOption("iter")) { -// communicator.setIter(Integer.parseInt(cmd.getOptionValue("iter"))); -// } -// if(cmd.hasOption("only_forward")) { -// communicator.setForward(true); -// } -// if(cmd.hasOption("only_reverse")) { -// communicator.setReverse(true); -// } -// if(cmd.hasOption("var_disp")) { -// communicator.setVar_disp(true); -// } -// if(cmd.hasOption("jukes_cantor")) { -// communicator.setJukes_cantor(true); -// } -// if(cmd.hasOption("diff_hangs")) { -// communicator.setDiff_hangs(true); -// } -// if(cmd.hasOption("fix_nicks")) { -// communicator.setFix_nicks(true); -// } -// if(cmd.hasOption("use_raw_nick_freq")) { -// communicator.setUse_raw_nick_freq(true); -// } -// if(cmd.hasOption("single_stranded")) { -// communicator.setSingle_stranded(false); -// } -// if(cmd.hasOption("seq_length")) { -// communicator.setSeq_length(Integer.parseInt(cmd.getOptionValue("seq_length"))); -// } -// if(cmd.hasOption('Q')) { -// communicator.setMinQual(Integer.parseInt(cmd.getOptionValue('Q'))); -// } - } catch (ParseException e) { helpformatter.printHelp(CLASS_NAME, options); diff --git a/src/main/java/RunDamageProfiler.java b/src/main/java/RunDamageProfiler.java old mode 100644 new mode 100755 index 000c5c6..b4a980e --- a/src/main/java/RunDamageProfiler.java +++ b/src/main/java/RunDamageProfiler.java @@ -2,14 +2,13 @@ import IO.*; import calculations.StartCalculations; import javafx.application.Application; -import org.apache.log4j.Logger; /** * Created by neukamm on 06.10.2016. */ public class RunDamageProfiler { - private static final String VERSION = "0.3.14"; + private static final String VERSION = "0.4.5"; @SuppressWarnings("static-access") diff --git a/src/main/java/calculations/Aligner.java b/src/main/java/calculations/Aligner.java old mode 100644 new mode 100755 diff --git a/src/main/java/calculations/DamageProfiler.java b/src/main/java/calculations/DamageProfiler.java old mode 100644 new mode 100755 index 19ae5d9..1013301 --- a/src/main/java/calculations/DamageProfiler.java +++ b/src/main/java/calculations/DamageProfiler.java @@ -80,6 +80,7 @@ public void init(File input, File reference, int threshold, int length, String s } catch (Exception e){ System.err.println("Invalid SAM/BAM file. Please check your file."); LOG.error("Invalid SAM/BAM file. Please check your file."); + System.out.println(e.toString()); System.exit(0); } } @@ -92,54 +93,66 @@ public void init(File input, File reference, int threshold, int length, String s * * * @param use_only_merged_reads + * @param use_all_reads * @throws Exception */ - public void extractSAMRecords(boolean use_only_merged_reads) throws Exception{ + public void extractSAMRecords(boolean use_only_merged_reads, boolean use_all_reads) throws Exception{ + if(use_all_reads && use_only_merged_reads){ + LOG.info("-------------------"); + LOG.info("0 reads processed.\nRunning not possible. 'use_only_merged_reads' and 'use_all_reads' was set to 'true'"); + System.exit(0); - for(SAMRecord record : inputSam) { - if (this.specie == null) { - - numberOfAllReads++; - handleRecord(use_only_merged_reads, record); - - // print number of processed reads - if (numberOfUsedReads % 100 == 0) { - LOG.info(numberOfUsedReads + " Reads processed."); - } - - } else { + } else { + for(SAMRecord record : inputSam) { + if (this.specie == null) { - if (record.getReferenceName().contains(this.specie)) { numberOfAllReads++; - handleRecord(use_only_merged_reads, record); + handleRecord(use_only_merged_reads, use_all_reads, record); // print number of processed reads if (numberOfUsedReads % 100 == 0) { LOG.info(numberOfUsedReads + " Reads processed."); } + + } else { + + if (record.getReferenceName().contains(this.specie)) { + numberOfAllReads++; + handleRecord(use_only_merged_reads, use_all_reads, record); + + // print number of processed reads + if (numberOfUsedReads % 100 == 0) { + LOG.info(numberOfUsedReads + " Reads processed."); + } + } } } - } - frequencies.normalizeValues(); + frequencies.normalizeValues(); - LOG.info("-------------------"); - LOG.info("# reads used for damage calculation: " + (numberOfUsedReads )); + LOG.info("-------------------"); + LOG.info("# reads used for damage calculation: " + (numberOfUsedReads )); + } } - private void handleRecord(boolean use_only_merged_reads, SAMRecord record) throws Exception { - if (use_only_merged_reads) { - // get only mapped and merged reads + private void handleRecord(boolean use_only_merged_reads, boolean use_all_reads, SAMRecord record) throws Exception { + if(use_all_reads && !use_only_merged_reads){ + // process all reads + processRecord(record); + + } else if (use_only_merged_reads && !use_all_reads){ + // process only mapped and merged reads if (!record.getReadUnmappedFlag() && record.getReadName().startsWith("M_")) { processRecord(record); } - } else if (!record.getReadUnmappedFlag()) { - // get all mapped reads - processRecord(record); - } - + } else if(!use_only_merged_reads && !use_all_reads) + // process only mapped reads + if (!record.getReadUnmappedFlag()) { + // get all mapped reads + processRecord(record); + } } diff --git a/src/main/java/calculations/Frequencies.java b/src/main/java/calculations/Frequencies.java old mode 100644 new mode 100755 diff --git a/src/main/java/calculations/Functions.java b/src/main/java/calculations/Functions.java old mode 100644 new mode 100755 diff --git a/src/main/java/calculations/LengthDistribution.java b/src/main/java/calculations/LengthDistribution.java old mode 100644 new mode 100755 diff --git a/src/main/java/calculations/SpecieHandler.java b/src/main/java/calculations/SpecieHandler.java old mode 100644 new mode 100755 diff --git a/src/main/java/calculations/StartCalculations.java b/src/main/java/calculations/StartCalculations.java old mode 100644 new mode 100755 index 82b8d57..44d559b --- a/src/main/java/calculations/StartCalculations.java +++ b/src/main/java/calculations/StartCalculations.java @@ -34,6 +34,7 @@ public class StartCalculations { private String outfolder; private String input; private SpecieHandler specieHandler; + private boolean use_all_reads; public StartCalculations(String version){ VERSION = version; @@ -51,7 +52,8 @@ public void start(Communicator c) throws Exception { length = c.getLength(); threshold = c.getThreshold(); height = c.getyAxis(); - use_only_merged_reads = !c.isUse_merged_and_mapped_reads(); + use_only_merged_reads = c.isUse_merged_and_mapped_reads(); + use_all_reads = c.isUse_all_reads(); speciesListParser=null; species_name_list=null; specieHandler = new SpecieHandler(); @@ -74,12 +76,7 @@ parse species references (-sf) and run DP for each reference in the file String specie_input_string = specieslist.get(i); //String specie_name = species_real_name_list.get(i); - String inputfileNameWithOutExtension; - if (c.getTitle_plots() == null) { - inputfileNameWithOutExtension = input.substring(0, input.lastIndexOf('.')); - } else { - inputfileNameWithOutExtension = c.getTitle_plots(); - } + // start DamageProfiler File file = new File(input); @@ -88,11 +85,22 @@ parse species references (-sf) and run DP for each reference in the file String ref = specie_input_string.split("\\|")[0].trim(); String speciesname = damageProfiler.getSpeciesname(file, ref); + + String inputfileNameWithOutExtension = input.substring(0, input.lastIndexOf('.')); String output_folder = createOutputFolder( outfolder, inputfileNameWithOutExtension.split("/")[inputfileNameWithOutExtension.split("/").length - 1] + File.separator + ref + "_" + speciesname); + + if (c.getTitle_plots() == null) { + inputfileNameWithOutExtension = input.substring(0, input.lastIndexOf('.')); + } else { + inputfileNameWithOutExtension = c.getTitle_plots(); + } + + + // init Logger logClass = new LogClass(); logClass.updateLog4jConfiguration(output_folder + "/DamageProfiler_" + ref + "_" + speciesname +".log"); @@ -130,7 +138,7 @@ parse species references (-sf) and run DP for each reference in the file specie_input_string, LOG); - damageProfiler.extractSAMRecords(use_only_merged_reads); + damageProfiler.extractSAMRecords(use_only_merged_reads, use_all_reads); generateOutput(damageProfiler, output_folder, inputfileNameWithOutExtension, speciesname); } @@ -146,16 +154,20 @@ parse species reference (-s) and run DP specieslist.add(species_ref_identifier); //species_real_name_list.add(speciesListParser.getSingleSpecie(species_ref_identifier)); - String inputfileNameWithOutExtension; + String inputfileNameWithOutExtension = input.substring(0, input.lastIndexOf('.')); + + String output_folder = createOutputFolder( + outfolder, + inputfileNameWithOutExtension.split("/")[inputfileNameWithOutExtension.split("/").length - 1]); + + if (c.getTitle_plots() == null) { inputfileNameWithOutExtension = input.substring(0, input.lastIndexOf('.')); - } else { + } + else { inputfileNameWithOutExtension = c.getTitle_plots(); } - String output_folder = createOutputFolder( - outfolder, - inputfileNameWithOutExtension.split("/")[inputfileNameWithOutExtension.split("/").length - 1]); // init Logger @@ -198,7 +210,7 @@ parse species reference (-s) and run DP null, LOG); - damageProfiler.extractSAMRecords(use_only_merged_reads); + damageProfiler.extractSAMRecords(use_only_merged_reads, use_all_reads); speciesListParser.setLOG(LOG); generateOutput(damageProfiler,output_folder, inputfileNameWithOutExtension, null); @@ -207,16 +219,18 @@ parse species reference (-s) and run DP /* No species specified --> use all (mapping) reads */ - String inputfileNameWithOutExtension; + String inputfileNameWithOutExtension = input.substring(0, input.lastIndexOf('.')); + + String output_folder = createOutputFolder( + outfolder, + inputfileNameWithOutExtension.split("/")[inputfileNameWithOutExtension.split("/").length - 1]); + if (c.getTitle_plots() == null) { inputfileNameWithOutExtension = input.substring(0, input.lastIndexOf('.')); } else { inputfileNameWithOutExtension = c.getTitle_plots(); } - String output_folder = createOutputFolder( - outfolder, - inputfileNameWithOutExtension.split("/")[inputfileNameWithOutExtension.split("/").length - 1]); // init Logger logClass = new LogClass(); logClass.updateLog4jConfiguration(output_folder + "/DamageProfiler.log"); @@ -254,7 +268,7 @@ parse species reference (-s) and run DP length, null, LOG); - damageProfiler.extractSAMRecords(use_only_merged_reads); + damageProfiler.extractSAMRecords(use_only_merged_reads, use_all_reads); speciesListParser.setLOG(LOG); diff --git a/src/main/main.iml b/src/main/main.iml deleted file mode 100644 index c2f069d..0000000 --- a/src/main/main.iml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/logger/logger.properties b/src/main/resources/logger/logger.properties old mode 100644 new mode 100755