[med-svn] [Git][med-team/fastp][upstream] New upstream version 0.20.1+dfsg

Dylan Aïssi gitlab at salsa.debian.org
Sat Apr 11 21:16:43 BST 2020



Dylan Aïssi pushed to branch upstream at Debian Med / fastp


Commits:
fcc688de by Dylan Aïssi at 2020-04-11T22:14:24+02:00
New upstream version 0.20.1+dfsg
- - - - -


10 changed files:

- README.md
- src/common.h
- src/htmlreporter.cpp
- src/main.cpp
- src/options.cpp
- src/options.h
- src/peprocessor.cpp
- src/read.cpp
- src/read.h
- src/seprocessor.cpp


Changes:

=====================================
README.md
=====================================
@@ -304,7 +304,7 @@ options:
   -I, --in2                          read2 input file name (string [=])
   -O, --out2                           read2 output file name (string [=])
       --unpaired1                      for PE input, if read1 passed QC but read2 not, it will be written to unpaired1. Default is to discard it. (string [=])
-      --unpaired2                      for PE input, if read2 passed QC but read1 not, it will be written to unpaired2. If --unpaired2 is same as --umpaired1 (default mode), both unpaired reads will be written to this same file. (string [=])
+      --unpaired2                      for PE input, if read2 passed QC but read1 not, it will be written to unpaired2. If --unpaired2 is same as --unpaired1 (default mode), both unpaired reads will be written to this same file. (string [=])
       --failed_out                     specify the file to store reads that cannot pass the filters. (string [=])
   -m, --merge                          for paired-end input, merge each pair of reads into a single read if they are overlapped. The merged reads will be written to the file given by --merged_out, the unmerged reads will be written to the files specified by --out1 and --out2. The merging mode is disabled by default.
       --merged_out                     in the merging mode, specify the file name to store merged output, or specify --stdout to stream the merged output (string [=])
@@ -316,6 +316,7 @@ options:
       --interleaved_in                 indicate that <in1> is an interleaved FASTQ which contains both read1 and read2. Disabled by default.
       --reads_to_process             specify how many reads/pairs to be processed. Default 0 means process all reads. (int [=0])
       --dont_overwrite               don't overwrite existing files. Overwritting is allowed by default.
+      --fix_mgi_id                     the MGI FASTQ ID format is not compatible with many BAM operation tools, enable this option to fix it.
   
   # adapter trimming options
   -A, --disable_adapter_trimming     adapter trimming is enabled by default. If this option is specified, adapter trimming is disabled


=====================================
src/common.h
=====================================
@@ -1,7 +1,7 @@
 #ifndef COMMON_H
 #define COMMON_H
 
-#define FASTP_VER "0.20.0"
+#define FASTP_VER "0.20.1"
 
 #define _DEBUG false
 


=====================================
src/htmlreporter.cpp
=====================================
@@ -406,7 +406,7 @@ void HtmlReporter::printCSS(ofstream& ofs){
 }
 
 void HtmlReporter::printJS(ofstream& ofs){
-    ofs << "<script src='https://cdn.plot.ly/plotly-latest.min.js'></script>" << endl;
+    ofs << "<script src='http://opengene.org/plotly-1.2.0.min.js'></script>" << endl;
     ofs << "\n<script type=\"text/javascript\">" << endl;
     ofs << "    function showOrHide(divname) {" << endl;
     ofs << "        div = document.getElementById(divname);" << endl;


=====================================
src/main.cpp
=====================================
@@ -36,7 +36,7 @@ int main(int argc, char* argv[]){
     cmd.add<string>("in2", 'I', "read2 input file name", false, "");
     cmd.add<string>("out2", 'O', "read2 output file name", false, "");
     cmd.add<string>("unpaired1", 0, "for PE input, if read1 passed QC but read2 not, it will be written to unpaired1. Default is to discard it.", false, "");
-    cmd.add<string>("unpaired2", 0, "for PE input, if read2 passed QC but read1 not, it will be written to unpaired2. If --unpaired2 is same as --umpaired1 (default mode), both unpaired reads will be written to this same file.", false, "");
+    cmd.add<string>("unpaired2", 0, "for PE input, if read2 passed QC but read1 not, it will be written to unpaired2. If --unpaired2 is same as --unpaired1 (default mode), both unpaired reads will be written to this same file.", false, "");
     cmd.add<string>("failed_out", 0, "specify the file to store reads that cannot pass the filters.", false, "");
     cmd.add("merge", 'm', "for paired-end input, merge each pair of reads into a single read if they are overlapped. The merged reads will be written to the file given by --merged_out, the unmerged reads will be written to the files specified by --out1 and --out2. The merging mode is disabled by default.");
     cmd.add<string>("merged_out", 0, "in the merging mode, specify the file name to store merged output, or specify --stdout to stream the merged output", false, "");
@@ -48,6 +48,7 @@ int main(int argc, char* argv[]){
     cmd.add("interleaved_in", 0, "indicate that <in1> is an interleaved FASTQ which contains both read1 and read2. Disabled by default.");
     cmd.add<int>("reads_to_process", 0, "specify how many reads/pairs to be processed. Default 0 means process all reads.", false, 0);
     cmd.add("dont_overwrite", 0, "don't overwrite existing files. Overwritting is allowed by default.");
+    cmd.add("fix_mgi_id", 0, "the MGI FASTQ ID format is not compatible with many BAM operation tools, enable this option to fix it.");
     cmd.add("verbose", 'V', "output verbose log information (i.e. when every 1M reads are processed).");
 
     // adapter
@@ -177,6 +178,7 @@ int main(int argc, char* argv[]){
     opt.outputToSTDOUT = cmd.exist("stdout");
     opt.interleavedInput = cmd.exist("interleaved_in");
     opt.verbose = cmd.exist("verbose");
+    opt.fixMGI = cmd.exist("fix_mgi_id");
 
     // merge PE
     opt.merge.enabled = cmd.exist("merge");


=====================================
src/options.cpp
=====================================
@@ -26,6 +26,7 @@ Options::Options(){
     verbose = false;
     seqLen1 = 151;
     seqLen2 = 151;
+    fixMGI = false;
 }
 
 void Options::init() {


=====================================
src/options.h
=====================================
@@ -325,6 +325,8 @@ public:
     bool interleavedInput;
     // only process first N reads
     int readsToProcess;
+    // fix the MGI ID tailing issue
+    bool fixMGI;
     // worker thread number
     int thread;
     // trimming options


=====================================
src/peprocessor.cpp
=====================================
@@ -338,6 +338,11 @@ bool PairEndProcessor::processPairEnd(ReadPairPack* pack, ThreadConfig* config){
             continue;
         }
 
+        // fix MGI
+        if(mOptions->fixMGI) {
+            or1->fixMGI();
+            or2->fixMGI();
+        }
         // umi processing
         if(mOptions->umi.enabled)
             mUmiProcessor->process(or1, or2);


=====================================
src/read.cpp
=====================================
@@ -135,6 +135,17 @@ string Read::toStringWithTag(string tag) {
 	return mName + " " + tag + "\n" + mSeq.mStr + "\n" + mStrand + "\n" + mQuality + "\n";
 }
 
+bool Read::fixMGI() {
+	int len = mName.length();
+	if(mName[len-1]=='1' || mName[len-1]=='2') {
+		if(mName[len-2] == '/') {
+			mName = mName.substr(0, len-2) + " " + mName.substr(len-2, 2);
+			return true;
+		}
+	}
+	return false;
+}
+
 bool Read::test(){
 	Read r("@NS500713:64:HFKJJBGXY:1:11101:20469:1097 1:N:0:TATAGCCT+GGTCCCGA",
 		"CTCTTGGACTCTAACACTGTTTTTTCTTATGAAAACACAGGAGTGATGACTAGTTGAGTGCATTCTTATGAGACTCATAGTCATTCTATGATGTAGTTTTCCTTAGGAGGACATTTTTTACATGAAATTATTAACCTAAATAGAGTTGATC",


=====================================
src/read.h
=====================================
@@ -31,6 +31,7 @@ public:
     void resize(int len);
     void convertPhred64To33();
     void trimFront(int len);
+    bool fixMGI();
 
 public:
     static bool test();


=====================================
src/seprocessor.cpp
=====================================
@@ -211,6 +211,11 @@ bool SingleEndProcessor::processSingleEnd(ReadPack* pack, ThreadConfig* config){
             delete or1;
             continue;
         }
+
+        // fix MGI
+        if(mOptions->fixMGI) {
+            or1->fixMGI();
+        }
         
         // umi processing
         if(mOptions->umi.enabled)



View it on GitLab: https://salsa.debian.org/med-team/fastp/-/commit/fcc688de8b9e557ac57e748c83f2c7b16c6a6755

-- 
View it on GitLab: https://salsa.debian.org/med-team/fastp/-/commit/fcc688de8b9e557ac57e748c83f2c7b16c6a6755
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20200411/0b5acf30/attachment-0001.html>


More information about the debian-med-commit mailing list