[med-svn] [Git][med-team/covtobed][master] 6 commits: New upstream version 1.1.4+dfsg

Nilesh Patra gitlab at salsa.debian.org
Tue Sep 22 14:15:34 BST 2020



Nilesh Patra pushed to branch master at Debian Med / covtobed


Commits:
67aa1fbc by Nilesh Patra at 2020-09-22T18:25:28+05:30
New upstream version 1.1.4+dfsg
- - - - -
19dfbab0 by Nilesh Patra at 2020-09-22T18:25:57+05:30
Update upstream source from tag 'upstream/1.1.4+dfsg'

Update to upstream version '1.1.4+dfsg'
with Debian dir 5d02ce817c71c774446941b7081840fed7e39bd9
- - - - -
c948acaa by Nilesh Patra at 2020-09-22T13:11:15+00:00
Update manpage with new version

- - - - -
dc1e91a1 by Nilesh Patra at 2020-09-22T18:42:06+05:30
Update changelog

- - - - -
a47b17fa by Nilesh Patra at 2020-09-22T18:42:33+05:30
routine-update: Ready to upload to unstable

- - - - -
be368b6a by Nilesh Patra at 2020-09-22T18:44:57+05:30
routine-update: Ready to upload to unstable

- - - - -


6 changed files:

- .gitignore
- CONTRIBUTING.md
- base.cpp
- benchmark/disk_file.sh
- debian/changelog
- debian/mans/covtobed.1


Changes:

=====================================
.gitignore
=====================================
@@ -18,3 +18,6 @@ pannelli
 paper/paper.md~
 TE
 split_sam_by_flag.pl
+mini_tests
+.vscode
+prova.sh


=====================================
CONTRIBUTING.md
=====================================
@@ -1,4 +1,6 @@
-If you wish to fix a bug or add new features to the software we welcome Pull Requests. 
+# Contributing to `covtobed`
+
+If you wish to fix a bug or add new features to the software we welcome **Pull Requests**. 
 
 We use [GitHub Flow style development](https://guides.github.com/introduction/flow/). 
 


=====================================
base.cpp
=====================================
@@ -1,4 +1,4 @@
-	#include <queue>
+#include <queue>
 #include <vector>
 #include <iostream>
 #include <map>
@@ -16,7 +16,7 @@ using namespace std;
 typedef uint32_t DepthType; // type for depth of coverage, kept it small
 const char ref_char = '>';  // reference prefix for "counts" output
 
-const string VERSION = "%prog 1.1.2"
+const string VERSION = "%prog 1.1.4"
 	"\nCopyright (C) 2014-2019 Giovanni Birolo and Andrea Telatin\n"
 	"https://github.com/telatin/covtobed - License MIT"
 	".\n"
@@ -61,11 +61,17 @@ class Input {
 		bool get_next_alignment(BamAlignment & alignment) {
 			bool more_alignments, good_alignment;
 			do {
-				debug cerr << "[M] " << alignment.Name << ":" << alignment.Position << " | Is mapped? " << alignment.IsMapped() << endl;
+				debug cerr << "[M] Read  on ref#" << alignment.RefID << " pos:" << alignment.Position << 
+				    "\n\t| Is mapped? " << alignment.IsMapped() << " | AlignmentFlag:" << alignment.AlignmentFlag << endl;
 				more_alignments = input_bams.GetNextAlignmentCore(alignment);
 				if (discard_invalid_alignments) {
 					good_alignment = alignment.IsMapped() && alignment.MapQuality >= min_mapq
-									&& !alignment.IsDuplicate() && !alignment.IsFailedQC() && alignment.IsPrimaryAlignment() ;
+									&& !alignment.IsDuplicate() && !alignment.IsFailedQC() && alignment.IsPrimaryAlignment();
+
+					// 1.2.0 ProperPair
+					if (alignment.IsPaired() && ! alignment.IsProperPair() ) {
+					    good_alignment = false;
+					}
 				} else {
 					good_alignment = alignment.IsMapped() && alignment.MapQuality >= min_mapq;
 				}
@@ -210,6 +216,7 @@ int main(int argc, char *argv[]) {
 		min_mapq = options.get("min_mapq");
 	}
 
+
 	try {
 		// open input and output
 		Input input(parser.args(), min_mapq, only_valid);
@@ -247,6 +254,7 @@ int main(int argc, char *argv[]) {
 				while (more_alignments_for_ref && next_change == alignment.Position) {
 					if (physical_coverage) {
 						if (alignment.InsertSize > 0) {
+						        debug cerr << "   [phy] pos:" << alignment.Position << " size:" << alignment.InsertSize << endl;
 							coverage_ends.push({alignment.Position + alignment.InsertSize, alignment.IsReverseStrand()});
 							coverage.inc(alignment.IsReverseStrand());
 						}
@@ -266,9 +274,13 @@ int main(int argc, char *argv[]) {
 				debug cerr << "[<] Coverage is " << coverage << " from " << next_change << endl;
 				last_pos = next_change;
 			} while (last_pos != ref.RefLength);
-			debug cerr << "[_] Completed at " << ref.RefName << ":" << last_pos << endl;
+			debug cerr << "[_] Completed at " << ref.RefName << ":" << last_pos << " [coverage:"  << coverage_ends.size() << "]" << endl;
 			// reference ended
-			assert(coverage_ends.empty());
+			if (!coverage_ends.empty()) {
+			    cerr << "Coverage is not zero at the end of " << ref.RefName << endl;
+			    cerr << "Try samtools fixmate on the input file" << endl;
+			}
+			// 1.2.0 -- removed: assert(coverage_ends.empty());
 		}
 		//assert(!more_alignments);
 		if (more_alignments) {


=====================================
benchmark/disk_file.sh
=====================================
@@ -20,14 +20,13 @@ if [ ! -e "$FILE" ]; then
 	exit
 fi
 
-	TAG=$(basename $FILE | cut -f1 -d.)
+TAG=$(basename $FILE | cut -f1 -d.)
 
-	echo "$TAG [$FILE]"
-	hyperfine --warmup 2 --min-runs 6 --cleanup 'rm *.bed mos?_*.* || true' \
+echo "$TAG [$FILE]"
+hyperfine --warmup 2 --min-runs 6 --cleanup 'rm *.bed mos?_*.* || true' \
 		--export-markdown disk_$TAG.md \
 		"mosdepth -F 4 -x -t 4 mos4_ $FILE" \
 		"mosdepth -F 4 -x      mos1_ $FILE" \
 		"covtobed $FILE > covtobed_$TAG.bed" \
-		"sambamba depth base -F 'not unmapped' $FILE > sambamba.txt.bed" \
-		"sambamba depth window -F 'not unmapped' -w 1000 $FILE > sambamba2.txt.bed"\
 		"bedtools genomecov -bga -ibam $FILE > bedtools_$TAG.bed"
+


=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+covtobed (1.1.4+dfsg-1) unstable; urgency=medium
+
+  * Team Upload.
+  * New upstream version 1.1.4+dfsg
+  * Update manpage with new version
+
+ -- Nilesh Patra <npatra974 at gmail.com>  Tue, 22 Sep 2020 18:42:33 +0530
+
 covtobed (1.1.2+dfsg-2) unstable; urgency=medium
 
   * Team upload.


=====================================
debian/mans/covtobed.1
=====================================
@@ -1,12 +1,12 @@
-.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.47.8.
-.TH COVTOBED "1" "May 2020" "covtobed 1.1.2" "User Commands"
+.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.47.16.
+.TH COVTOBED "1" "September 2020" "covtobed 1.1.4" "User Commands"
 .SH NAME
-covtobed \- a tool to generate BED coverage tracks from BAM files
+covtobed \- convert the coverage track from a BAM file into a BED file
 .SH SYNOPSIS
 .B covtobed
 [\fI\,options\/\fR] [\fI\,BAM\/\fR]...
 .SH DESCRIPTION
-Reads one (or more) alignment files (sorted BAM) and prints a BED with the coverage. It will join consecutive bases with the same coverage, and can be used to only print a BED file with the regions having a specific coverage range.
+Computes coverage from alignments
 .SH OPTIONS
 .TP
 \fB\-h\fR, \fB\-\-help\fR
@@ -43,21 +43,3 @@ output coverage and stats separately for each strand
 .TP
 \fB\-\-format\fR=\fI\,CHOICE\/\fR
 output format
-.SH COPYRIGHT
-Copyright \(co 2014\-2019 Giovanni Birolo and Andrea Telatin
-https://github.com/telatin/covtobed \- License MIT.
-.br
-This is free software: you are free to change and redistribute it.
-There is NO WARRANTY, to the extent permitted by law.
-.SH "SEE ALSO"
-The full documentation for
-.B covtobed
-is maintained as a Texinfo manual.  If the
-.B info
-and
-.B covtobed
-programs are properly installed at your site, the command
-.IP
-.B info covtobed
-.PP
-should give you access to the complete manual.



View it on GitLab: https://salsa.debian.org/med-team/covtobed/-/compare/5db5127c048b5ca099f43be445ce0c15d5e8fa11...be368b6aaee2ef7e1b8aeb2853a81ac22856c575

-- 
View it on GitLab: https://salsa.debian.org/med-team/covtobed/-/compare/5db5127c048b5ca099f43be445ce0c15d5e8fa11...be368b6aaee2ef7e1b8aeb2853a81ac22856c575
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/20200922/4996495f/attachment-0001.html>


More information about the debian-med-commit mailing list